-
Notifications
You must be signed in to change notification settings - Fork 13
Extending Lancer Initiative
Joe edited this page Jan 4, 2021
·
3 revisions
Lancer Initiative provides a hook for when a non-gm player clicks an activate button. The hooked callbeck is passed two parameters. The first is the LancerCombat instance. The second parameter is the id of the Combatant that was clicked on. The hook only runs on the client that clicked on the tracker, so using game.socket to signal the GM clients may be necessary.
Hooks.on("LancerCombatRequestActivate", (combat, combatantId) => {
// code
});
A reference implementation is provided at https://github.com/BoltsJ/li-player-request. The implementation checks if the player clicked on their own combatant and if they have activations left. If so, a message is sent on game.socket. When a GM's client receives the message, it displays a dialog allowing the GM to activate the unit.