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.
So since Spawn doesn't transfer over the activator of the script, a person would need to directly modify the pointers to assign a master to the spawned class if they needed it to have one.
Here is my attempt of doing so:
#library "acs"
#include "zcommon.acs"
script 999 (void)
{
int tempTID = UniqueTID();
int originalActivator = ActivatorTID();
bool resetTID = FALSE;
if (!originalActivator)
{
originalActivator = UniqueTID();
Thing_ChangeTID(0, originalActivator);
resetTID = TRUE;
}
Spawn("dummyActor", GetActorX(0), GetActorY(0), GetActorZ(0), tempTID);
SetActorProperty(tempTID, APROP_MASTERTID, originalActivator);
SetActivator(tempTID);
int x = SetPointer(AAPTR_MASTER, originalActivator);
SetActivator(originalActivator);
if (resetTID)
Thing_ChangeTID(0, 0);
Print(i:x);
}
The only problem is that the actor's pointers remain unchanged for some strange reason.
Now the Print function at the bottom is used to clarify whether the pointer was accessed and changed. If it prints 1 (which it does), then everything worked out the way it was meant to, but when I try to clarify if the activator of the script is the master of the dummyActor nothing happens. It acts as if the player is not the master of the spawned class.
The actor definition for the class I'm spawning is very, very basic:
actor dummyActor
{
States
{
Spawn:
TNT1 A 0
TNT1 A -1 A_print("Test")
wait
}
}
I'm using A_Print to clarify whether the activator of the ACS script is the master of the actor
I've tried every trick in the book and I've even asked a few others about this issue and they have no idea what is happening either so this is my last resort.