I need help with some monster decorate coding.

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
lizardcommando
Posts: 1489
Joined: Thu Sep 07, 2006 12:24 pm
Location: Boringland, California

I need help with some monster decorate coding.

Post 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?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post 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.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by Matt »

[wiki]A_SpawnItemEx[/wiki]
User avatar
lizardcommando
Posts: 1489
Joined: Thu Sep 07, 2006 12:24 pm
Location: Boringland, California

Post 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?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post 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!
User avatar
lizardcommando
Posts: 1489
Joined: Thu Sep 07, 2006 12:24 pm
Location: Boringland, California

Post 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.
User avatar
Unknown_Assassin
Posts: 2468
Joined: Wed Apr 12, 2006 5:17 pm
Location: Where dead carcasses lie
Contact:

Post 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.
User avatar
lizardcommando
Posts: 1489
Joined: Thu Sep 07, 2006 12:24 pm
Location: Boringland, California

Post by lizardcommando »

Alright, I'll try that. So what exactly is the "meleesound" flag for?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by Matt »

That's what it plays when its melee attack actually hits, like the imp's scratch or the revenant's punch.
User avatar
lizardcommando
Posts: 1489
Joined: Thu Sep 07, 2006 12:24 pm
Location: Boringland, California

Post by lizardcommando »

Ah. Ok. I got confused with that part.
Locked

Return to “Editing (Archive)”