Severed bunny head
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Spawn Key When Killing Actor
 
Author
All times are GMT. The time now is 15:12. Post New Thread    Post A Reply
Phendrena
Junior Member


Posts: 179
Registered: 09-12


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

Old Post 11-24-12 22:07 #
Phendrena is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Kappes Buur
Forum Regular


Posts: 856
Registered: 11-02


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

Last edited by Kappes Buur on 11-24-12 at 23:11

Old Post 11-24-12 22:48 #
Kappes Buur is offline Profile || Blog || Search || Add Buddy IP || Edit/Delete || Quote
Obsidian
Senior Member


Posts: 2472
Registered: 05-12



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.

Old Post 11-25-12 00:00 #
Obsidian is online now Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Phendrena
Junior Member


Posts: 179
Registered: 09-12


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??

Old Post 11-25-12 11:59 #
Phendrena is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Blue Shadow
Member


Posts: 285
Registered: 09-12


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:

code:
Script 1 (int tid) { Spawn("YellowCard", GetActorX(tid), GetActorY(tid), GetActorZ(tid)); }

Old Post 11-25-12 13:36 #
Blue Shadow is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 11037
Registered: 07-07


As Obsidian pointed out, you don't need to make it a script. You can use a Thing_Spawn special instead.

Old Post 11-25-12 14:00 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Gebstadter
Green Marine


Posts: 36
Registered: 07-12


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.

Old Post 11-25-12 17:50 #
Gebstadter is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Gebstadter
Green Marine


Posts: 36
Registered: 07-12


For illustration, see http://www.math.uiuc.edu/~puleo/doom/spawn.wad

Old Post 11-25-12 17:52 #
Gebstadter is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Phendrena
Junior Member


Posts: 179
Registered: 09-12


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

Old Post 11-25-12 18:56 #
Phendrena is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 15:12. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Spawn Key When Killing Actor

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.