Air metal return? - Page 2

Air metal return?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Air metal return?

Post 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)...
manored
Posts: 3179
Joined: 15 Nov 2006, 00:37

Re: Air metal return?

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

Re: Air metal return?

Post by KDR_11k »

rattle, when Killed() is called the unit is already dead, killing it again is pointless.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Air metal return?

Post by rattle »

Hence "might be able to". So a unit is officially dead even though the script is still being executed?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Air metal return?

Post 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.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Air metal return?

Post by lurker »

So if you set crashing, it doesn't put it in a state of being not dead? :roll:
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Air metal return?

Post by yuritch »

If you use

Code: Select all

set CRASHING to 1;
plane will enter crashing mode (and will explode upon reaching the ground). If, however, you use

Code: Select all

set CRASHING to 0;
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.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Air metal return?

Post 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.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Air metal return?

Post 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).
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Air metal return?

Post 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
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Air metal return?

Post 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?
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Air metal return?

Post by yuritch »

Looks like the reason for that strange Killed() behaviour was found. I'll test to see what happens with set CRASHING now.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Air metal return?

Post 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.
User avatar
Crayfish
Posts: 481
Joined: 12 Feb 2008, 12:39

Re: Air metal return?

Post 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.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Re: Air metal return?

Post 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?
Post Reply

Return to “Game Development”