Skip to content

AreaRandomizeTargetEffect ​

Inherits: MinimumApplicationAreaEffect < AreaEffect < CollisionEffect < CompositeEffect < Effect < DatabaseResource < Resource

AreaRandomizeTargetEffect with pure raycast collision detection Supports entity targeting, position targeting, and temporal distribution

Properties ​

intmaximum_targets1
boolallow_duplicate_targetsfalse
boolignore_original_targetfalse
TargetTypetarget_typeTargetType.ENTITIES
boolselect_targets_over_timefalse
DistributionModedistribution_modeDistributionMode.EQUALLY_SPACED
floatminimum_interval0.5
floatposition_spread_radius1.0
boolavoid_obstaclestrue
intmax_position_attempts10
boolfollow_terraintrue
floatterrain_offset0.1
floatmax_slope_angle45.0
floatraycast_height100.0

Methods ​

voidprocess_before_start( effect_instance: EffectInstance )
voidspecific_effect_logic( effect_instance: EffectInstance )
voidon_apply_finished( effect_instance: EffectInstance )
Stringget_effect_description()
Stringget_editor_description()

Enumerations ​

enum TargetType ​

The options of target type: entities, positions, entity positions.

  • ENTITIES = 0
  • POSITIONS = 1
  • ENTITY_POSITIONS = 2

enum DistributionMode ​

The options of distribution mode: equally spaced, random intervals.

  • EQUALLY_SPACED = 0
  • RANDOM_INTERVALS = 1

Property descriptions ​

Target Selection

int maximum_targets = 1 ​

Maximum number of targets to select

bool allow_duplicate_targets = false ​

Allow same target multiple times

bool ignore_original_target = false ​

Exclude the original effect target

TargetType target_type = TargetType.ENTITIES ​

What to target

Temporal Distribution

bool select_targets_over_time = false ​

Spread target selection over effect duration

DistributionMode distribution_mode = DistributionMode.EQUALLY_SPACED ​

How to distribute over time

float minimum_interval = 0.5 ​

Minimum time between selections (for random mode)

Position Settings

float position_spread_radius = 1.0 ​

Random spread around selected positions

bool avoid_obstacles = true ​

Try to avoid obstacle positions

int max_position_attempts = 10 ​

Max attempts to find valid position

Terrain Following

bool follow_terrain = true ​

Adjust Y position to ground level

float terrain_offset = 0.1 ​

Height offset above terrain

float max_slope_angle = 45.0 ​

Skip surfaces steeper than this (degrees)

float raycast_height = 100.0 ​

How high above to start raycasting

Method descriptions ​

void process_before_start( effect_instance: EffectInstance ) ​

Override to calculate required duration before EffectInstance creates timers

void specific_effect_logic( effect_instance: EffectInstance ) ​

What the effect does to its target when it is applied.

void on_apply_finished( effect_instance: EffectInstance ) ​

Called when the effect ends: takes back what it did.

String get_effect_description() ​

The text of the effect for tooltips, with its values filled in.

String get_editor_description() ​

A short text for the effect editor that says what the effect does.