Lua questions.
Moderator: Moderators
Lua questions.
I have grown fond on many of the C&C style construction features let's say I was going to add the following in for my mod(I am in the planing stage for this):
Repair icon:
click it then click unit to start unit repair
Sell icon:
sells building rather then self-d, small resource gain
Tech research:
you build up research points by diverting resourced to a resource building. The tech research points are built up and you may then spend them on a research item(which is a button in the gui)
Lua based building construction:
You click the defense or building icon in the hud, you then click the construction yard number(you will be able to have up to 10). Depending on what buildings are alive at the time(read requisites) You can que up construction TA style from lua to anywhere within your control proximity(los)
Factory Buildings(unit construction):
Would be a separate element, would need to have their build menus control via lua to lock or unlock units(is this possible). Otherwise same as above.
There would be 2 new resources:
Refined parts and research points
refined parts would be used in all mech construction.
Ota resources changed to:
metal:
being used to build more simplistic units and buildings utilizing metal as well.
Energy:
would be relegated to a C&C style powerbar that will shut down buildings when they are built if you lack the power
now, what would happen to an ai in this setup? Is all of this possible in lua? Does smoth need to stop designing before thinking of what is do-able in spring?
Repair icon:
click it then click unit to start unit repair
Sell icon:
sells building rather then self-d, small resource gain
Tech research:
you build up research points by diverting resourced to a resource building. The tech research points are built up and you may then spend them on a research item(which is a button in the gui)
Lua based building construction:
You click the defense or building icon in the hud, you then click the construction yard number(you will be able to have up to 10). Depending on what buildings are alive at the time(read requisites) You can que up construction TA style from lua to anywhere within your control proximity(los)
Factory Buildings(unit construction):
Would be a separate element, would need to have their build menus control via lua to lock or unlock units(is this possible). Otherwise same as above.
There would be 2 new resources:
Refined parts and research points
refined parts would be used in all mech construction.
Ota resources changed to:
metal:
being used to build more simplistic units and buildings utilizing metal as well.
Energy:
would be relegated to a C&C style powerbar that will shut down buildings when they are built if you lack the power
now, what would happen to an ai in this setup? Is all of this possible in lua? Does smoth need to stop designing before thinking of what is do-able in spring?
AI can't interface with Lua at all AFAIK.
If you want to repurpose energy that much I'd suggest not using the hardcoded resource for that and instead keeping track of an energy value in Lua, if you don't use it for reclaiming and such you don't need a hardcoded resource. In fact I wonder why you still plan on using the hardcoded resources at all.
I think C&C style building would be trivially easy to do, most of it is a finger exercisse for the scripter and the only real interface with the engine would be the buttons and spawning the resulting units.
If you want to repurpose energy that much I'd suggest not using the hardcoded resource for that and instead keeping track of an energy value in Lua, if you don't use it for reclaiming and such you don't need a hardcoded resource. In fact I wonder why you still plan on using the hardcoded resources at all.
I think C&C style building would be trivially easy to do, most of it is a finger exercisse for the scripter and the only real interface with the engine would be the buttons and spawning the resulting units.
I don't think it's that bad, depends on whether you let the engine handle the build process (i.e. normal factory with workertime etc) or do it trough Lua (have a timer tick down, when it hits zero spawn the unit at the desired factory).smoth wrote:what do you think about the unit locks via lua? how bad is that?