NetIntent

Family: Multiplayer · 3 forms

What it does

Sends an action request (move, cast or end turn) to the tactical server, which decides the result.

  • 1No target, for example "endTurn".
  • 2With a target cell, for example "move".
  • 3With a target cell and a spell, for "cast".

Syntax

1
NetIntent(intentType string) → integer
2
NetIntent(intentType string, cellX integer, cellY integer) → integer
3
NetIntent(intentType string, cellX integer, cellY integer, spellID string) → integer

Parameters

NameTypeIn formsMeaning
intentTypestringall"move", "cast" or "endTurn". Other values are refused.
cellXinteger2, 3The target cell's column on the grid. Decimals are dropped.
cellYinteger2, 3The target cell's row on the grid. Decimals are dropped.
spellIDstring3The id of the spell to cast.

Every form returns

integer

1 if the request was sent, 0 if the type is empty or unknown, or when not connected or reconnecting.

Good to know

  • The server answers with an "intentAccepted" or "intentRejected" event, read through NetPollEvent().
  • Join the tactical room first with NetJoinRoom().
  • Only available in the aukimi editor: exported games do not provide this command.

Example · generated

Form 1, the short one

DO  Print(NetIntent("value"))  Sync()LOOP

Form 3, with every argument

DO  Print(NetIntent("value", 1, 1, "value"))  Sync()LOOP

NetIntent is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

93 commands in Multiplayer