Register

Combat Controller

An Add-on Module for Foundry Virtual Tabletop

Author: Match246 Project: Source Foundry Version 14 (Verified 14) Last Updated 3 hours, 35 minutes ago

Combat Controller

Play DnD with a gamepad!
It utilizes Argon - Combat HUD and supports almost everything that comes with it: targets, the areas of spells, charakter sheet, the token menu and some more.

To the full intended Experience, use the Optionals too:

   
Foundry VTT 14
Argon - Combat HUD with the module for dnd 5e required
physical-dice-rolls optional, its window is answered with the gamepad
RSReforged optional, rolls right when something is used
Tidy 5E Sheets optional, for the intended charakter sheet experience

Setup

Activate the module and connect a gamepad, press any of its buttons so the browser sees it.
That is all for a standard gamepad. When several gamepads are connected, the one you used last is yours.

If the sticks and buttons of your gamepad are numbered differently: module settings, "Configure gamepad".
Click detect next to a line and use the stick or button.

Buttons

What a button does depends on what is on the screen, the first line that applies wins.

On the screen D-pad left stick A B X Y LB RB RT / LT Back Start
A dialog field / value field / value press, confirm close           let go of it  
The token menu focus   press, open palette leave palette, then menu close            
The character sheet left / right: change tab. Up / down: change selected entry left / right: change tab. Up / down: change selected entry expand or collapse the entry, use activity  collapse the entry, then close the sheet (un)prepare spell,(un) equip item toggle currency / entries   hold + up / down: change quantity, coins by 10      
An area is placed move the area move the area place cancel     turn left turn right      
Argon asks for targets ring to next token ring to next token target / release cancel enough targets   zoom out zoom in      
A movement is planned during combat move the destination   walk there drop it              
 The hud is controlled d-pad: focus   use close drawer or panel, then hide the hud token menu next own token next weapon set hold + d-pad left / right: jump. Hold + d-pad down / up: undo / redo step. Hold + left stick: precise movement hold + A: advantage / disadvantage hide hud roll initiative / end turn
Nothing of that stick: walk. D-pad up: character sheet       token menu next own token zoom out zoom in. Hold + down / up: undo / redo step RT: door. LT: flip token open hud roll initiative / end turn

At Most times:

  • the right stick pans the map, a press on the right stick centers the map on your token.
  • a press on the left stick opens and closes the drawer of the hud with the saves and skills (line 6 and 7).

Settings

All stored in the browser.

  • Configure gamepad: which stick and button is used for what.
  • Button hints: the bar that shows what the buttons do.
  • Rumble on your turn: the gamepad rumbles when the turn of your token starts.
  • Combat hud on your turn: opens the hud when the turn starts and leaves it when the turn ends. Off by default.
  • Token speed: how fast your token walks, in grid spaces per second.

Limitations

  • Text can not be typed with the gamepad.
  • Argon and the systems have no api for a gamepad. This module walks the components of the hud and uses the listeners they registered for the mouse, so an update of Argon, the system or Foundry can break a part of it. The parts are independent: when one breaks the others keep working.
  • The browser has to see the gamepad. Some gamepads register as something else, and a gamepad that another application uses may not show up.

Development

pnpm install
pnpm typecheck && pnpm test
pnpm build        # into dist/
pnpm devbuild     # into the modules folder of foundry named as devDir in package.json
 

Credits

Based on Beaver's Gamepad by angryBeaver, which is made for several players with several gamepads around one screen. Reading the gamepad, walking the token, detecting bindings and opening doors come from there. MIT License.

Supported Game Systems

  1. Dungeons & Dragons Fifth Edition

    Latest Version: Version 6.0.6 Last Updated 1 week ago

Categories

Available Versions

  1. Version 1.2.1

    3 hours, 35 minutes ago
    Foundry Version 14 - 14 (Verified 14) Manifest URL Read Notes