Documentation

Documentation

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

Moderator: Moderators

Post Reply
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Documentation

Post by TechnoTone »

I've got the Lua 5.0 reference manual, the "Programming in Lua" manual and I've looked in the API.txt file in my LuaUI folder but I still can't find many commands that people are using in their Lua scripts. An example is the widgetHandler:GetHourTimer() function. I can find no mention of this in any documentation.

What have I missed?

I'm finding it difficult writing the simplest of scripts because I cannot identify the objects/functions that I need.
User avatar
Boirunner
Kernel Panic Co-Developer
Posts: 811
Joined: 05 Feb 2007, 14:24

Post by Boirunner »

i believe the idea is that you learn by reading the provided examples. read working scripts and see how the commands work.

of course, i too wish for better documentation :)
User avatar
Ling_Lover
Posts: 100
Joined: 26 Sep 2006, 11:50

Post by Ling_Lover »

if you know some C++ you could look at the source? or learn enough to know what you're looking at atleast...

seems the best way, to me
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

I'm doing this for fun - it's not supposed to be this difficult/stressful. :(
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Oh, it will be. LUA on Spring is still a bit of a maze right now.

Best way is to download what other people have made and tweak with it.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

TechnoTone:

There's only one dev working on the lua stuff, and so documentation updates
have been taking a backseat to the new synced LUA scripts features for a while.

As for your specific query, the widgetHandler:GetHourTimer() call isn't part of the
raw LuaUI interface, it is provided by widgetHandler (which is completely written
in lua). You can find the source code for widgetHandler in LuaUI/widgets.lua. That
particular call is defined in NewWidget(), along with some other widget specific calls.

P.S. Don't forget: I, too, am only doing this for fun...
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

Thanks for the info. I'm starting to find my way around it - but it's taking some time.

As a developer I completely understand that documentation is often neglected but all I'm really looking for is just a list of the functions that are available.

Am I right in thinking that all the widgetHandler: functions are defined in this widgets.lua file and all the Spring functions are defined in the LuaUI API.txt file? If so then that is exactly what was looking for.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Aww comeon TT. If you're a developer then surely you understand there is no such thing as truly stress-free coding :P
User avatar
TechnoTone
Posts: 165
Joined: 23 Aug 2005, 22:02

Post by TechnoTone »

:lol: - Too true.
Post Reply

Return to “Lua Scripts”