[COB constants] Modders - Your thoughts please

[COB constants] Modders - Your thoughts please

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
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

[COB constants] Modders - Your thoughts please

Post by FLOZi »

Gimmie some COB get/set constants you think would be useful (and plausible)!

Currently working on:
  • get POW (base, exponent) - returns the result of base ^ exponent as a 'fake float' (i.e. 2^16 = 1, 2^8 =0.5 etc). Values should be passed as * 2^16. e.g. get POW (262144 /*2^16 x 4*/, 32768 /*2^16 x 0.5*/) takes the square root of 4. (Why? So we can have fp values of course)
  • get PRINT (p1, p2, p3, p4) - prints the value of p1 to p4 to the game console

    New suggestions:
  • get/set STEALTH
  • get/set FUEL
Further possibilities would be extra trig functions like SIN, COS, TAN using the 'fake float' method. Unit-specific values (not unit-def (FBI) values) are also fairly easy to get/set. e.g. STEALTH

So yeah, basically I want to know what you have / think you may have need for.
Last edited by FLOZi on 08 Apr 2007, 01:44, edited 2 times in total.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

set STEALTH, definitely.

Some of these would be nice. Out of all of them I'd say #3 is the most important/interesting.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

set HEALTH and set MAXHEALTH
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Guessmyname wrote:set HEALTH and set MAXHEALTH
You can already set MAX_HEALTH...
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

you can? I thought that patch wasn't commited
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: [COB constants] Modders - Your thoughts please

Post by rattle »

FLOZi wrote:
  • get POW (base, exponent) - returns the result of base ^ exponent as a 'fake float' (i.e. 2^16 = 1, 2^8 =0.5 etc). Values should be passed as * 2^16. e.g. get POW (262144 /*2^16 x 4*/, 32768 /*2^16 x 0.5*/) takes the square root of 4. (Why? So we can have fp values of course)
To make things easier you could change the multiplier for [] to 65536 in scriptor's options (as zwzsg mentioned), i.e. get POW([4]/2, [0.5]/2).

Hmm there's a lot of useful things. Would it be possible to modify weapon stats of a weapon on the unit? Was thinking of changing things like burst or burstrate, i.e. set BURST(weaponNumOnUnit, newValue). Doubt it though. Hmm no these changes can be only global... :(
Would be cool if each unit had it's own copy of the weapons on it.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Rattle: for(var i=0;i<burst;++i) { emit-sfx 2048; sleep burstrate; }
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

If I change the value in the TDF I'd have to adjust the script as well. It's twice the work. It is a lot of extra work if you have like 20 units for which you change weapon stats which are getting used in a script.

Of course you could add a define at the top to speed things up but it still requires you to edit and recompile the script.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

get/set FUEL.

get FUEL would allows modder to have planes that hide/show their missile pack, or change the color of the flames their engine emit, depending on fuel left. Very important because right now there's no way to know how much fuel has a plane left, and I anyway according to my philosophy more bars & numbers on screen isn't an adequate solution.

set FUEL is less important, but since if you're doing get FUEL you might as well do set FUEL. I could allows reloading the fuel when planes are landed, or when planes are near some fuel tank, or whatever.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Aerial refuels!
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

zwzsg wrote:get/set FUEL.

get FUEL would allows modder to have planes that hide/show their missile pack, or change the color of the flames their engine emit, depending on fuel left. Very important because right now there's no way to know how much fuel has a plane left, and I anyway according to my philosophy more bars & numbers on screen isn't an adequate solution.

set FUEL is less important, but since if you're doing get FUEL you might as well do set FUEL. I could allows reloading the fuel when planes are landed, or when planes are near some fuel tank, or whatever.
Excellent suggestion from the french master! :-)
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Post by Archangel of Death »

Isn't the only thing stopping Fuel from being used on non-aircraft the lack of ability for them to have something like a repair pad to refuel them? Being able to SET fuel lets us get over that limitation.

Am I just saying that I think SET fuel isn't less important? Hmm, I think so.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Archangel of Death wrote:Am I just saying that I think SET fuel isn't less important? Hmm, I think so.
+1. Could even do some crazy things with that like having an ability that is toggeled by off/on, and drains fuel.
pintle
Posts: 1763
Joined: 19 Dec 2005, 16:01

Post by pintle »

flamethrowers?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Weapons can already drain fuel.
pintle
Posts: 1763
Joined: 19 Dec 2005, 16:01

Post by pintle »

...and thats why i shouldnt post in the development forum
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

Non-air units could use set and get fuel to make a unit that has "mana" to be used up when fireing weapons and then regenerate it or whatever.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Kinda off topic, but from what Zpock just said, I realised that indeed, Fuel could just be the individual Mana bars we're lacking! Just add some SelfRefuel FBI tag, and you get spell weapon that use slowly refilling mana! (Yes a script function that constantly loop and regularly do +1 to the fuel can replace that FBI tag, but a FBI tag would be easier to work with, for all those people who aren't at ease with BOS and programming.) (Btw, it seems that currently, the refuel time is defined in the plane FBI and not in the refuel base FBI. I believe it should be the other way around, so that big air pads refuel faster than small air pads. And if you need plane that refuel faster than other, well, just give them smaller fuel storage and fuel consumption).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I think the airpad should have a multiplier but each plane should still have its own refuel time. Isn't fuel consumed at a fixed rate of 1/sec anyway?

Also if fuel was used as mana it should be renamed (perhaps with a string defined in the fbi?). And what happens when a unit has less fuel than a weapon uses, does it stop firing or does it fire once and return to base?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

I think the airpad should have a multiplier but each plane should still have its own refuel time. Isn't fuel consumed at a fixed rate of 1/sec anyway?
Well, then the fuel consumption for flying should be defined in the plane FBI. Especially so we can set it to 0 considering it's the only way to have units that use fuel only with their weapon. And then, plane wouldn't to define their refuel time by pad, only their max fuel storage, flight fuel consumption, weapon fuel use.
Also if fuel was used as mana it should be renamed (perhaps with a string defined in the fbi?).
The name of fuel, metal, and energy should indeed by renamable, however to me it sounds more like a "needs moar moddable GUI" issue. In the FBI it's best to keep names the same.
And what happens when a unit has less fuel than a weapon uses, does it stop firing or does it fire once and return to base?
I assume that if you have less fuel than what the weapon would take, you can't fire. Doesn't make sense to be otherwise, the last shot could basically free. I mean, it would be like being able to fire the annihilator as long as you have 1 energy left, that's just wrong.
Post Reply

Return to “Engine”