Scripting: Difference between revisions

(Mentioned scheduling.)
 
(7 intermediate revisions by 3 users not shown)
Line 18: Line 18:
By default, the interaction/life scripts won't bother you as you play (you have to explicitly run the options through the "Run" button in the script editor). If someone wants to interact with you, you can approve that one interaction request by clicking on them and clicking "Answer".
By default, the interaction/life scripts won't bother you as you play (you have to explicitly run the options through the "Run" button in the script editor). If someone wants to interact with you, you can approve that one interaction request by clicking on them and clicking "Answer".


However, there is a way to auto-accept any request and run your loaded scripts automatically - I name this '''SPC mode''' ('''SPC''' being Scripted Playable Character). You can enable it by pressing Alt+V. By enabling SPC mode, your interaction script auto-accepts any interaction, and your life script starts living out by itself, letting the game pick options based on the "= random" title.
However, there is a way to auto-accept any request and run your loaded scripts automatically - I name this '''SPC mode''' ('''SPC''' being Scripted Playable Character). You can enable it by pressing Alt+X or Shift+X. By enabling SPC mode, your interaction script auto-accepts any interaction, and your life script starts living out by itself, letting the game pick options based on the "= random" title.


While you typically have to load an interaction and/or life script to be used by your SPC manually, there is a way to automatically load these depending on the time of day. [[Scheduling]] is used to automate the what script is used based on the time of day.
While you typically have to load an interaction and/or life script to be used by your SPC manually, there is a way to automatically load these depending on the time of day. [[Scheduling]] is used to automate the what script is used based on the time of day.
Line 67: Line 67:


== Communication ==
== Communication ==
There is some ways to have your SPC talk, those interacting with you talk, display grey chat, and display big title messages.
There is some ways to have your SPC talk, those interacting with you talk, display grey chat messages, and display big title messages.
 
Tip: It could be a great idea to take advantage of chat formatting codes in the [[Chatting]] page to format chat text.


{{HeaderNoTOC|SPC Talking}}
{{HeaderNoTOC|SPC Talking}}
Line 88: Line 90:


<code>^ Super Epic Title</code> will make "Super Epic Title" appear in giant title text in the center of the screen.
<code>^ Super Epic Title</code> will make "Super Epic Title" appear in giant title text in the center of the screen.
<pre style="color: red">Warning: The big title text does not disappear on it's own! Please remember to add ^ with nothing else after to remove the big title letters. It can be very annoying to have it stay on your screen.</pre>


== Movement ==
== Movement ==
Line 203: Line 207:
==Equipment==
==Equipment==
<code>eq</code> or <code>equip</code> lets you equip, unequip, and use equipment.
<code>eq</code> or <code>equip</code> lets you equip, unequip, and use equipment.
{{HeaderNoTOC|Equip item}}
{{HeaderNoTOC|Equip item}}
You can equip your fishing rod by simply <code>eq fishingpole</code> if you have the fishing rod.
<code>eq fishingpole</code> equips an item in to its respective slot.


Check the [[#Equipment List]] below for things you can equip.
{{HeaderNoTOC|Use item}}
<code>eq fishingpole use</code> uses an item, similar to pressing the left mouse button/using "V". The item has to have been equipped already.


{{HeaderNoTOC|Use item}}
{{HeaderNoTOC|Unequip item}}
You can use your fishing rod by simply <code>eq fishingpole use</code>.
<code>eq</code> unequips your primary item (typically, the one you're actively holding in your hand).


Check the [[#Equipment List]] below for things to use.
<code>eq all</code> unequips any of your equipped items (which includes accessories and other gear attached to parts of your body).


{{HeaderNoTOC|Unequip item}}
You can unequip your item by simply using <code>eq</code>.


{{HeaderNoTOC|Equipment list}}
{{HeaderNoTOC|Equipment list}}
Line 245: Line 249:
<code>fc</code> to stop facial expressions.
<code>fc</code> to stop facial expressions.


==Play Animation==
==Play emote==
<code>an</code> or <code>animate</code> to play an animation.
<code>em</code> or <code>emote</code> to play a specific emote.
 
{{HeaderNoTOC|Play animation}}
<code>an yes</code> will play an animation where you nod your head yes.
 
<code>an dance 3</code> will play the dance animation 3 times.
 
<code>an dance -1</code> will play the dance animation forever.
 
<code>an bow 3 0.5</code> plays the bow animation for 3 seconds, however, it starts the animation from the middle instead of the beginning.
 
{{HeaderNoTOC|List of animations}}
Social Animations:
<nowiki>
yes, no, shrug, clap, bow, yawn, wave</nowiki>
 
Emotive Animations:
<nowiki>
admire, giggle, angry, sada, scared, rave</nowiki>
 
Other Animations:
<nowiki>
poke, pose, think, type</nowiki>
 
Duo Animations:
<nowiki>
hug</nowiki>


Standing & Sitting & Laying Animations:
{{HeaderNoTOC|Play emote}}
<nowiki>
<code>em yes</code> will play the "yes" emote, the same one that plays with the chat command "/em yes" or when pressing "yes" in the emoter window.
groundstand, groundstand2, groundstand3, groundsit, groundsit2, groundlay, groundsleep</nowiki>


{{HeaderNoTOC|Stop animation}}
{{HeaderNoTOC|Cancel emote}}
<code>an</code>
<code>em</code> will cancel any currently playing emote.


==Wait/Delay==
==Wait/Delay==
Line 286: Line 263:
{{HeaderNoTOC|Wait for a certain amount of time}}
{{HeaderNoTOC|Wait for a certain amount of time}}


<code>. 5</code> waits for 5 seconds before running more of the code. Mind the space! (".5" without space doesn't mean anything)
<code>wait 5</code> waits for 5 seconds before running more of the code. Mind the space! (".5" without space doesn't mean anything)


{{HeaderNoTOC|Wait until action is finished}}
{{HeaderNoTOC|Wait until action is finished}}


<code>.</code> simply waits until an action like walking, fading, or other things are completed. This is a great way to ensure you finish moving to a location.
<code>wait</code> simply waits until an action like walking, fading, or other things are completed. This is a great way to ensure finishing moving to a location.
 
<code>wait:Target</code> can be used to target an action wait for a specific character.


==Repeat/For Loop==
==Repeat/For Loop==
Line 306: Line 285:
This allows the script runner to move forward and pause for 2 seconds for a total of 5 times.
This allows the script runner to move forward and pause for 2 seconds for a total of 5 times.


==Cutscene==
==Camera control==
<code>cm</code> or <code>camera</code> lets you control cutscenes, cameras, and have a few cinematic controls.
<code>cm</code> or <code>camera</code> lets you control cutscenes, cameras, and have a few cinematic controls.


{{HeaderNoTOC|Cutscene mode}}
{{HeaderNoTOC|Cutscene mode}}
Simply do <code>cm cs</code> and you will enable cutscene mode. Cutscene mode adds black borders and the top and bottom of your screen and hides your hud.
<code>cm cs</code> will enable cutscene mode. Cutscene mode adds black borders and the top and bottom of your screen and hides the interface.
 
<code>cm</code> will disable cutscene mode and resets the camera (ie. places it back at the player character)
 
{{HeaderNoTOC|Focus}}
<code>cm focus</code> returns camera focus on the player.
 
<code>cm focus sera_hammock</code> for example will allow you to focus on an object with the camera. The camera will rotate to look at the object.
 
{{HeaderNoTOC|Set position}}
<code>cm set (coordinates)</code> (for example, <code>cm set 60 21.51 2.90 -13.37 -0.29 2.43 0.00</code>) sets the camera position and aim.
 
This detaches from the focused item and serves as a "static" camera placement. You can get the camera coordinates by right clicking the scripting window and clicking "Paste camera".
 
{{HeaderNoTOC|Fading}}
<code>cm fade</code> creates a short black fade.
 
<code>cm fade 0</code> will make the screen black instantly.
 
<code>cm fade 2.5</code> will fade the screen from screen to black, over the course of 2.5 seconds.
 
<code>cm fade -1.5</code> will fade the screen from black to screen, over the course of 1.5 seconds.


Cutscene mode can be canceled by holding escape.
Remember to put <code>wait</code> to wait for the fade. (eg. <code>wait 1.0</code> to wait one second after doing <code>cm fade 1.0</code>)


{{HeaderNoTOC|Focus camera on object}}
{{HeaderNoTOC|Fading to player}}
<code>cm focus sera_hammock</code> for example will allow you to focus on an object with the camera. The camera will rotate to look at the object for your cutscenes or simply convenience.
<code>cm fadeplayer</code> is a shorthand to fade to black, reset camera to player, then fade out (with automatic waiting).


{{HeaderNoTOC|Fade out}}
{{HeaderNoTOC|Dissolving}}
Fading out allows you to make the current camera view fade out.
<code>cm dissolve</code> creates a short dissolve effect (a snapshot of the screen is faded out to a new shot).


Simply do <code>cm fade</code> to do a short fade. <code>cm fade 0</code> will permanently fade to black.
{{HeaderNoTOC|Blurring}}
<code>cm blur 2.0</code> toggles a blurry effect on the screen with 2.0x power.


To have a fade out that happens slowly for you can do <code>cm fade 5</code> to slowly fade out and after 5 seconds being completed faded to black. You can replace the number 5 with any length of time you want for this fade out.
<code>cm blur</code> toggles the blurry effect off.