Phendrena Posted November 24, 2012 Hello!! I'm sure I've read somewhere how to do this, however poking around here and there hasn't helped me find it.... anyway.... When I kill an actor, TID 27 in this case, I would like to spawn a yellow key card. Is anyone able to help me as I can't work out how to do it. Source port is ZDoom (D-in-H format). Thanks, Dave 0 Share this post Link to post
Kappes Buur Posted November 24, 2012 Place a mapspot where you want to spawn the yellow key card. Give it a TID, eg: 100 Then attach this script to the actor. The script will be executed when the actor is killed. script 100 (void) { delay (15); // Thing_Spawn (mapspottid, type, angle, new tid) Thing_Spawn ( 100, T_YELLOWKEYCARD, 0, 0); } Example 0 Share this post Link to post
Obsidian Posted November 25, 2012 Kappes Buur said:Place a mapspot where you want to spawn the yellow key card. Give it a TID, eg: 100 Then attach this script to the actor. The script will be executed when the actor is killed. script 100 (void) { delay (15); // Thing_Spawn (mapspottid, type, angle, new tid) Thing_Spawn ( 100, T_YELLOWKEYCARD, 0, 0); } Example You can do the same thing without a script as well: click the monster, select Action and set it to action 135(Thing Spawn). Then set the Thing ID of the Map Spot and what thing you want to spawn. 0 Share this post Link to post
Phendrena Posted November 25, 2012 I was hoping to have the key 'dropped' by the actor. Am I best to create a custom actor that spawns the key upon death?? 0 Share this post Link to post
Blue Shadow Posted November 25, 2012 You can do that or you can use the Spawn ACS function. Give the monster that you want to drop the key on death a tid (in your case, that would be 27), "Attach" special #80 (ACS_Execute) to it. Set the script number and the first argument. The first argument should be the same as the tid you give to the monster, which, again, in your case is 27. Here is the script to execute: Script 1 (int tid) { Spawn("YellowCard", GetActorX(tid), GetActorY(tid), GetActorZ(tid)); } 0 Share this post Link to post
Gez Posted November 25, 2012 As Obsidian pointed out, you don't need to make it a script. You can use a Thing_Spawn special instead. 0 Share this post Link to post
Gebstadter Posted November 25, 2012 To elaborate on what Gez said, even to have it spawn where the monster falls, you can give the monster a ThingID (say 100) and then attach ThingSpawn to it with a MapSpot Tag equal to the monster's ThingID (in this case 100 again). Admittedly the delay looks a lot better, because with this method the key teleports in (fog and all) before the monster has even hit the ground. 0 Share this post Link to post
Gebstadter Posted November 25, 2012 For illustration, see http://www.math.uiuc.edu/~puleo/doom/spawn.wad 0 Share this post Link to post
Phendrena Posted November 25, 2012 Thanks for the replies. I've done it, as suggested, without using ACS and assigning the actor with Thing Spawn (Silent). This works very nicely. Thank you all, Dave 0 Share this post Link to post