Scripting: Difference between revisions

Slight format changes. Reworked section to say "units" rather than "meters" and explain the difference between objects.
(Slight format changes. Reworked section to say "units" rather than "meters" and explain the difference between objects.)
Line 99: Line 99:
You can also specify how many steps you want a character to take. mv forward 5 will move 5 steps forward.
You can also specify how many steps you want a character to take. mv forward 5 will move 5 steps forward.
{{HeaderNoTOC|Move to an object}}
{{HeaderNoTOC|Move to an object}}
<nowiki>
<code>mv to sera_hammock</code>
mv to sera_hammock</nowiki>


Tip: To get the name of an object you wish to move to middle click it twice while having the script text cursor at the place you want the name to be pasted into your code.
Tip: To get the name of an object you wish to move to middle click it twice while having the script text cursor at the place you want the name to be pasted into your code.


{{HeaderNoTOC|Move to an object with a specific distance}}
{{HeaderNoTOC|Move to an object with a specific distance}}
<nowiki>
<code>mv to sera_hammock 3</code>
mv to sera_hammock 3</nowiki>


Move up to 3 meters next to sera's hammock.
Move up to 3 units next to sera's hammock.


It also accepts decimals such a 0.5 meters.
It also accepts decimals such a 0.5 units.


Tip: To get the name of an object you wish to move to middle click it twice while having the script text cursor at the place you want the name to be pasted into your code.
Tip: To get the name of an object you wish to move to middle click it twice while having the script text cursor at the place you want the name to be pasted into your code.


<pre style="color: red">Warning: It's important to remember that distance between something like worms, players, plants, and other objects will be entirely different depending on the size of their collision boxes. 50 units for a worm is way smaller than 50 units away from a lot of larger objects. In other words, it 5 units feels different with different objects, it probably is different. Experiment and find out exactly what distance you want per object.</pre>
{{HeaderNoTOC|Move to an exact spot}}
{{HeaderNoTOC|Move to an exact spot}}
You can move to an exact spot in the world using coordinates.
You can move to an exact spot in the world using coordinates.


<nowiki>
<code>mv to -38.35 1.77 41.12</code>
mv to -38.35 1.77 41.12</nowiki>


Tip: To get the coordinates you can right click the life script as you are working on it and hit paste coordinates. It'll paste the current coordinates you are standing on. This is very helpful.
Tip: To get the coordinates you can right click the life script as you are working on it and hit paste coordinates. It'll paste the current coordinates you are standing on. This is very helpful.
62

edits