Builder/Builder and Denizen: Difference between revisions

From Citizens Wiki
No edit summary
No edit summary
Line 1: Line 1:
== Continuous Rebuilding ==
If you want a builder to look busy and continuously rebuild and destroy a schematic, you would use a setup like this.


{{color|red|white|This page is for Denizen .7x and is out of date}}
Create a Task script in any file the denizen scripts folder like the following.


<code>
---scriptfile.yml---


==Harry's Home Constructions==
RebuildHouse:
 
Hire a Builder to build your house.
 
Coming soon!
 
{| class="wikitable collapsible collapsed"
! Joe the Builder Script and Assignment
|-
| <pre>
---- assignments.yml ----
 
---- script.yml ----
 
</pre>
|}
 
==Janitor Jerry==
 
Jerry fixes up a building, replacing missing blocks or removing extra ones.
 
This example uses the Activity engine to have a Denizen named Jerry try to rebuild a schematic every 5 minutes. For this to work the schematic should be saved from your world so the schematic origin is in the right place. You could also set Jerry's build origin where you want and remove the call to 'builder origin' in the script. Just be sure no one moves Jerry's origin.
 
When you start your server, Jerry won't do anything until noon rolls around, then he will attempt to rebuild the myBuilding schematic every 5 minutes. Change the delay as you see fit with the DELAY: command. Or use REPEATS:0 to have him only rebuild once at noon.
 
{| class="wikitable collapsible collapsed"
! Jerry the Janitor Scripts and Assignment
|-
| <pre>
---- assignments.yml ----
Denizens:                       
  Jerry:
    Scheduled Activities:
    - 12:00 RebuildActivity
 
---- script.yml ----
 
RebuildActivity:
  Type: Activity
  Requirements:
    Mode: None
  Activities:
    List:
    - 1 TASK SCRIPT:RebuildTask DELAY:300
 
RebuildTask:
   Type: Task
   Type: Task
   Script:
   Script:
     - EXECUTE ASSERVER "builder <NPCID> load myBuilding"
     - execute as_server "builder <npc.id> build excavate oncomplete:RebuildHouse"
    - EXECUTE ASSERVER "builder <NPCID> origin schematic"
<code>
    - EXECUTE ASSERVER "builder <NPCID> build"
 
</pre>
Now create your builder, load the desired schematic, set an origin, and call ''/builder build oncomplete:RebuildHouse''
|}


[[Category:Denizen 0.7]]
The builder will then build the schematic, and then run the task, which will build it again with the ''excavate'' option that will tear it down first, and the cycle will continue.

Revision as of 01:13, 9 August 2013

Continuous Rebuilding

If you want a builder to look busy and continuously rebuild and destroy a schematic, you would use a setup like this.

Create a Task script in any file the denizen scripts folder like the following.

---scriptfile.yml---

RebuildHouse:

 Type: Task
 Script:
   - execute as_server "builder <npc.id> build excavate oncomplete:RebuildHouse"

Now create your builder, load the desired schematic, set an origin, and call /builder build oncomplete:RebuildHouse

The builder will then build the schematic, and then run the task, which will build it again with the excavate option that will tear it down first, and the cycle will continue.