Code: Select all
[h: ids=getWithState("regen")]
[h, foreach(id,ids, <br>), code:
{
[h: HPNonLethalDMG = getProperty("HPNonLethalDMG", id)]
[h, if(HPNonLethalDMG-5 > 0): setProperty("HPNonLethalDMG", HPNonLethalDMG-5, id); setProperty("HPNonLethalDMG",max(HPNonLethalDMG-5,0), id) ]
}]
[g: "All tokens on this map with the token state of "regen" just gained 5 hps"]
So I *cough* borrowed the code from that macro for mine in the hopes that it would do the trick. With some trial and error the best I can get is an error "Error executing "switchToken": the token name or id "" is unknown."
Here is the modified macro:
Code: Select all
[h: ids=getWithState("regen")]
[h, foreach(id,ids, <br>), code:
{
[h: HPNonLethalDMG = getProperty("HPNonLethalDMG", id)]
[h, if(HPNonLethalDMG-5 > 0): setProperty("HPNonLethalDMG", HPNonLethalDMG-5, id); setProperty("HPNonLethalDMG",max(HPNonLethalDMG-5,0), id) ]
[h:selectTokens(id,0)]
[H: tToken = currentToken() ]
[H, MACRO( "subUpdateHPStatesBars@Lib:libDnD35Pathfinder" ): "Token=" + tToken]
}]
[g: "All tokens on this map with the token state of "regen" just gained 5 hps"]
Code: Select all
[h: ids=getWithState("regen")]
[h, foreach(id,ids, <br>), code:
{
[h: HPNonLethalDMG = getProperty("HPNonLethalDMG", id)]
[h, if(HPNonLethalDMG-5 > 0): setProperty("HPNonLethalDMG", HPNonLethalDMG-5, id); setProperty("HPNonLethalDMG",max(HPNonLethalDMG-5,0), id) ]
[H: selectTokens(id,0)]
[h,if(HPNonLethalDMG-5>0),code:
{
[setBar("HPNonLethalDMG",HPNonLethalDMG-5/HPNonLethalDMG)]
};
{
[setBar("HPNonLethalDMG",0)]
}]
}]
[g: "All tokens on this map with the token state of "regen" just gained 5 hps"]
If someone could give me some guidance into how to either make my macro update the bar directly or get my macro to interface with the lib token properly I would greatly appreciate it.
Thanks