Scripting: Difference between revisions

1,357 bytes added ,  7 May 2023
Additional info about movement/interaction commands.
m (Paru moved page Kemoverse Online/Scripting to Scripting without leaving a redirect)
(Additional info about movement/interaction commands.)
Line 25: Line 25:
- I'll tell you a secret.
- I'll tell you a secret.
+ What?
+ What?
- I have a snail in my pocket.
- I have a snail in my pocket.</nowiki>
</nowiki>
Here's a short example. It presents and option to interact ("say hello"), and clicking on it, starts the script. Both players turn to each others, exchange dialog, and the script player looks left, right, then continues the dialog. As you can see, it's very easy to make a simple conversation. But there's way more than that! You can make your character walk around, animate, do facial expression... and such.  
Here's a short example. It presents and option to interact ("say hello"), and clicking on it, starts the script. Both players turn to each others, exchange dialog, and the script player looks left, right, then continues the dialog. As you can see, it's very easy to make a simple conversation. But there's way more than that! You can make your character walk around, animate, do facial expression... and such.  


See the first letter that starts each line? It's the command - this determines what you want the character to do. After that first letter, you type in parameters to specify even more. Let's have a look of all the commands you can do.
See the first letter that starts each line? It's the command - this determines what you want the character to do. After that first letter, you type in parameters to specify even more. Let's have a look of all the commands you can do.


== Basic commands ==
== Script Commands ==


=== Movement ===
=== Movement ===
mv,move is one of the most important movement commands. There is various ways to get a character to move.
==== Move a direction ====
<nowiki>
mv forward
mv left
mv back
mv right</nowiki>
You can also specify how many steps you want a character to take. mv forward 5 will move 5 steps forward.
==== Move to an exact spot ====
You can move to an exact spot in the world using coordinates.
<nowiki>
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.
==== Move to an object ====
<nowiki>
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.
=== Interaction ===
==== Interact with an object. ====
Interacting with objects is fairly reasonable.
<nowiki>
in sera_hammock</nowiki>
You can also interact with an object that has multiple interaction options.
<nowiki>
in kitchen_chair 2</nowiki>
Tip: To get the correct interaction of an object you wish to interact with middle click the interaction you wish to choose twice while having the script text cursor at the place you want the interaction to be pasted into your code.
Anonymous user