UnknownToaster Posted June 28, 2013 Hey, everyone. I'm making a decorate actor and I want it to spawn a different actor upon it's death. (The goal is for it to have a certain amount of health then change to a more difficult version of itself. [I originally wanted to do this with states but I found it might be easier to just make it spawn a second actor on death. If this is not so, do let me know.) Before deciding to make this thread, I found this thread: http://www.doomworld.com/vb/doom-editing/62686-doom-decorate-and-editing-help/ and this page: http://zdoom.org/wiki/A_SpawnItemEx I found the answer that I am using for this cause in that thread but I'm having problems with it, and I thought that people would like it better if I made a thread with a specific problem than bumping such an old thread. Anyhow, I planned on placing A_SpawnItemEx in my actors death state so that once it dies, it can spawn the second actor I wish to use. I found once trying this that I had no errors upon launching the game, but after killing the actor, nothing seemed to have happened. I have it set as so: Death: CYBR H 10 CYBR I 10 A_Scream CYBR JKL 10 CYBR M 10 A_NoBlocking CYBR NO 10 CYBR P 30 CYBR P -1 A_BossDeath CYBR P -1 A_SpawnItemEx("SuperDemon2",0,0,28, 0, 0, 0, 0, 0) Stop Loop } } I tried a few other configurations but they didn't have much effect. Superdemon2 is the name of the actor I wish to call. The first (and the one that this code is from) is called Superdemon. Is this configuration incorrect? It seems I must be doing something incorrectly or am using something incorrectly. If you need to see the rest of the code, I'll put it here. http://pastebin.com/5040HjsP Both of the actors are practically identical for now as I'm trying to get the respawn in beforehand. Any help is greatly appreciated, whether it's fixing my code, showing a better way to do it, or any other hint to help me in the future. Thank you! 0 Share this post Link to post
Rayziik Posted June 28, 2013 Did you try putting the A_SpawnItemEx codepointer on the frame before the A_BossDeath frame? I think the -1 frame duration causes code execution to stop at that point. EDIT: Like This: CYBR P 30 A_SpawnItemEx("SuperDemon2",0,0,28, 0, 0, 0, 0, 0) CYBR P -1 A_BossDeath Stop } } 0 Share this post Link to post
UnknownToaster Posted June 28, 2013 Rayzik said:Did you try putting the A_SpawnItemEx codepointer on the frame before the A_BossDeath frame? I think the -1 frame duration causes code execution to stop at that point. Thank you! I tried it just now and it worked flawlessly. I really appreciate the help! :) I wish I had thought to do that, but I didn't know that would be a problem. I set it to this: CYBR P 30 A_SpawnItemEx("SuperDemon2",0,0,28, 0, 0, 0, 0, 0) CYBR P -1 A_BossDeath Stop Loop } } And it was fine. Great! Thank you! 0 Share this post Link to post