Maps and Dependency?
Moderator: Moderators
Maps and Dependency?
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...
Re: Maps and Dependency?
try using VFS include.
or VFS load.
or create a modinfo file for your map, and write the dependencies there.
or VFS load.
or create a modinfo file for your map, and write the dependencies there.
Re: Maps and Dependency?
Hrmm.
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".
Code: Select all
VFS.LoadFile("MAP_DEMO",nil,VFS.MOD)
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".
Re: Maps and Dependency?
in the wiki it says that only VFS.ZIP_ONLY is avaiable to lua rules synced, but for unsynced it works.
Re: Maps and Dependency?
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.
Re: Maps and Dependency?
Ok, that works. Solved, for now. It'd be nicer if maps called the dependency instead of mods, though.