I'm trying to control turn order.
I use 1 macro to start the game - stored on the Lib:token clicked by the GM.This initializes variables on the Lib:token. It scans for connected players and logs that as a list on the Lib:token. It then fires a macro using the macro roll option to roll for turn order.
The rollForTurnOrder macro - looks at the Lib:token for the current player prop and sends that (The GM is player 0 in the connected players list of course) which pops a dialog up and has them click a submit button that rolls a d6 for turn order by firing the processRoll macro using
The processRoll Macro - rolls a d6 (and a d999999999 for tie breaks) and then checks what player number its on. It then sends a dialog window to the current player until all the players have rolled. It logs the rolls and players and puts them in order from highest to lowest and stores it on the Lib:token as a list of names. It then fires the setTurn Macro using
startCharSelect macro - basically just broadcasts that char selection is starting, and then determins what player won the roll and fires the charSelect macro using:
Code: Select all
[r: broadcast( macroLink("", "[email protected]:DQ", "none", outputPlayer), outputPlayer)]
charSelect macro - is a dialog of checkboxes for each player to select and press a submit button. form action fires the processCharSelect macro.
and finally the processCharSelect macro - checks the current player and start building a list of players and char names and stores it on the lib:token. I then want to fire the next steps and so on.
I have screwed up my code somewhere, and when I get to the last macro. Everything stops. Seems like sometimes it works correctly and sometimes it bombs out and stops.
Sorry for the lengthy post, but I am wondering if maybe I am doing things the hard way again, and loosing focus somewhere or something by broadcasting macrolink and passing the "responsibility" of fireing the next macro in line to a the next player. So sometimes the gm fires the macro that would move to the next step in the macro chain, and sometimes its one of the other players. I assume this could cause issues if each player is esentially updating the Lib:token on thier turn.
Should I or is there a "smarter" or "safer" way to be doing this?
Like should some of this be handled through UDF or something?