NPC Variables: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Magodra (talk | contribs)
Magodra (talk | contribs)
Line 2: Line 2:




== Substituted Keyword ==


The following keywords are replaced in strings used in the NPC Client Scripting.  
NPC Variables allow for scripting where keywords are replaced in strings.


This allows for generic scripting like:
This allows for generic scripting like:
Line 10: Line 9:
  <wait duration="$NBUFFER[Wait_Duration]" anim="stand" />
  <wait duration="$NBUFFER[Wait_Duration]" anim="stand" />


Before keywords is replaced the NPC and Tribe buffers will be replaced. This allows keywords in the buffers.
First buffers will be replaced than keywords will be replaced.
 
== Bufferes that wil be replaced ==
 
Bufferes will be replaced first. This allows keywords in the buffers.
{|
{|
!Keyword
!Keyword
Line 23: Line 26:
|}
|}


Keywords that will be replaced.
== Keywords that will be replaced ==
 
The following keywords are replaced in strings used in the NPC Client Scripting.  


{|
{|
Line 48: Line 53:
|-
|-
|}
|}
== Boolean types ==
Some script require boolean as output. They will be deamed true if the string resolve to either "true" or "yes".
Example:
<set_buffer buffer="Region" value="true" />
<melee outside_region="$NBUFFER[Region]" />


[[Category:NPCClient Design]]
[[Category:NPCClient Design]]

Revision as of 21:25, 21 January 2013

For both Behavior Operations and Tribe Scripting some of the fields are parsed for keywords and values replaced before use.


NPC Variables allow for scripting where keywords are replaced in strings.

This allows for generic scripting like:

<talk text="My name is $name" />
<wait duration="$NBUFFER[Wait_Duration]" anim="stand" />

First buffers will be replaced than keywords will be replaced.

Bufferes that wil be replaced

Bufferes will be replaced first. This allows keywords in the buffers.

Keyword Description
$NBUFFER[x] Replace with the value from the NPC buffers that is set by the Tribe Scripting SetBuffer algorithm
$TBUFFER[x] Replace with the value from the Tribe buffers that is set by the Tribe Scripting SetBuffer algorithm

Keywords that will be replaced

The following keywords are replaced in strings used in the NPC Client Scripting.

Keyword Description
$name Replaced with the name of the NPC.
$owner If npc is a pet, replaced with the name of the owner
$member_type Replace with the npc tribe member type.
$race Replaced with the race of the NPC.
$target Replaced with the name of the current target.
$tribe If npc is part of a tribe, replaced with the tribes name.

Boolean types

Some script require boolean as output. They will be deamed true if the string resolve to either "true" or "yes".

Example:

<set_buffer buffer="Region" value="true" />
<melee outside_region="$NBUFFER[Region]" />