Page 1 of 1
I need help with some monster decorate coding.
Posted: Sat Sep 22, 2007 9:19 pm
by lizardcommando
I just finished making the sprites for a Mech enemy and now I need help with the coding.
How do I have it so that when it dies, it spawns an explosion in front of it? Also, how do I have it so that after it plays its death animation, the mech explodes? What I mean is how do I have it so that after the death animation plays, it turns into an explosion object?
Posted: Sat Sep 22, 2007 9:21 pm
by HotWax
[wiki]A_Explode[/wiki] in the death state, along with an appropriate explosion graphic.
Alternatively, you could also define an object that simply explodes when it appears and have the actor drop that object on death, but I don't see the point of doing it that way, personally.
Posted: Sat Sep 22, 2007 9:57 pm
by Matt
[wiki]A_SpawnItemEx[/wiki]
Posted: Sat Sep 22, 2007 11:49 pm
by lizardcommando
Will the A_SpawnItemEx command work on the current version of ZDoom or is it only for the SVN build of ZDoom and GZDoom only? I'm using the current version of ZDoom only.
BTW, I followed HotWax's advice with the A_Explode thing and it doesn't look that bad. The problem is that it won't make an explosion sound. Do I just add in an extra frame with the A_PlaySound command? Also, I have a question about Melee attacks. How come it'll play the enemy's shooting sound for the melee attack?
Posted: Sun Sep 23, 2007 11:12 am
by HotWax
lizardcommando wrote:The problem is that it won't make an explosion sound. Do I just add in an extra frame with the A_PlaySound command?
Bingo!
Posted: Sun Sep 23, 2007 1:12 pm
by lizardcommando
I got that A_PlaySound thing fixed for the explosion, now the problem I'm having is that every time the mech hits me with its melee attack, it'll make the gunshot sound from its long range attack. How do I fix this.
Posted: Sun Sep 23, 2007 2:50 pm
by Unknown_Assassin
lizardcommando wrote:I got that A_PlaySound thing fixed for the explosion, now the problem I'm having is that every time the mech hits me with its melee attack, it'll make the gunshot sound from its long range attack. How do I fix this.
Add a frame of A_PlaySound. Since you had already define the attack sound for the monster, you will have to use this function to play a different sound.
Posted: Sun Sep 23, 2007 4:24 pm
by lizardcommando
Alright, I'll try that. So what exactly is the "meleesound" flag for?
Posted: Sun Sep 23, 2007 4:29 pm
by Matt
That's what it plays when its melee attack actually hits, like the imp's scratch or the revenant's punch.
Posted: Sun Sep 23, 2007 5:04 pm
by lizardcommando
Ah. Ok. I got confused with that part.