by NeuralStunner » Fri Nov 07, 2014 12:57 pm
Well, it looks like [wiki]SetActivator[/wiki] already supports pointer options. Assuming you'd be able to use TID 0, you could get actor values from the caller's pointed-to actors without needing any extra tinkering Decorate expressions. The function even returns false if the pointer is invalid, so that's your NULL check right there.
Make sure SetActivator can take TID 0 for current activator, and you can do some things:
Spoiler:
Sample scripts:
Code: Select all
Script "GetExists" (Int PtrWho)
{
SetResultValue ( SetActivator(0, PtrWho) );
}
Script "GetHealth" (Int PtrWho)
{
If ( SetActivator(0, PtrWho) ) SetResultValue ( GetActorProperty(0, AProp_Health) );
}
// Etc.
Using from Decorate:
Code: Select all
TNT1 A 0 A_JumpIf (CallACS("GetExists", AAPtr_Target) && (CallACS("GetHealth", AAPtr_Target) <= 0), "Gotcha")
Not as clean-looking (especially once you have to convert ACS fixed point), but it would only require one small change to an ACS function (if that). You can even get elaborate and grab data there's no Decorate expression for.
Graf Zahl wrote:I think they could be grafted on the current parser and expression evaluator.
So on that note, I could go either way on this. Maybe it'd be good to do both (for the sake of ACS functionality as well).
Well, it looks like [wiki]SetActivator[/wiki] already supports pointer options. Assuming you'd be able to use TID 0, you could get actor values from the caller's pointed-to actors without needing any extra tinkering Decorate expressions. The function even returns false if the pointer is invalid, so that's your NULL check right there.
Make sure SetActivator can take TID 0 for current activator, and you can do some things:[spoiler]Sample scripts:[code]Script "GetExists" (Int PtrWho)
{
SetResultValue ( SetActivator(0, PtrWho) );
}
Script "GetHealth" (Int PtrWho)
{
If ( SetActivator(0, PtrWho) ) SetResultValue ( GetActorProperty(0, AProp_Health) );
}
// Etc.[/code]
Using from Decorate:[code]TNT1 A 0 A_JumpIf (CallACS("GetExists", AAPtr_Target) && (CallACS("GetHealth", AAPtr_Target) <= 0), "Gotcha")[/code][/spoiler]Not as clean-looking (especially once you have to convert ACS fixed point), but it would only require one small change to an ACS function (if that). You can even get elaborate and grab data there's no Decorate expression for.
[quote="Graf Zahl"]I think they could be grafted on the current parser and expression evaluator.[/quote]So on that note, I could go either way on this. Maybe it'd be good to do both (for the sake of ACS functionality as well).