Skip to content

TacticsControls

Lets players command their TacticsUnits with the mouse, or with a cursor moved by the arrow keys or the stick: click one of your units whose team’s turn it is to pick it, and the cells it can walk to light up in MoveColor, with the cells it can hit from them in AttackColor; hover a cell to see the way it would go. Click a lit cell to walk there, then an enemy in reach to attack it (or click an enemy straight away to walk up and hit it), or the unit itself to wait. Right-click (or Cancel) puts it back or lets it go. Hovering any unit shows how far it reaches. Units that have had their go are dimmed. On the computer’s turn, each of its units’ reach lights up for ComputerPause before it moves.

Part of the Tactics module: Turn-based tactics: units on a grid, picked and sent to a cell in reach or set on a foe, side by side in turns (TacticsUnit, TacticsControls), the computer playing a team, the Tactics template, and Create Tactics Unit in the Entity menu.

One per scene (the first with focus is used); it draws nothing itself. In a network game each player picks on their own screen.

Works with: TacticsUnit (the units it commands); TurnOrder (whose turn it is)

Takes the player’s input only while it has focus (its Controllable): its Focus action hands it the input and takes it from everything else the same player plays.

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • confirmAction: text = “Jump”. The input action that picks or goes to the cell under the cursor, as a left click does: “Jump” is Space or the gamepad’s A. (Names an input action.) (Field: a name.)
  • cancelAction: text = “Dash”. The input action that puts a unit back or lets it go, as a right click does: “Dash” is Shift or the gamepad’s B. (Names an input action.) (Field: a name.)
  • controllable: true or false = true. Untick it to have the controls ignore the mouse, keys and gamepad (the computer’s turns still play): another part of the scene has the player’s input. Its Focus action ticks it and unticks it on everything else the player plays, and another’s Focus takes it back. (Field: on or off.)
  • showOnHover: true or false = true. Hovering a unit nobody has picked shows how far it can walk and hit, fainter. (Field: on or off.)
  • healthBars: true or false = true. Draws a health bar under each unit with Health. (Field: on or off.)
  • moveColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#4C8DF070”. The cells a picked unit can walk to. (Field: a color.)
  • attackColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#E84A4A70”. The cells it can hit from them, and what it can attack. (Field: a color.)
  • pathColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#F4F4F4FF”. The way it would walk to the hovered cell. (Field: a color.)
  • cursorColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#FFE06AE0”. The outline round the cell under the cursor. (Field: a color.)
  • doneTint: a color, “#RRGGBB” or “#RRGGBBAA” = “#808080FF”. Multiplies the color of units that have had their go. (Field: a color.)
  • computerPause: a number = 0.5. Seconds the computer takes over each of its units’ goes before it moves, while the unit’s reach lights up, so you can follow what it does. (Field: a number.)
  • selectSound: text = null. A sound played on picking a unit, e.g. “Sounds/select.wav”. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • cancelSound: text = null. A sound played on letting a unit go or putting it back. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)

What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).

  • Focus. Gives its entity the player’s input: whatever there and inside it has focus, and everything else the same player plays loses it (a platformer’s player stops on the arrow keys while a board takes them).

Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.

  • selected: an entity: its name, id or path. The unit picked on this screen, or null. Set it from a script to pick one.
  • cursor: [x, y], whole numbers or null. The cell under the cursor (column then row on the units’ map), or null when it’s off the map.

Scripts use it as TacticsControls: its methods, events and values that aren’t saved with the scene.