mapspot-monster spawn question

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
dochist
Posts: 212
Joined: Fri Jul 02, 2004 1:20 am
Contact:

mapspot-monster spawn question

Post by dochist »

i spend a while searching the forums for an answer to this but i guess i just suck at it. i found nothing at the wiky. i guess im just blind or something... anyway. how the hell do i make it so when i spawn a monster it opens a door or does something after i kill him? i tried giving the mapspot the activate tag thing but it didnt work. im completly lost.

:cry:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Use

setthingspecial(tid, special, arg1, arg2, arg3, arg4, arg5);

in your script to set the special that is executed upon the monster's death.
User avatar
dochist
Posts: 212
Joined: Fri Jul 02, 2004 1:20 am
Contact:

Post by dochist »

what should i put on the special? the # of the effect? whaa?
agh, can you give me an example script maybe? im more confused than before. :(
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

It's rather simple...

OK, you give a mapspot a TID of 1 in your editor, and you give the door a tag of 3...

Code: Select all

Script 1 enter
{
        Thing_Spawn (1 /*The TID of the mapspot*/, T_IMP/*Self-explanatory*/, 0/*The imp will be looking east when spawned*/, 2/*The TID of the imp*/);
        SetThingSpecial(2 /*The imp's TID*/, Door_Open/*The special*/, 3 /*The Tag of the door*/, 20/*The door's speed*/);
}
User avatar
dochist
Posts: 212
Joined: Fri Jul 02, 2004 1:20 am
Contact:

Post by dochist »

that was very usefull. thanks. :)

now im trying to make it so the game ends when i kill the caco, i know i can do this with mapinfo but im curious if it can be done with this same thing too. here's the script. doesnt seem to work tho' :(

Code: Select all

script 2 (void)
{
 thing_spawn (1,19,0);
 SetThingSpecial(19, Teleport_Endgame, 0);
}
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

dochist, in short, wrote:Script doesn't work.
That's because you're using thing_spawn and SetThingSpecial incorrectly. Read these pages (1 2), they'll explain how to use them better.

If you still don't get it, here:

Code: Select all

script 2 (void)
{
 thing_spawn (1,T_CACODEMON,0,3/*Note: This is the number that's used to identify the monster, the first number (or name in this case) is just to tell thing_spawn what type of thing to create.*/);
 SetThingSpecial(3, Teleport_Endgame, 0);
}
User avatar
dochist
Posts: 212
Joined: Fri Jul 02, 2004 1:20 am
Contact:

Post by dochist »

now things are getting clear. i just get confused with all the numbers, but im getting there. thanks man. i undestand more now. :D
Locked

Return to “Editing (Archive)”