Changes

481 bytes added ,  21:12, 21 January 2022
m
clarified advancedmove
Line 247: Line 247:  
| Adds either a Battered Sword or Return Scepter to the player's inventory. The ''Battered Sword'' is unobtainable in vanilla and is incomplete and not implemented.
 
| Adds either a Battered Sword or Return Scepter to the player's inventory. The ''Battered Sword'' is unobtainable in vanilla and is incomplete and not implemented.
 
|-
 
|-
| <samp>advancedMove {{t|npc}} {{t|loop}} {{t|x y}}... OR {{t|x y direction duration}}</samp>
+
| <samp>advancedMove {{t|npc}} {{t|loop}} {{t|x y}}... OR {{t|direction duration}}</samp>
 
| Set multiple movements for an NPC.  You can set True to have NPC walk the path continuously. Example: <samp>/advancedMove Robin false 0 3 2 0 0 2 -2 0 0 -2 2 0/</samp>
 
| Set multiple movements for an NPC.  You can set True to have NPC walk the path continuously. Example: <samp>/advancedMove Robin false 0 3 2 0 0 2 -2 0 0 -2 2 0/</samp>
   −
If you want to assign pauses in between the movement, you would need to add <samp>direction</samp> and <samp>duration</samp> right after <samp>x y</samp> such as the example below: <samp>/advancedMove Clint true 4 0 2 5000 -4 0 1 3000</samp>.
+
To make the NPC move along the x axis (left/right), use the number of tiles to move and 0. For example, <samp>-3 0</samp> will cause the NPC to walk three tiles to the left while facing left. <samp>2 0</samp> will cause the NPC to walk two tiles to the right while facing right.
   −
In this example, Clint will have continuous movement moving 4 tiles to the right, facing down upon arriving, waiting for 5 seconds, then moving 4 tiles to the left, facing right upon arriving, then waiting for 3 seconds, then loops because the loop was set to true(see above).
+
To make the NPC move along the y axis (up/down), use 0 and the number of tiles to move. For example, <samp>0 1</samp> will cause the NPC to walk one tile down while facing down. <samp>0 -5</samp> will cause the NPC to walk five tiles up while facing up.
   −
You can also create movement with no pauses and pauses mixed in it. You can refer to the example below:
+
To make an NPC pause, use the direction to face and the number of milliseconds to pause. 1 is right, 2 is down, 3 is left, and 4 is up. The reason 4 is up and not 0 is so that advancedMove can tell the difference between a pause command and a move up/down command.
<samp>advancedMove Pam true 5 0 0 3 3 5000 -6 0 0 -4</samp>
     −
In this example, Pam first moves 5 tiles to the right, then directly moves 3 tiles downward, faces the to the left upon arriving then waits 5 seconds before moving 6 tiles to the left then moves up 4 tiles directly.
+
The code can tell the difference between a move command and a pause command because a move command must have 0 for either x or y. A pause command must have non-zero numbers for both numbers in the pair.
   −
NOTE: <samp>direction</samp> works a bit differently here compared to the <samp>faceDirection</samp> command. You should use the value 4 instead of 0 to make the NPC look north/up or else your command will bug out.
+
Example: <samp>/advancedMove Clint true 4 0 2 5000 -4 0 1 3000</samp> Clint will have continuous movement moving 4 tiles to the right, facing down upon arriving, waiting for 5 seconds, then moving 4 tiles to the left, facing right upon arriving, then waiting for 3 seconds, then loops because the loop was set to true(see above).
 +
 
 +
Example: <samp>advancedMove Pam true 5 0 0 3 3 5000 -6 0 0 -4</samp> Pam first moves 5 tiles to the right, then directly moves 3 tiles downward, faces the to the left upon arriving then waits 5 seconds before moving 6 tiles to the left then moves up 4 tiles directly.
 
|-
 
|-
 
| <samp>ambientLight {{t|r}} {{t|g}} {{t|b}}</samp>
 
| <samp>ambientLight {{t|r}} {{t|g}} {{t|b}}</samp>
11

edits