Maps and Dependency?

Maps and Dependency?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Maps and Dependency?

Post by Argh »

How do I make a map dependent on another file? Can I pull the contents of the other file, via LUA VFS commands, and expect that to work? A simple line in a tdf? How do I go about this? It seems entirely silly to either have all mods contain all possible objects, for World Builder, or to have all maps have to contain all possible objects...
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Maps and Dependency?

Post by user »

try using VFS include.

or VFS load.

or create a modinfo file for your map, and write the dependencies there.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Maps and Dependency?

Post by Argh »

Hrmm.

Code: Select all

VFS.LoadFile("MAP_DEMO",nil,VFS.MOD)
Results in the following error:

Lua LoadCode pcall error = 2, LuaRules/main.lua, [string "LuaRules/main.lua"]:4: Bad VFS access mode

I already tried the modinfo route, it doesn't work. Moreover, I don't want Spring to decide this is a "map".
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Maps and Dependency?

Post by user »

in the wiki it says that only VFS.ZIP_ONLY is avaiable to lua rules synced, but for unsynced it works.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Maps and Dependency?

Post by Argh »

Hrmm. Well, it has to run in sync, there's no way around this. I suppose that the reverse way to go about this is to make my mod dependent on World Builder, that way any map using it loads it... it'd require all mods to start including that dependency, but if it's not present, it's no big deal. That might be the better way to go, anyhow, since some mods won't want to use World Builder for whatever reasons.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Maps and Dependency?

Post by Argh »

Ok, that works. Solved, for now. It'd be nicer if maps called the dependency instead of mods, though.
Post Reply

Return to “Engine”