[COB constants] Modders - Your thoughts please - Page 2

[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
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

However it would also mean that if a bomber has e.g. 90 fuel left and needs 20 to fire its weapon it'll shoot four times and then have 10 fuel units left for flight but unable to shoot. It would fly around for 10 seconds while not doing much. Also it would make a single-shot weapon unfeasible. I think the current behaviour is that it can shoot as long as any fuel is left and returns immediately once it hits 0. Unlike e.g. an anni it doesn't start refueling immediately after it's depleted so you still payx the "price" of the refuel time. Not sure if a plane can abort refueling.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

It fires the last shot and then returns to base straight away. It dosn't bother me that this is "unrealistic", it's musch better this way for the ai. Fuel used both for weapons and to propel the unit is an abstraction that throws realism out the window anyway.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

Currently an aircraft cannot abort a refueling sequence. It cannot even be ordered to stop once it's on the way back to base. It cannot fire any weapons either, even those that don't use fuel. Control returns to the player only after the unit had completely refuelled and repaired.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Good thing that.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

Of course, if we want to use fuel as mana for normal units, then we need a tag for this. The unit cannot be allowed to start shooting the 100-mana cost spell as soon as it regens 1 mana. And the player certainly shouldn't loose control of the unit after it uses up the mana either.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

I just realised: for mana, we could simply use a script static-var that the script incremenent and decrement itself, and have the script not fire when it's under X, etc... The only thing the script can't do is showing on the interface what's the mana level. But I guess the LUA magic solves that. So there's no point in using the "fuel" for mana. The only thing the "fuel" does that a script can't do, is to force return to refuel base. For anything else, I don't need the hard coded fuel but can simply use my own scripts (which for mana don't even have to be complex). And I guess if I ever needed to force return to refuel base, I'd simply abuse set FUEL, to script-command it at will, disregarding how it was meant to be used and handled by engine & FBI.


[code]
#define MAX_MANA 80

#define WEAP1_MANA_USE 30

stati-var mana;

ManaReplenish()
{
sleep rand(0,1000);
while(TRUE)
{
if(mana<MAX_MANA)
{
++mana;
}
sleep 1000;
}
}


Create()
{
....
mana=0;
...
start-script ManaReplenish();
}


AimPrimary()
{
sig..
set-sig..
..
while(mana<WEAP1_MANA_USE)
{
sleep 900;
}
..
return(1);
}

FirePrimary()
{
mana=mana - WEAP1_MANA_USE;
...
}

[/code]


And sorry to have hijacked FLOZi's thread with all those fuel & mana disgression.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Mana, ammo, all the same...
Post Reply

Return to “Engine”