Lua "base files" that game needs?

Lua "base files" that game needs?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Lua "base files" that game needs?

Post by knorke »

My mod is broken in 94.1, So I thought it is because some of the files in myMod\LuaRules\ are maybe wrong or outdated.
But then I noticed I do not know where to get correct ones.
I mean the files such as
draw.lua
gadgets.lua
system.lua
main.lua
gadgets\unit_script.lua
and maybe more or less.

Which files must be copypasted into mod so it works?
In other mods those files seem to have game-specifique things added to them?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Lua "base files" that game needs?

Post by Forboding Angel »

Technically you shouldn't need those as they are already in basecontent.

What errors are you getting? (If any)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua "base files" that game needs?

Post by knorke »

The files are in base content but as I understand you still have to include them.
So at least needs a unit_script.lua with something like

Code: Select all

return include("LuaGadgets/Gadgets/unit_script.lua")
etc (or put in the whole file but that is stupid)
but even for something appearently simple there is variations like

Code: Select all

return VFS.Include("LuaGadgets/Gadgets/unit_script.lua", nil, VFS.ZIP_ONLY)
And in other files is often more strange things that I dont understand.
Plus the stuff added by mods like for example
https://code.google.com/p/evolutionrts/ ... s/draw.lua

Code: Select all

if (Spring.GetModOption("camode")=="deploy")or
   (Spring.GetModOption("camode")=="tactics")
then
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Lua "base files" that game needs?

Post by FLOZi »

http://mwspring.svn.sourceforge.net/vie ... athrev=565

All you 'need' are main.lua, draw.lua and a unit_script.lua is ofc a good addition.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Lua "base files" that game needs?

Post by knorke »

thanks flozi.
Post Reply

Return to “Lua Scripts”