Scripting updates - Page 3

Scripting updates

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Tim Blokdijk wrote:Suggestion:
Allow scripting (not hard coded) that can help a unit to think for itself.
Like planes returning to a air repair pad.
Unit's to collect ammo.
A stealth unit to avoid los detection.
A zombie unit to randomly walk over the map destroying whatever it finds.
A construction unit capable to construct a fully functional base on it's own.

Maybe code can be used from the AI subsystem?
..A game that plays for you...
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

They are supposed to... but they don' t. I just tested it. In fact, I can't even figure out how to make repair pads work at all, even trying to force it... fortunately units gain health back on their own.
Last edited by SinbadEV on 12 Sep 2005, 13:37, edited 1 time in total.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

Gnome wrote:
Tim Blokdijk wrote:Suggestion:
Allow scripting (not hard coded) that can help a unit to think for itself.
Like planes returning to a air repair pad.
Unit's to collect ammo.
A stealth unit to avoid los detection.
A zombie unit to randomly walk over the map destroying whatever it finds.
A construction unit capable to construct a fully functional base on it's own.

Maybe code can be used from the AI subsystem?
..A game that plays for you...
Well, maybe if the modder really likes to but I mean smaller things.
You can script more human behavior to.
Fleeing from the enemy as in the total war games?
Or construction unit's that automatic move away from enemy fire?
Things like that.

Scripteble by the unit maker, not the player btw.
Otherwise you get a arms race for how has the best scripts.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Guessmyname wrote:The ability for units to know when and what they are transporting: OnTransporting(unitname), and to tell what they are being transported by: OnGetTransport(unitname). Very useful for WD when APCs need to have a gunner or infantry bloke loaded to fire its mounted machine gun, or where units can run out of ammo and have to load them selves into an ammo-dispencing unit / building to get more ammo.

Also, the ability to change how much energy / metal the unit is using / making, maybe something like this: energy = +10 or something
The first is possible via unitheight, the second isn't exactly possible, but it is possible to detect *if* a unit is being transported.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

GrOuNd_ZeRo wrote:...
Perhaps the same can be done if you attempt to build a radar tower, it will build a floating one instead, the only problem here will be that there will have to be a seperate unit for every possibility I.E. wind gen for land, sea...
...
Probably there would be no need to have all land buildings as water buildings as well. Just some needed ones, like the Radar Tower and some more.

The unit would need to have 2 diferent models (or an extra model to be added underneath it), one without the floating stuff for land and under water and another with the floating stuff for top of water.
As for having the model with the floating parts built in and having them be hiden underneath the land, is an interesting idea although i wonder if with hilly or deformed ground they wouldn't show up...
I see another problem here... A floating Missile Tower has a bigger footprint that the land missile tower. Maybe this is easy to solve!?

Also, as gnome(?) sugested, the water ones should be more expensive (the floating ones and not the underwater ones. Possibly, even the underwater ones, too.) to acount for the extra floating stuff beeing built. The problem i see with this is GUI related as to how to show the player that the building will cost more if built on water...
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

I would like the possibility for something like this:
Image
For underwater geothermals or something. (maybe oil wars in a mod like WD!?)

The problem is that water hasn't always the same depth and, so, the structure that goes from the top to the underwater ground has to be of variable height.
User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post by FireCrack »

^Not necesairly, you could just make a few realy long piles that extend far beyond the origin of the building, downwards to a depth no mapper in the right mind would use, then these would intewrsect the ground nicely.

(Well, i dont know if it would wotrk like that in spring, but that's generaly how these matters tend to work...)
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post by Kuroneko »

FireCrack wrote:^Not necesairly, you could just make a few realy long piles that extend far beyond the origin of the building, downwards to a depth no mapper in the right mind would use, then these would intewrsect the ground nicely.

(Well, i dont know if it would wotrk like that in spring, but that's generaly how these matters tend to work...)
aka it would need to be a "floating" building, instead of one rooted to the bottom of the water.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

yeah... "floadting building" with really long stilts that would just be hidden under any extra seabed...
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Yeah, use a floating building. Then use (get PIECE_Y(base) - get GROUND_HEIGHT(get PIECE_XZ(base))) to get the the depth. Make the script adjust the legs accordingly.
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

We actually have a few units in TA:WD that are similar to this but they are floating currently, it would be sweet if the script adjusted the legs like ZW suggested.

We have the Ore mining platform and Offshore Powerplant (currently not implented since Maestro is redoing naval stuff).

as for OTA, it would be nice if Spring could just determine which version to use for the metal extracting, etc and adjust the build cost accordingly...
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

My most-wanted list:

The ability to change the health via the script - but using a number rather than a percentage

The ability for factories to tell what they are building, so that they can change the building animations accordingly

The ability to change how powerful the armoured state is via the script

The ability to stop units from moving via the script

Buildings able to build buildings - not really script based, but still useful none the less (unless they can already can do that that is...)

Make it easier to make walking animations! (though see the thing at the very bottom)

While this has nothing to do with scripting, a program that lets you test things like weapons and movement anims would be very useful for debugging / improving dodgy-looking animations and weapons would be very useful
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Guessmyname wrote:My most-wanted list:

The ability to change the health via the script - but using a number rather than a percentage
Dragon45 did it, but it was percentage. Could probably be adapted though. Look up his post in this forum.
The ability for factories to tell what they are building, so that they can change the building animations accordingly
Agree
The ability to change how powerful the armoured state is via the script
Agree
The ability to stop units from moving via the script
Tried doing it myself once, couldn't figure out what thing to set to 0 in the engine itself. But yeah, agree.
Buildings able to build buildings - not really script based, but still useful none the less (unless they can already can do that that is...)
Haven't tried it, but I'm guessing not possible due to yardmaps atm. I'm thinking of a way you could still manage it though.
Make it easier to make walking animations! (though see the thing at the very bottom)

While this has nothing to do with scripting, a program that lets you test things like weapons and movement anims would be very useful for debugging / improving dodgy-looking animations and weapons would be very useful
http://fileuniverse.com/?p=showitem&ID=193
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Gnome wrote:
Guessmyname wrote:My most-wanted list:

The ability to change the health via the script - but using a number rather than a percentage
Dragon45 did it, but it was percentage. Could probably be adapted though. Look up his post in this forum.
I know that he did it, but that is out of date, and uses percentages...
Gnome wrote:
Guessmyname wrote:Make it easier to make walking animations! (though see the thing at the very bottom)

While this has nothing to do with scripting, a program that lets you test things like weapons and movement anims would be very useful for debugging / improving dodgy-looking animations and weapons would be very useful
http://fileuniverse.com/?p=showitem&ID=193
proof that I should check through the utilities page for updates more often
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Notice the item ID on that thing. That file has been on FU almost literally forever :P
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

You dont *need* anything more than percentages to make it work at all... and even if you did, im sure some moderately complex algebra could make it go up in increments of 50 on some event or something.

BTW I submitted the .diff file to SJ some time ago and it shold hoepfulyl be in the new Spring build (if its not in the 63 build already; i havent checked it).
Post Reply

Return to “Engine”