Dialog Reference: Difference between revisions
From Citizens Wiki
(→Events) |
|||
Line 15: | Line 15: | ||
* Arguments can be given without explicit keys, and will be parsed in order of required and then optional arguments. | * Arguments can be given without explicit keys, and will be parsed in order of required and then optional arguments. | ||
=====Remember===== | |||
remember [fact=value (10ns|ms|s|m|h|d (expiration time)) (-p (persistent)), fact2=value [...]]; | remember [fact=value (10ns|ms|s|m|h|d (expiration time)) (-p (persistent)), fact2=value [...]]; | ||
=====Forget===== | |||
forget [memory="factname"| ["factname1", "factname2"...]]; | forget [memory="factname"| ["factname1", "factname2"...]]; | ||
=====Say===== | |||
say [message="message"] [target="p:playername"|"n:npcid"|"broadcast"|"log"|fact of type 'Player']; | say [message="message"] [target="p:playername"|"n:npcid"|"broadcast"|"log"|fact of type 'Player']; | ||
=====Code===== | |||
js|py|lua|rb|clj|scala [code="code"] | js|py|lua|rb|clj|scala [code="code"] | ||
Evaluates raw code based on input. Note: JS is built into Java, but all others require additional programs. Eg. rb requires installing JRuby, scala requires installing scala, etc. | Evaluates raw code based on input. Note: JS is built into Java, but all others require additional programs. Eg. rb requires installing JRuby, scala requires installing scala, etc. | ||
=====Denizen Script===== | |||
dtask [name="script name"] [player=query player | "playername"] (denizen==query NPC or Denizen | "denizen ID" | denizen ID as number) | dtask [name="script name"] [player=query player | "playername"] (denizen==query NPC or Denizen | "denizen ID" | denizen ID as number) | ||
dtask [name="script name"] [denizen=query NPC or Denizen | "denizen ID" | denizen ID as number] (player=query player | "playername") | dtask [name="script name"] [denizen=query NPC or Denizen | "denizen ID" | denizen ID as number] (player=query player | "playername") | ||
Requires [[Denizen]] 0.8 to be installed. | Requires [[Denizen]] 0.8 to be installed. |
Revision as of 10:52, 30 January 2013
Events
Standard variables available
- Entity under some root name
- Player under some root name
- NPC under same root name
onchat
message : the message involved in the event sender : the sender
Statements
- [] - required argument
- () - optional argument
- ... - repeated argument
- Arguments can be given without explicit keys, and will be parsed in order of required and then optional arguments.
Remember
remember [fact=value (10ns|ms|s|m|h|d (expiration time)) (-p (persistent)), fact2=value [...]];
Forget
forget [memory="factname"| ["factname1", "factname2"...]];
Say
say [message="message"] [target="p:playername"|"n:npcid"|"broadcast"|"log"|fact of type 'Player'];
Code
js|py|lua|rb|clj|scala [code="code"]
Evaluates raw code based on input. Note: JS is built into Java, but all others require additional programs. Eg. rb requires installing JRuby, scala requires installing scala, etc.
Denizen Script
dtask [name="script name"] [player=query player | "playername"] (denizen==query NPC or Denizen | "denizen ID" | denizen ID as number) dtask [name="script name"] [denizen=query NPC or Denizen | "denizen ID" | denizen ID as number] (player=query player | "playername")
Requires Denizen 0.8 to be installed.