Kurt J. said: non said: I think this is a Scriptcard issue so I thought that maybe this would be the better place to ask: currently I'm trying to make a Macro that deals damage and then checks to see if a creature is going to be below 50% hp or 0% hp and apply the Red or Dead Statusmarker respectively. So far it works but when I run it, it asks for a Target 2 times, the first for a 'Target' and the second for a '1'. Here's the exact syntax: @{target|1|hp|max} If I try that syntax outside of a Scriptcard it works without asking for a second target. I can't change the '1' out since without it, the check returns 'undefined,' so I'm a bit stuck. I've also tried using the '[*T:var]' syntax but that also yields 'undefined.' I'm using that like so: [*T:1|hp|max] If y'all know a better way to get the Max HP of a @{target} within Scriptcards it'd be much appreciated, thanks! For the sake of thoroughness, here's the line in its context: --:Mark|
--=HalfHP|@{target|1|hp|max} \ 2
--=TotalHP|@{target|bar1} + @{target|bar3}
--=EstFinalHP|[$TotalHP] - [$TotalDamage]
--? [$EstFinalHP] -le [$HalfHP]|MarkRed
--? [$EstFinalHP] -le 0|MarkDead
--:ReturnMark|
--<| @{} notation is processed by the chat server before ScriptCards ever sees it. The reason you are being prompted twice is that your macro is asking for two targets: an unamed targetwith @{target|bar3} and a target named "1" with @{target|1|hp|max}. In both cases, ScriptCards only gets to see the final result of this lookup, and never knows there was any targeting done. If you wish to use the [*T:] notation, you need to set the #targettoken parameter. This can be done like this: --#targettoken|@{target|token_id}. From then on, you can use [*T:attribute] to retrieve character attributes or [*T:t-attribute] to retrieve token attributes. Since it isn't a complete script, I can't test it, but something along these lines should work: --:Mark|
--#targettoken|@{target|token_id}
--=HalfHP|[*T:hp^] \ 2
--=EstFinalHP|[*T:hp] - [$TotalDamage]
--? [$EstFinalHP] -le [$HalfHP]|MarkRed
--? [$EstFinalHP] -le 0|MarkDead
--:ReturnMark|
--<| Also, if you are using something like Token_mod, etc to apply the damage, keep in mind that it won't take place until after the script completes, so it isn't possible to check before and after status of attributes. What you have above is the right way to do it (look at what it was beforehand and subtract the new damage amount and compare that. The hp^ syntax works exactly like I needed it to, thanks!