User Tools

Site Tools


npc_behavior

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
npc_behavior [2022/12/16 13:29] justinnpc_behavior [2023/05/06 21:11] justin
Line 37: Line 37:
 |"next_to_player_battle"|[[Battle]] name when "next_to_player" is "start_battle"|[[String]]| |"next_to_player_battle"|[[Battle]] name when "next_to_player" is "start_battle"|[[String]]|
 |"next_to_player_script"|[[Script]] name when "next_to_player" is "run_script"|[[String]]| |"next_to_player_script"|[[Script]] name when "next_to_player" is "run_script"|[[String]]|
 +|"collide_with_player"|"run_script"|[[String]]|
 +|"collide_with_player_script"|[[Script]] name when "collide_with_player" is "run_script"|[[String]]|
 |"on_death"|"run_script"|[[String]]| |"on_death"|"run_script"|[[String]]|
 |"on_death_script"|[[Script]] name when "on_death" is "run_script"|[[String]]| |"on_death_script"|[[Script]] name when "on_death" is "run_script"|[[String]]|
 |"can_trigger_scripts"|true, false|[[Boolean]]| |"can_trigger_scripts"|true, false|[[Boolean]]|
 |"attackable_in_realtime"|true, false|[[Boolean]]| |"attackable_in_realtime"|true, false|[[Boolean]]|
 +|"hostility"|Hostility when "attackable_in_realtime" is true. Value can be "always", "attacked", or "never".|[[String]]|
 |"loot_drop"|Loot drop name when "attackable_in_realtime" is true|[[String]]| |"loot_drop"|Loot drop name when "attackable_in_realtime" is true|[[String]]|
 |"xp_value"|Experience points when "attackable_in_realtime" is true|[[Number]]| |"xp_value"|Experience points when "attackable_in_realtime" is true|[[Number]]|
Line 53: Line 56:
 |"player_interest_range"|Interest range in [[tile|tiles]] when "player_interest" is "seek_player" or "avoid_player"|[[Number]]| |"player_interest_range"|Interest range in [[tile|tiles]] when "player_interest" is "seek_player" or "avoid_player"|[[Number]]|
  
-**Example:**+**Examples:**
 <code bauxite> <code bauxite>
 entity["some_npc"].behavior["move_interval"] = 1; entity["some_npc"].behavior["move_interval"] = 1;
 </code> </code>
 +Changes the movement interval so the character moves every 1 second.
 +<code bauxite>
 +entity["some_npc"].behavior["attackable_in_realtime"] = true;
 +</code>
 +Changes the character to be attackable in real-time.
 +<code bauxite>
 +entity["some_npc"].behavior = "Other Behavior";
 +</code>
 +Changes the character's behavior to the "Other Behavior" preset.
  
 ~~NOTOC~~ ~~NOTOC~~
npc_behavior.txt · Last modified: 2023/05/06 21:14 by justin