NPC Scripting: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
NPCs are scripted where the main elements are perceptions that represents events in the soundings of the NPC. The NPC has a set of reactions that decide if the NPC will react to a perception. The reaction that start a behavior that is a set of operations the NPC will perform. Some NPCs work together in tribes, see [[Tribe Scripting]] for details. | NPCs are scripted where the main elements are perceptions that represents events in the soundings of the NPC. The NPC has a set of reactions that decide if the NPC will react to a perception. The reaction that start a behavior that is a set of operations the NPC will perform. Some NPCs work together in tribes, see [[Tribe Scripting]] for details. | ||
<uml> | {| border="1" | ||
!Example 1: | |||
!Example 2: | |||
|- | |||
|<uml> | |||
->NPC: Perception(Damage) | ->NPC: Perception(Damage) | ||
activate NPC | activate NPC | ||
Line 12: | Line 16: | ||
deactivate Behavior_Fight | deactivate Behavior_Fight | ||
</uml> | </uml> | ||
| <uml> | |||
->NPC: Perception(Time 10:00 PM) | |||
activate NPC | |||
NPC -> NPC: Should I React(Yes) | |||
NPC -> Behavior_GoSleep : Activate (Behavior Sleep) | |||
activate Behavior_GoSleep | |||
deactivate NPC | |||
Behavior_GoSleep->Behavior_GoSleep:Locate Home | |||
Behavior_GoSleep->Behavior_GoSleep:Move To Home | |||
</uml> | |||
|} | |||
== Table of Contents == | == Table of Contents == | ||
Line 27: | Line 40: | ||
[[Behaviors and Reactions]] | [[Behaviors and Reactions]] | ||
[[NPC Variables]] | |||
[[NPC Behavior Data Structures]] | [[NPC Behavior Data Structures]] |
Latest revision as of 12:43, 11 April 2020
NPCs are scripted where the main elements are perceptions that represents events in the soundings of the NPC. The NPC has a set of reactions that decide if the NPC will react to a perception. The reaction that start a behavior that is a set of operations the NPC will perform. Some NPCs work together in tribes, see Tribe Scripting for details.
Example 1: | Example 2: |
---|---|
![]() |
![]() |