Scripting updates - Page 2

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

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

In OTA there was HitByWeapon(x,z), but sadly the arguments were normalised to 400, so it could be used to get only the angle, not the radius.

So yes, a OnHit(piecename,xz,y,heading,pitch) function would be nice.

Also, would it be possible for script variable not be be limited to 32bits signed integers? I'd like to be able to use long floats, and character strings. With all the accompagning string function. It would open lots of possibilies, things like: if(get UNIT_TYPE(unit_id)=="ARMCOM")
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

I'm working on a set of test-units for this. These do of course assume that we will use the syntax mentioned...
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

A note: In spring, you'd just need to set "CanMove" to 0 in the FBI to strip away movement abilities from a unit. You wouldn't need to mess with TED classes or anything :)
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Oh good...

"Component" Tower (upgrade thingy)

Image
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

Particle support would be nice, so if infantry get hit they bleed for example, or if a tank get hit there are sparks flying, that'd be cool.
User avatar
Min3mat
Posts: 3455
Joined: 17 Nov 2004, 20:19

Post by Min3mat »

rocket tower looks like it was rinsed from earth 2150 don't be breaking copyright yahear! ;P
Fnordia
Former Engine Dev
Posts: 425
Joined: 13 Aug 2004, 16:11

Post by Fnordia »

Setting values of arbitrary fbi-tags might be something for the future, but not now. It would be powerful, but it is not simple to implement. It would among other things require a rewrite of most of the parsing since we don't just save the propertynames as strings and use their values, there's a lot of parsing done at loadtime. It would also require new script compilers. A better idea for now would probably be to expose some of the more useful values to change through the existing get/set interface.

In general, I don't think we will do any changes which would require updating the syntax of the language and require a new compiler at this time, it will have to wait until it's decided if we should switch to a new scripting language and if so which one for the updated unit format.

Supporting some of the ta:k stuff could be done though I guess, at least if I can find some documentation on what is changed. :)
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

I'm not sure if this is part of scripting or of the model...

http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2149
The possibility for buildings to be built either in land, under water and water surface.

That way, we would only need one metal extractor for land and for under water. Only one radar for land and for water surface. Only one hovercraft plant. Et Cetera.

Maybe they could be made to cost extra if built in water and have, for example, sunking animations if on water.
Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

PauloMorfeo wrote:I'm not sure if this is part of scripting or of the model...

http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2149
The possibility for buildings to be built either in land, under water and water surface.

That way, we would only need one metal extractor for land and for under water. Only one radar for land and for water surface. Only one hovercraft plant. Et Cetera.

Maybe they could be made to cost extra if built in water and have, for example, sunking animations if on water.
I had the same idea, building having the same buildpics, and when you place them, the engine will determine wich one to place.

But..how knowing if you want an unterwater metal convertisser, or one on the top of water?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

In TA the same building can be made buildeable underwater and on land. Land and floating wasn't possible however. Oh and in Spring too, I made building buildeable both underwater and on land without any problem. So don't ask for something that's already supported.
Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

zwzsg wrote:In TA the same building can be made buildeable underwater and on land. Land and floating wasn't possible however. Oh and in Spring too, I made building buildeable both underwater and on land without any problem. So don't ask for something that's already supported.
Sorry for not being an unit maker.
And thus, even if it's supported, I ask about being used...good or bad idea?
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

Torrasque wrote:...
But..how knowing if you want an unterwater metal convertisser, or one on the top of water?
That wouldn't hapen. (at least not acording to what i said.)
For example, the metal extractor is always on the floor.
The metal maker, would have to check if it was on water or on land. On water it is on top of the water, too, but has that sunking animation, so the check.
zwzsg wrote:...
So don't ask for something that's already supported.
No? Why not? I most certainly do not know every single feature already existant and, so, i do not know if it is already there or not. Then i wouldn't ask for anothing at all.
Last edited by PauloMorfeo on 08 Sep 2005, 15:51, edited 1 time in total.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

I think that the units could have description for the diferent orders menus.
For example, there could be these 5 as a basic standard:
- Orders
- Factories
- Resources
- Defensive Structures
- General Structures
When shifting with the arrows, we would start at the orders menu and circle through them.

So we could add orders to the orders menus but have them organized.
We would also be able to create other menus like the menu "Alien Technology", "Research", "Spells" to suit our needs.

If something unclear, ask me to explain further.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

I don't think zwzsg was trying to be rude; he isn't a native English speaker, and technically that was a direct translation of what (I think) he wants to say. I'm sure it'd be pretty hard to learn all the nuances of what to say and what not to say once you've learnt the basics of the language...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Information about a target unit, be it height or TEDClass, that way you can use a particular weapon against a particular type of unit more effectively. Also a way to prioritise what targets to attack first.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

*bump*

Can't believe it but noone seems to have mentioned it, basic trig functions!
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

PauloMorfeo, you inspired me.

Maybe if you try to build a mex on water, spring will determine what you are trying and build an UW mex instead.

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...

it might get confusing...

Another thing that is worth considdering is this:

This is more like PauloMorfeo's suggestion, when you build a windgen on water, the script knows the unit is being build on water and pontoons normally being hidden on the ground, will be drawn on water, so we only need an extra model inside the windgen model.

in this way we could easilly remove many unnecesary units such as the floating defenders and such.

as for mexes, we could do the same, the only problem I see is the build picture which will be a regular mex instead of the UW one.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

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
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

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?
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Patrolling planes automatically reurn to air-repair pads when damaged anyway
Post Reply

Return to “Engine”