[COB constants] Modders - Your thoughts please
Moderator: Moderators
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.
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.
[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.