How to make an enemy spawn a object on death?

ElecRei

Member
I've read through the custom object tutorial and feel that I've grasped the basics of creating a custom object but got stumped on how to recreate an enemy like the Yellow Spring Shell.

What I want to do is have an enemy drop something like a ring, spring, etc when the player destroys it. I'm not sure how to go about doing this and so far I've tried messing with the RaiseState and looking into the Spawners category of actions (would A_SpawnObjectRelative work?). The only thing that happens with my recent attempts is when the enemy is destroyed it doesn't spawn a flicky.
 
Enemies (and most things with MF_SHOOTABLE) go into their Deathstates upon being killed. Any "on death" effects should go there.

A_SpawnObjectRelative is indeed what you'd probably use for what you're describing. As an example:

Code:
Freeslot
S_POSS_SPECIALDIE

Object MT_BLUECRAWLA
DeathState = S_POSS_SPECIALDIE

State S_POSS_SPECIALDIE
SpriteName = POSS
SpriteFrame = A
Action = A_SpawnObjectRelative
Var1 = 0
Var2 = MT_RING
Duration = 0
 Next = S_XPLD1


This makes blue crawlas spawn a ring on defeat. You can even keep the flicky spawning by sending the thing to S_XPLD1 (The default "enemy killed" state) when you're finished.
 
The state that spawns a flicky is S_XPLD_FLICKY now in 2.2! Presumably so modders can opt out of flicky spawning by going straight to S_XPLD1 or something
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top