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
Last revisionBoth sides next revision
npc_behavior [2022/12/14 17:37] justinnpc_behavior [2023/05/06 21:13] justin
Line 10: Line 10:
 ^Icon^Setting^Description^ ^Icon^Setting^Description^
 |{{:wiki:properties.png?nolink|}}|Preset|Unique name for the set of behavior rules. To store the current settings to a named preset, click the "Save" button to the right of the dropdown box. The "No Behavior" option indicates that this [[NPC]] will be immobile and cannot be interacted with in any way.| |{{:wiki:properties.png?nolink|}}|Preset|Unique name for the set of behavior rules. To store the current settings to a named preset, click the "Save" button to the right of the dropdown box. The "No Behavior" option indicates that this [[NPC]] will be immobile and cannot be interacted with in any way.|
-|{{:wiki:interact.png?nolink|}}|When Player Interacts|Determines what will happen when the [[player character]] interacts with this [[NPC]]. If the "Start Dialogue" or "Start Battle" option is selected, an additional dropdown will allow you to choose which [[dialogue]] or [[battle]] to start.|+|{{:interact.png?nolink|}}|When Player Interacts|Determines what will happen when the [[player character]] interacts with this [[NPC]]. If the "Start Dialogue" or "Start Battle" option is selected, an additional dropdown will allow you to choose which [[dialogue]] or [[battle]] to start.|
 |{{:wiki:navigation_adjacent.png?nolink|}}|When Next to Player|Determines what will happen when this [[NPC]] is on a [[tile]] adjacent to the [[player character]]. If the "Start Dialogue" or "Start Battle" option is selected, an additional dropdown will allow you to choose which [[dialogue]] or [[battle]] to start.| |{{:wiki:navigation_adjacent.png?nolink|}}|When Next to Player|Determines what will happen when this [[NPC]] is on a [[tile]] adjacent to the [[player character]]. If the "Start Dialogue" or "Start Battle" option is selected, an additional dropdown will allow you to choose which [[dialogue]] or [[battle]] to start.|
 |{{:wiki:skull.png?nolink|}}|On Death|Determines what will happen when this [[NPC]] is defeated. If the "Run Script" option is selected, an additional dropdown will allow you to choose which [[script]] to run.| |{{:wiki:skull.png?nolink|}}|On Death|Determines what will happen when this [[NPC]] is defeated. If the "Run Script" option is selected, an additional dropdown will allow you to choose which [[script]] to run.|
Line 29: Line 29:
 Refer to the table below for a list of behavior settings that can be accessed from a [[script]]. The behavior data is stored as a [[codex]], and each setting can be modified or retrieved using its corresponding key. Refer to the table below for a list of behavior settings that can be accessed from a [[script]]. The behavior data is stored as a [[codex]], and each setting can be modified or retrieved using its corresponding key.
 ^Key^Possible Values^Data Type^ ^Key^Possible Values^Data Type^
-|"interaction_by_player"|"start_dialogue", "start_battle", "run_script"|[[String]]|+|"interaction_by_player"|"none", "start_dialogue", "start_battle", "run_script"|[[String]]|
 |"interaction_by_player_dialogue"|[[Dialogue]] name when "interaction_by_player" is "start_dialogue"|[[String]]| |"interaction_by_player_dialogue"|[[Dialogue]] name when "interaction_by_player" is "start_dialogue"|[[String]]|
 |"interaction_by_player_battle"|[[Battle]] name when "interaction_by_player" is "start_battle"|[[String]]| |"interaction_by_player_battle"|[[Battle]] name when "interaction_by_player" is "start_battle"|[[String]]|
 |"interaction_by_player_script"|[[Script]] name when "interaction_by_player" is "run_script"|[[String]]| |"interaction_by_player_script"|[[Script]] name when "interaction_by_player" is "run_script"|[[String]]|
-|"next_to_player"|"start_dialogue", "start_battle", "run_script"|[[String]]|+|"next_to_player"|"none", "start_dialogue", "start_battle", "run_script"|[[String]]|
 |"next_to_player_dialogue"|[[Dialogue]] name when "next_to_player" is "start_dialogue"|[[String]]| |"next_to_player_dialogue"|[[Dialogue]] name when "next_to_player" is "start_dialogue"|[[String]]|
 |"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]]|
-|"on_death"|"run_script"|[[String]]|+|"collide_with_player"|"none", "run_script"|[[String]]| 
 +|"collide_with_player_script"|[[Script]] name when "collide_with_player" is "run_script"|[[String]]| 
 +|"on_death"|"none", "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 52: Line 55:
 |"player_interest"|"none", "seek_player", "avoid_player"|[[String]]| |"player_interest"|"none", "seek_player", "avoid_player"|[[String]]|
 |"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]]|
 +
 +**Examples:**
 +<code bauxite>
 +entity["some_npc"].behavior["move_interval"] = 1;
 +</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