Page 1 of 1

onNewRound/onNewTurn events?

Posted: Sat Nov 04, 2017 10:36 am
by Mrugnak
Is there some way to hook into when a tokens turn comes up in initiative? Or when a new round is started? (those mean different things in some game systems...)

I've got a macro that I am currently running by clicking by hand at the start of my turn; it checks current number of HP and rolls consciousness or death checks as appropriate, resets penalties from "until next turn" effects, that kind of administrivia.

Unfortunately, my brain is swiss cheese and I keep forgetting to run the macro until part way through my turn. I would like to hook it to an event so I don't have to think about it any more. Is there a way to do this?

Re: onNewRound/onNewTurn events?

Posted: Sat Nov 04, 2017 2:14 pm
by aliasmask
It's something that has been talked about but not implemented, I think. But I do believe the NERPs build does have event handlers when initiative changes.

There is a way to create your own handler by using onChangeSelect. Clicking anywhere on map/tokens will executes this handler. You can then check a variable for the current initiative and execute your code. It can be tricky to do though because you have to ignore duplication of the event.

Re: onNewRound/onNewTurn events?

Posted: Sat Nov 04, 2017 3:50 pm
by JamzTheMan
My fork doesn't have the initiative events either.

The common solution is to not use the "initiative panel" to advance init. Instead, create a macro (assign a function key if you want as well) to advance the initiative. On each advance, check for end of round or end of "initiative for that token".

To avoid dupes in case of delayed actions, on initiative, I add a "timestamp" to that token. If that timestamp is == to the current timestamp I know he as already done his checks, ie poison, bleed, etc.

Re: onNewRound/onNewTurn events?

Posted: Sat Nov 04, 2017 4:58 pm
by Full Bleed
JamzTheMan wrote:The common solution is to not use the "initiative panel" to advance init. Instead, create a macro (assign a function key if you want as well) to advance the initiative. On each advance, check for end of round or end of "initiative for that token".
This is how I do it. I have the following buttons to handle init:

1) Announce Combat (Initializes Combat.)
2) Roll (Rolls enemy inits on the first click, will roll inits of players haven't rolled their own on the second click.)
3) Sort (Sorts inits, deals with beginning of round actions, gives the first token init, fires a "Recieve Init" function.)
4) Next (Advances to the next token in the init panel. Fire the "Receive Init" function. And, at the end of the round fire an "End of Round" function.)
5) End Combat (removes tokens from init and ties up loose ends.)

Disable buttons of actions that can't be done at certain times and you'll be able to move through combat very efficiently without making mistakes.