Taking a leap towards LUA

Taking a leap towards LUA

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

Moderator: Moderators

Post Reply
fusioneko
Posts: 6
Joined: 01 Oct 2007, 17:49

Taking a leap towards LUA

Post by fusioneko »

I'm actually quite int ested in looking at how to learn LUA, however I downloaded the binaries from the LUA site but I don't know how to compile the source D: or well something. I just need a kick here and there, could you guys help me rather then throwing me to goto some other place. I rather ask a community Im sure that knows. :P
tombom
Posts: 1933
Joined: 18 Dec 2005, 20:21

Post by tombom »

You don't need the binaries from the Lua site to use Lua in Spring.
fusioneko
Posts: 6
Joined: 01 Oct 2007, 17:49

Post by fusioneko »

Ok, Then Lua is not compiled in anyway?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

No, you only need to put your .lua file into LuaUI/Widgets folder.
fusioneko
Posts: 6
Joined: 01 Oct 2007, 17:49

Post by fusioneko »

:) Thanks alot this helps, Im afraid in the Begginers FAQ It wasn't covered there you might want to make it more noticeable if its not in there. ^_^
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Spring compiles it all for you when the mods loaded, just make sure your lua code has no bugs in it and your good to go.
fusioneko
Posts: 6
Joined: 01 Oct 2007, 17:49

Post by fusioneko »

:D thanks I think I'll look more in depth into it later when I can. I'll proabbly play arround with it, but I don't know how much I'll actually get done. I have to learn the language :D anyone know a good example to study off?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Look at CA for mod gadgets and look at various widgets.
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Post by Felix the Cat »

AF wrote:Spring compiles it all for you when the mods loaded, just make sure your lua code has no bugs in it and your good to go.
Hmm.

What's a good way to test for bugs? Obviously you can't compile and run a Lua file made for Spring as it will have all sorts of unknown identifiers or whatever Lua calls undefined functions and variables.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

You can type "/luaui reload" or ".luarules reload" for a quick check in-game. If you just need to check for syntax errors, you shouldn't have problems compiling the script. Here is the windows version of the compiler.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

quantum wrote:You can type "/luaui reload" or ".luarules reload" for a quick check in-game. If you just need to check for syntax errors, you shouldn't have problems compiling the script. Here is the windows version of the compiler.
Better yet bind luaui reload to a key in uikeys.txt:

Code: Select all

unbind      Any+backspace  mousestate
bind backspace luaui reload
Post Reply

Return to “Lua Scripts”