Where to put scripts?

Where to put scripts?

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

Moderator: Moderators

Post Reply
User avatar
maximinus
Posts: 7
Joined: 21 Oct 2009, 16:20

Where to put scripts?

Post by maximinus »

Where do you put scripts having written them? I'm following the guide sticked to the top of this forum and I'm having problems.

Having written a test script, it says to place this in Spring/LuaUI/Widgets/test.lua. As I'm on Linux I've put it into ~/.spring/LuaUI/Widgets/test.lua (and also tried /usr/share/games/spring/LuaUI/Widgets/test.lua) and it fails to show up.

I managed to fiddle enough with the file ~/.spring/LuaUI/Config/BA.lua - BA is the only mod I have right now - to make it work (but not appear when I press F11). But I'm not really sure I know what I'm doing. Is there a canaconical place to put a widget and make it appear all the time to make testing easy?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Where to put scripts?

Post by SirMaverick »

~/.spring/LuaUI/Widgets/test.lua is the right place. If it's not in the F11 widget list there might be lua errors.
Start spring and look in your infolog.txt to see if there are errors reported for your widget (the name should show up). If you fixed the errors it will show up in game (restart spring or "/luaui reload").
User avatar
maximinus
Posts: 7
Joined: 21 Oct 2009, 16:20

Re: Where to put scripts?

Post by maximinus »

I've been a bit of an idiot and posted to 2 seperate topics on this forum. So I'll stop posting here and instead refer anybody to this:

http://springrts.com/phpbb/viewtopic.ph ... 50#p388850

Basically what you say makes complete sense - but checking infolog.txt gives me no clue as to what is happening.
Post Reply

Return to “Lua Scripts”