Skip to content

PointMarker ​

Inherits: Node3D

PointMarker manages visual markers and selection mechanics in the game world. It handles mouse pointer functionality, group selection, and visual feedback for various game elements.

Description ​

Key features:

  • Displays and manages visual markers at specified locations
  • Handles mouse tracking and interaction with the game world
  • Manages group selection of entities (e.g., players)
  • Provides visual feedback through decals and outlines
  • Supports different marker types, colors, and textures

Variables ​

Camera3Dcamera
boolmouse_marker
Entitycaster
floatoffset0.0
Array[Entity]players_within_group_selection
Entitycurrent_hovered_entitynull
Array[Entity]entities_in_target_area[]
booltarget_modefalse
intdefault_collision_mask
boolshow_attack_ribbonfalse
Area3Dtarget_select
CollisionShape3Dtarget_select_collision_shape
Decaltarget_select_area_decal
Area3Dgroup_selection_box
CollisionShape3Dgroup_selection_box_collision_shape
MeshInstance3Dattack_ribbon
StandardMaterial3Dattack_ribbon_material
PartyManagerparty_manager

Methods ​

voidsetup_mouse_area( area: Area3D )
voidconnect_signals()
voidtarget_mode_trigger_off()
voidnew_marker( location: TargetStrategyDefinition.AbilityMarkerLocation, is_marker_friendly: bool, texture_path: String, x: float, z: float, m: float, user: Variant, new_offset: float )
voidmarker_default()
voidset_location( location: TargetStrategyDefinition.AbilityMarkerLocation, user: Variant )
voidset_colour( is_marker_friendly: bool )
voidset_texture( texture_path: String )
voidset_target_select_area_decal_size( x: float, z: float )
voidset_area_size( m: float )
voidset_offset( new_offset: float )
voidshow_hide( value: bool )

Constants ​

  • float ATTACK_RIBBON_WIDTH = 0.5 - Attack ribbon constants - loaded from GameplayConfig
  • int ATTACK_RIBBON_SEGMENTS = 20 - How many segments the attack ribbon has.
  • float ATTACK_RIBBON_HEIGHT_OFFSET = 1.5 - How high above the ground the attack ribbon is.
  • float ATTACK_RIBBON_ARC_HEIGHT = 2.0 - How high the middle of the arc should be
  • int TERRAIN_MASK = 1 << 5 - Terrain layer mask (layer 6 in Godot is 1<<5)

Variable descriptions ​

Camera3D camera ​

Reference to the main camera

bool mouse_marker ​

Flag to determine if the marker follows the mouse

Entity caster ​

The entity casting or associated with this marker

float offset = 0.0 ​

Offset distance for positioning the marker

Array[Entity] players_within_group_selection ​

Array of players within the group selection area

Entity current_hovered_entity = null ​

Currently hovered entity under target selection

Array[Entity] entities_in_target_area = [] ​

List of entities within the target selection area

bool target_mode = false ​

Flag indicating if the marker is in target mode

int default_collision_mask ​

Stores the default collision mask to restore when exiting target mode

bool show_attack_ribbon = false ​

Flag to determine if the attack ribbon should be visible

Area3D target_select ​

Reference to the target selection area

CollisionShape3D target_select_collision_shape ​

Collision shape for the target selection area

Decal target_select_area_decal ​

Visual decal for the target selection area

Area3D group_selection_box ​

Reference to the group selection box for multi-unit selection

CollisionShape3D group_selection_box_collision_shape ​

Collision shape for the group selection box

MeshInstance3D attack_ribbon ​

Attack ribbon mesh instance and material

StandardMaterial3D attack_ribbon_material ​

The material of the ribbon that shows an attack.

PartyManager party_manager ​

System Ref

Method descriptions ​

void setup_mouse_area( area: Area3D ) ​

Sets up the area that follows the mouse.

void connect_signals() ​

Connects all area signals for target selection and group selection

void target_mode_trigger_off() ​

Handles disabling target mode and restoring default collision mask

void new_marker( location: TargetStrategyDefinition.AbilityMarkerLocation, is_marker_friendly: bool, texture_path: String, x: float, z: float, m: float, user: Variant, new_offset: float ) ​

Sets up a new marker with specified properties

void marker_default() ​

Resets the marker to default settings

void set_location( location: TargetStrategyDefinition.AbilityMarkerLocation, user: Variant ) ​

Sets the location type (mouse or entity) for the marker

void set_colour( is_marker_friendly: bool ) ​

Sets the color of the marker based on is_marker_friendly friendly = green, hostile = red

void set_texture( texture_path: String ) ​

Sets the texture of the marker based on the texture resource path

void set_target_select_area_decal_size( x: float, z: float ) ​

Sets the size of the target_select_area_decal

void set_area_size( m: float ) ​

Sets the size of the interaction area

void set_offset( new_offset: float ) ​

Sets the offset distance for the marker positioning

void show_hide( value: bool ) ​

Toggles the visibility of the marker and resets caster if hiding