Thing activates script
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.
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.
- Scarekrowe
- Posts: 30
- Joined: Fri Mar 19, 2004 2:02 pm
- Location: Kansas/Oklahoma
- Contact:
Thing activates script
Is there any way to make it so when a spawned thing dies, it activates a script?
Yes. When you spawn it, give it a TID. As the next line of your script, use Thing_SetSpecial to assign a special to the object with that TID.
Like so:
When this snippet of code is executed, it will spawn a Cyberdemon at the mapspot with a TID of 100, and gives that Cyberdemon a TID of 666. The next line uses that TID to assign it a special action. After it dies, it will execute script 60 of the current map, passing along 4 as the first argument to that script.
Like so:
Code: Select all
Thing_Spawn(100, T_CYBERDEMON, 190, 666); // Mapspot TID, Thing Type, Angle, New TID
Thing_SetSpecial(666, ACS_Execute, 60, 0, 4); // TID, Special, Arg1 (Script#), Arg2 (Map#), Arg3(Arg1)
- Scarekrowe
- Posts: 30
- Joined: Fri Mar 19, 2004 2:02 pm
- Location: Kansas/Oklahoma
- Contact: