REQ: building templete.

REQ: building templete.

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

Moderator: Moderators

Post Reply
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

REQ: building templete.

Post by Super Mario »

A widget that you can save and build a set of buildings over and over again.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: REQ: building templete.

Post by Pendrokar »

Lua has this function: Spring.TestBuildOrder

So it wouldn't be too hard. Except that I have never worked with Lua OpenGL Api. You are probably thinking one exactly like in Supreme Commander: Forged Alliance?


One problem though, in what queue should constructors build the template?
AFAIK in SA:FA it builds starting from the most costly unit downwards. SA:FA buildings are made that a unit can hardly get stuck in them. So it is different than in most Spring games.

[edit] Ah Im wrong -
Whenever you ask a builder unit to execute this building queue, the builder will execute the build exactly the way construction was done the first time, at exact relative positions.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: REQ: building templete.

Post by Super Mario »

Were do you get your information from? I can't seemed to find it.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: REQ: building templete.

Post by Pendrokar »

Super Mario wrote:Were do you get your information from? I can't seemed to find it.
Here - http://www.gamereplays.org/supremecomma ... _templates

I probably won't make this widget because last time I played Spring was a year ago, then my PC couldn't handle it. Now it can! But now TASClient doesn't work and SpringLobby yells at me...
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: REQ: building templete.

Post by Pendrokar »

Template build test -> ok (I had to have a function to count player's units because ID numbers are random since one update in Spring, so when starting the widget units that were before it cannot be added to a template because it won't know when which units was created :( )

Todo:
Adding templates to file
Reading templates from file
GUI <-- hope for help from other lua scripters that have done graphics :roll:

[edit] BTW where should the GUI be? Maybe adding a command called Templates(if that's possible for a widget?) and it would switch unit icons to template icons which all selected units can build?
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: REQ: building templete.

Post by Pendrokar »

What's done:
file writing
file reading
graphical template building(showing red/green ghosts where you can build and where you can't)

Todo: GUI(template selection)

[edit]
file writing and reading was tested, but didn't work... :(
Last edited by Pendrokar on 20 Jul 2009, 12:19, edited 1 time in total.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: REQ: building templete.

Post by Pendrokar »

making progress -
Image
Post Reply

Return to “Lua Scripts”