Denizen/0.7/Task Scripts: Difference between revisions

From Citizens Wiki

< Denizen‎ | 0.7

No edit summary
Line 1: Line 1:
== Task Scripts in detail ==
== Task Scripts in detail ==
<div style="margin-right:2.0em; padding:10px; font-family:museo-sans; font-size:110%;">
<div style="margin-right:2.0em; padding:10px; font-family:museo-sans; font-size:110%;">
Task scripts are just a simple list of [[Script Commands]]. They are called by either the RUNTASK command or the TASK activity. nodes.  
Task scripts are just a simple list of [[Denizen/Interact_Scripts/Commands Script Commands]]. They are called by either the RUNTASK command or the TASK activity. nodes.  
</div>
</div>



Revision as of 20:37, 10 October 2012

Task Scripts in detail

Task scripts are just a simple list of Denizen/Interact_Scripts/Commands Script Commands. They are called by either the RUNTASK command or the TASK activity. nodes.

General layout of a Task Script

'Name of script':  
  Type: Task    
  Script:        
  - COMMAND1
  - COMMAND2
  - etc...

Using a Task Script with RUNTASK

Imagine a scenario where you'd like to check a single outcome from multiple sources. Say, for instance, you have multiple 'quests' that all have the same outcome. You could check the completion for each quest, or, you could have all the quests call a Task Script and check against that.

This is a very basic example for something that can in theory be very complex. Imagination, hoooo!

'Apple Reward': 
  Type: Task    
  Script:       
  - NARRATE "You've received some APPLES. Nice!"
  - GIVE APPLE QTY:10
  - FINISH

'Apple Quest 1':
  Type: Interact
  Requirements:
    Mode: All
    List:
    - -FINISHED Apple Reward
  Steps:
    '1':
      Click Trigger:
        Script:
        - CHAT "Welcome to my house, have some apples!"
        - RUNTASK Apple Reward
  
'Apple Quest 2':
  Type: Interact
  Requirements:
    Mode: All
    List:
    - -FINISHED Apple Reward
  Steps:
    '1':
      Click Trigger:
        Script:
        - CHAT "Welcome to my orchard, have some apples!"
        - RUNTASK Apple Reward