[spoiler]
Code: Select all
Actor TriggerProj
{
...
+SEEKERMISSILE
...
States
{
Death:
TNT1 A 0
TNT1 A 0 A_SeekerMissile(0, 0, SMF_LOOK, 256, 0) //Look for a target
TNT1 A 0 ACS_ExecuteAlways(614, 0, 2) //Execute the script
TNT1 A 0 A_Stop
Stop
}
}
In this particular situation, I'm wanting to give health to the attacker if the projectile he fires makes contact with a player on the opposite team. Here is the script:
[spoiler]
Code: Select all
Script 614 (int x)
{
if (SetActivator(0, AAPTR_TRACER)) //If it has a target
{
Switch (x)
{
Case 2:
SetActivatorToTarget(0); //Make the attacker the original activator again
//Give health stuff down below
Break;
}
}
}
Now this setup does work, but there's a very specific situation in which it doesn't work as it should be: If the attackee is looking anywhere but directly at the attacker it doesn't work. After quite a bit of online testing, I've concluded that the SetActivatorToTarget(0); line doesn't work as it should because the attackee still remains the activator of script 614. As I mentioned, if the attackee is directly looking at the attacker the script works as intended.
I've made sure that there's nothing breaking in the seekermissile actor pointer storing because the script passes the if statement everytime, it's the SetActivatorToTarget(0) that breaks. Unless there's some undocumented credentials involving the tracer pointer and seekermissiles being used on players, I'm really not convinced that my code is breaking.
Why would the actor's angle have anything to do with SetActivatorToTarget(0)?