NPC Scripting: Difference between revisions

From PSwiki
Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by 4 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.
{| border="1"
!Example 1:
!Example 2:
|-
|<uml>
->NPC: Perception(Damage)
activate NPC
NPC -> NPC: Should I React(Yes)
NPC -> Behavior_Fight : Activate (Behavior Fight)
activate Behavior_Fight
deactivate NPC
Behavior_Fight->Behavior_Fight :Locate target
Behavior_Fight->Behavior_Fight :Attack Back
deactivate Behavior_Fight
</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 11: Line 40:


[[Behaviors and Reactions]]
[[Behaviors and Reactions]]
[[NPC Variables]]


[[NPC Behavior Data Structures]]
[[NPC Behavior Data Structures]]
[[Category:Engine documents]] [[Category:NPCClient Design]] [[Category:NPCClient Scripting]]

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:

Table of Contents

SuperClient Overview

Network Protocol Concepts

NPC Types

Behavior Operations

Behaviors and Reactions

NPC Variables

NPC Behavior Data Structures