Attaching a script activator to a spawned 'thing'

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
AshHouswares
Posts: 49
Joined: Fri Jun 03, 2022 11:31 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Not Listed

Attaching a script activator to a spawned 'thing'

Post by AshHouswares »

I've been having a bit of trouble with this... not even sure if it's a possibility or not. I need a monster to spawn in after a trigger activates it in ACS. But I need that monster to have ANOTHER ACS script attached to it so when it dies it triggers another event. I have no problem doing this with normal monsters but ones spawned in through MAPSPOTS seem to be a different thing entirely. Is it possible? Any advice?
User avatar
Blue Shadow
Posts: 4901
Joined: Sun Nov 14, 2010 12:59 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Attaching a script activator to a spawned 'thing'

Post by Blue Shadow »

Most, if not all, spawn functions in ACS allow you to give a TID to the spawned thing. With the TID in hand, you can then call SetThingSpecial to assign the action special you want to the spawned thing.
User avatar
AshHouswares
Posts: 49
Joined: Fri Jun 03, 2022 11:31 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Not Listed

Re: Attaching a script activator to a spawned 'thing'

Post by AshHouswares »

Ahhhhhh I see. Thats pretty clever. Ok I'll be trying this out later today.

Return to “Scripting”