Who is the activator?

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!)
Post Reply
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Who is the activator?

Post by ramon.dexter »

So I have a script, that should drop an item when the actor is killed.

The activation of thec script is tied by action special 80 on the actor.

The script is following:

Code: Select all

script "randomDrop_poacher" (void)
{
	int randomController;
	randomController = random(0,5);

	str items2drop[6] = {
		"ClipOfBullets",
		"Gold10",
		"Gold25",
		"MedPatch",
		"MedicalKit",
		"Hyposprej"
	};
	DropItem(0, items2drop[randomController], 1, 256);
	ACS_NamedExecuteAlways("poachersKilled", 0);
}
As the wiki says, when 0 is set as actor TID (who should drop the item), it's the TID of the activator of the script. But who is the activator, when the script is connected to the monster? Is monster (while dies) activator of the script? Or is player the activator, who killed the monster?

Baecause, whe it is set with 0, it does not drop anything. When I set it according to monsters TID, things are dropeed.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Who is the activator?

Post by Blue Shadow »

Unless you have [wiki=Map_definition#ActivateOwnDeathSpecials]ActivateOwnDeathSpecials[/wiki] flag set for your map, the activator should be the killer.
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Who is the activator?

Post by ramon.dexter »

OK, thanks a lot :)
Post Reply

Return to “Scripting”