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 ​
Camera3D | camera | |
bool | mouse_marker | |
Entity | caster | |
float | offset | 0.0 |
Array[Entity] | players_within_group_selection | |
Entity | current_hovered_entity | null |
Array[Entity] | entities_in_target_area | [] |
bool | target_mode | false |
int | default_collision_mask | |
bool | show_attack_ribbon | false |
Area3D | target_select | |
CollisionShape3D | target_select_collision_shape | |
Decal | target_select_area_decal | |
Area3D | group_selection_box | |
CollisionShape3D | group_selection_box_collision_shape | |
MeshInstance3D | attack_ribbon | |
StandardMaterial3D | attack_ribbon_material | |
PartyManager | party_manager |
Methods ​
void | setup_mouse_area( area: Area3D ) |
void | connect_signals() |
void | target_mode_trigger_off() |
void | new_marker( location: TargetStrategyDefinition.AbilityMarkerLocation, is_marker_friendly: bool, texture_path: String, x: float, z: float, m: float, user: Variant, new_offset: float ) |
void | marker_default() |
void | set_location( location: TargetStrategyDefinition.AbilityMarkerLocation, user: Variant ) |
void | set_colour( is_marker_friendly: bool ) |
void | set_texture( texture_path: String ) |
void | set_target_select_area_decal_size( x: float, z: float ) |
void | set_area_size( m: float ) |
void | set_offset( new_offset: float ) |
void | show_hide( value: bool ) |
Constants ​
floatATTACK_RIBBON_WIDTH =0.5- Attack ribbon constants - loaded from GameplayConfigintATTACK_RIBBON_SEGMENTS =20- How many segments the attack ribbon has.floatATTACK_RIBBON_HEIGHT_OFFSET =1.5- How high above the ground the attack ribbon is.floatATTACK_RIBBON_ARC_HEIGHT =2.0- How high the middle of the arc should beintTERRAIN_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