Page 2 of 2
Re: Air metal return?
Posted: 27 Feb 2008, 16:38
by rattle
smoth wrote:unless you do a crash animation. What is the code like to produce a corpse at location? I could use this.
Dunno but you might be able to kill the unit after your animation in Killed(), without self-destruction but leaving a corpse.
Code: Select all
#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false)
get KILL_UNIT(get MY_ID, FALSE, FALSE)
Other than that, Lua
(I know I know)...
Re: Air metal return?
Posted: 27 Feb 2008, 18:32
by manored
kiki wrote:manored wrote:Personally I would want my guns to keep shooting the planes till there was nothing left, cause oftently the planes crash in something importat :)
Agreed, thats how I win speedmetal, with 500 flaks that splode up ur planes even when they have been shot down.
Lol at sinking wrecks, thats funny.
Falling planes would be destroyable to adapt :)
Re: Air metal return?
Posted: 27 Feb 2008, 18:38
by KDR_11k
rattle, when Killed() is called the unit is already dead, killing it again is pointless.
Re: Air metal return?
Posted: 01 Mar 2008, 01:20
by rattle
Hence "might be able to". So a unit is officially dead even though the script is still being executed?
Re: Air metal return?
Posted: 01 Mar 2008, 08:09
by KDR_11k
Killing puts it into the dying state, executes Killed() and deletes the unit once Killed() returns (well, a few frames after). This is even worse for Lua since Gets will pick dead units up but there is no call-in when the unit gets deleted so your reference goes invalid.
Note that crashing is not dying, a unit that crashes doesn't run Killed() until it hits the ground.
Re: Air metal return?
Posted: 03 Mar 2008, 23:43
by lurker
So if you set crashing, it doesn't put it in a state of being not dead?

Re: Air metal return?
Posted: 04 Mar 2008, 07:29
by yuritch
If you use
plane will enter crashing mode (and will explode upon reaching the ground). If, however, you use
before it reaches the ground, it will resume normal behaviour and won't crash or explode. You can use
get CRASHING to see when it's crashing and abort the sequence by setting it back to 0, but beware of the immortal plane that will result - every time it enters crashing state, it gains some HP to make for a better death spiral, and those don't go away if the crashing is aborted :)
Killed() doesn't run on entering crashing mode, it only runs on reaching the ground (or exploding midair) btw, so a crashing unit isn't considered dead.
Re: Air metal return?
Posted: 04 Mar 2008, 07:40
by lurker
You didn't actually answer my question at all there. Yes or no, if you set crashing to 1 in Killed() the unit will stay 'dying' anyway.
Re: Air metal return?
Posted: 04 Mar 2008, 12:26
by yuritch
Ah, so you meant something like that:
Code: Select all
Killed()
{
set CRASHING to 1;
sleep 1000;
}
Well, I don't know what will happen, never thought of this case (it was me who made set/get CRASHING patch btw). The plane will probably enter crashing mode, reach the ground, and then... something will happen (most probably it will get stuck on the ground level until Killed() returns, at which time it will disappear, but I'm not sure at all, and cannot test until I get home from work).
Re: Air metal return?
Posted: 04 Mar 2008, 13:38
by 1v0ry_k1ng
why would you want aircraft to leave wrecks, they are mostly energy and buildtime anyway. unless you play to a very high standard, and Im assuming you are probably new to spring or at least the forums, wrecks for aircraft in BA really are not going to be changing the game mechanics or swinging any battles at all
Re: Air metal return?
Posted: 04 Mar 2008, 18:05
by yuritch
(Spring != BA) && (Spring != TA)

Other mods may want to have plane wrecks.
Edit: I just tried to use set CRASHING in Killed() and found out something odd. Looks like Spring is ignoring any sleep calls in Killed() for planes. Even more, looks like the first sleep (or wait-for-turn, wait-for-move) call causes Killed() to immediately return without executing the remaining statements. This is only so for planes, ground and water units seem to behave properly (i.e. they execute all statements in Killed() before returning). Maybe I did something wrong in my tests, can someone else test this?
Re: Air metal return?
Posted: 12 Mar 2008, 13:03
by yuritch
Looks like the reason for that strange Killed() behaviour
was found. I'll test to see what happens with set CRASHING now.
Re: Air metal return?
Posted: 12 Mar 2008, 16:45
by CarRepairer
yuritch wrote:(Spring != BA) && (Spring != TA)

Other mods may want to have plane wrecks.
de Morgan might alternately say: !( (Spring==BA) || (Spring==TA) )
I want plane wrecks in TA.
Re: Air metal return?
Posted: 12 Mar 2008, 19:07
by Crayfish
1v0ry_k1ng wrote:why would you want aircraft to leave wrecks, they are mostly energy and buildtime anyway. unless you play to a very high standard, and Im assuming you are probably new to spring or at least the forums, wrecks for aircraft in BA really are not going to be changing the game mechanics or swinging any battles at all
Krows and bombers cost a fair whack of metal. Considering the damage they can do, it seems fairer that they are reclaimable on destruction.
Even smaller planes such as fighters could leave corpses with small amounts of metal. Everything except air is reclaimable and reclaiming really does swing battles in both BA and CA (the only mods I'm very familiar with).
If it could be done it should be done in my opinion.
Re: Air metal return?
Posted: 12 Mar 2008, 21:57
by Snipawolf
1v0ry_k1ng wrote:why would you want aircraft to leave wrecks, they are mostly energy and buildtime anyway. unless you play to a very high standard, and Im assuming you are probably new to spring or at least the forums, wrecks for aircraft in BA really are not going to be changing the game mechanics or swinging any battles at all
Moar realism?