Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.00

Description

Description:

Defines the action performed, when the user clicks on the map, by executing the specified command code.

The code is executed on every click, until the defined action is removed using: onMapSingleClick ""

Syntax

Syntax:onMapSingleClick command
Parameters:
  • command: Code or String - Code to execute on map click.
    The command can use the following parameters:

    • _pos: Position3D - Clicked position. Some maps may return negative values for Z, so make sure to adjust. if a 3D position is needed.
    • _units: Array - Units which were selected (using function keys) before opening the map.
    • _shift: Boolean - Whether Shift was pressed, when clicking on the map.
    • _alt: Boolean - Whether Alt was pressed, when clicking on the map.
Return Value:Nothing

Examples

Examples:
Creates a soldier unit at the clicked position:
onMapSingleClick "'SoldierWB' createUnit [_pos, group player]'"
Orders Grp1 to move to the clicked position:
onMapSingleClick "Grp1 doMove _pos"

Additional Information

See also: onDoubleClick
Multiplayer: 
Problems: 

Notes