Odd halo issue

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Odd halo issue

Post by xavram »

So I have a macro that looks like...

Code: Select all

[h, token(getInitiativeToken()), code: {
[h : currentInit = getInitiative()]
[h: setHalo("None", getInitiativeToken())]
}]

[MACRO("DoneWithTurn@Lib:PC_CombatMacros"):currentInit]
Within that "DoneWithTurn" macro, based on certain conditions, the current token might get "setHalo("Yellow", getInitiativeToken())" called on it. Basically, if its your turn, a yellow halo appears around the token, so we know its your turn.

But, what I'm seeing is when the macro is called, the yellow halo appears around the token's whose turn it is, then it immediately turns off. Its almost as if "DoneWithTurn" is being called BEFORE the setHalo("None") call. But as you can see from the code snippet above, its not.

I've triple checked the DoneWithTurn macro and it doesn't call any other macros in it. And the only call for halos in that one is the one to turn the current token yellow. So I don't understand why the halo is turning yellow, then turning itself off. Any suggestions?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Odd halo issue

Post by aliasmask »

Sometimes when setting certain graphical indicators like states and halos certain things can interfere with it. For example, if you change the layer or z-order of token. Any of that stuff going on? If so, you need to do those things last.

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: Odd halo issue

Post by xavram »

ah ha, I think I do some "send to back/bring to front" calls in there!

So is it the halo/state stuff that has to be last? Or the bring to front/send to back last?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Odd halo issue

Post by aliasmask »

xavram wrote:ah ha, I think I do some "send to back/bring to front" calls in there!

So is it the halo/state stuff that has to be last? Or the bring to front/send to back last?
send to back needs to go last.

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: Odd halo issue

Post by xavram »

Thanks, I will try tweaking the code to make this work this evening!

Post Reply

Return to “Macros”