cross label fail=VALUE
Name | Description | Default value |
---|---|---|
label | label the cross exam so that you can 'goto label' later to start from the top | |
fail | label to jump to if no label is defined for an action, when pressing or presenting | "none" |
Begin a cross examination. You may tag this cross examination, such as 'cross testimony1' which will
allow you to jump to the beginning of the testimony again with 'goto testimony1'. Aftter the 'cross' line,
you will have a series of 'statement's which define each line of text that the witness says which make up the testimony.
When statements are finished, you will have the line 'endcross' which signifies that responses for player action
during the testimony, in the form of 'label's, will follow.
General layout of a cross examination:
cross [label] statement [statement tag] [text] statement [statement tag] [text] statement [statement tag] endcross
[defense and helper discussing about difficuly] goto [label]
[label for user action] [text] resume
[label for another user action] [text] resume
[label for successful user action (probably a present)] [text] goto continue
label none [general text for a bad present] resume
label continue [rest of game]
endcross
End the current cross examination section. Usually followed by labels for responding to user action. See cross and statement for more info on cross examinations.
statement [tag] test=VALUE
Name | Description | Default value |
---|---|---|
tag | Name the statement so you can match up user action results with it | |
test | Name of a variable. Only show this statement if that variable is true. | all statements shown by default |
Must be between 'cross' and 'endcross'. Defines a specific statement within a witness testimony for
cross examination. Usually followed by a line of text spoken by the witness. The 'tag' will be refered to by labels
which follow the 'endcross' of this cross examination (although it is also possible to put the response label
immediately following the line of text).
label press [tag] - PyWright will jump to a label that looks like this if the user "presses" this statement
label [evidence_tag] [tag] - PyWright will jump to this label when the user presents this evidence to this statement
If no matching label is found, PyWright will jump to the value of 'fail=' given to 'cross'.
exportvars filename (variable_names)
Name | Description | Default value |
---|---|---|
filename | file to export variables into, relative to the case folder | |
variable_names | The names of variables to export. If none are listed, all variables will be exported | all variables |
Saves the name and value of listed variables to a file. They can later be restored. Can be used to make ad-hoc saving systems, be a way to store achievements separate from saved games, or other uses.
filewrite filename [text]
Name | Description | Default value |
---|---|---|
filename | file to write to | |
text | text to write |
Writes text to the end of the specified file. Text is immediately flushed, files written to in
this way do not need to be explicitly "saved". Use "
" for carriage return in the file, " " for tab
characters. 'filename' cannot contain spaces or be located earlier than the current game on the path.
See fileclear and fileseek for other file commands.
importvars filename
Name | Description | Default value |
---|---|---|
filename | file to import variables from, relative to the case folder |
Restores previously exported variables from the file.
loadgame filename hide
Name | Description | Default value |
---|---|---|
filename | Saved game to load, relative to case folder. Saved games may not be named 'hide' | save |
hide | If hide token is included, the interface wont inform the user of the load. |
Restores a save file.
savegame filename hide
Name | Description | Default value |
---|---|---|
filename | File to save to, relative to case folder. Saved games may not be named 'hide' | save |
hide | If hide token is included, the interface wont inform the user of the save. |
Creates a new saved game in the case folder.
screenshot path width=VALUE height=VALUE x=VALUE y=VALUE rwidth=VALUE rheight=VALUE
Name | Description | Default value |
---|---|---|
path | path, relative to game's directory, to save the screenshot, including file extension (.png or .jpg) | |
width | shrink screenshot to this width | 256 |
height | shrink screenshot to this height | 192 |
x | x-value of region to screenshot | 0 |
y | y-value of region to screenshot | 0 |
rwidth | width of region to screenshot | 256 |
rheight | height of region to screenshot | 192 |
Takes a screenshot and saves the image. Can select a specific region of the screen to snapshot. Useful for custom interfaces, or just providing a snapshot feature.
bemo emotion name
Name | Description | Default value |
---|---|---|
emotion | Blinking emotion animation to set character to | |
name | Object name of character to change blinking emotion of | Chooses currently speaking character (value of _speaking) |
Sets a current char object to a specific blinking emotion animation.
bg bg_path x=VALUE y=VALUE z=VALUE loops=VALUE flipx name=VALUE rotz=VALUE stack fade wait
Name | Description | Default value |
---|---|---|
bg_path | Path to the graphics file relative to case/art/bg and without extension; such as scene1 for games/mygame/mycase/art/bg/scene1.png and scene1.txt | |
x | set the x value | 0 |
y | set the y value | 0 |
z | set the z value (check PyWright/core/sorting.txt for idea of z values) | sorting.txt lists default bg z values |
loops | alter the loops of the bg animation | |
flipx | Mirror the image on the x axis | |
name | Gives the bg a unique name to be used for other commands | Default name will be the bg path |
rotz | rotate the object on the z axis | 0 |
stack | The scene won't be cleared when the background is loaded | |
fade | Background will fade in instead of popping in | |
wait | Wait until animation is finished to continue |
Creates a background object. If 'stack' is not included, the scene will be cleared before the background is loaded. Backgrounds also default to a lower z value than other objects, ensuring that they will be in the background (though this can be modified). Other than that, backgrounds have the same properties as other graphic objects, and may be animated or manipulated.
char character_name nametag=VALUE e=VALUE be=VALUE x=VALUE y=VALUE z=VALUE name=VALUE pri=VALUE fade stack hide noauto
Name | Description | Default value |
---|---|---|
character_name | Name of character folder in art/port. If the character is to be hidden, the character_name doesn't need to match up to any actual directory. Graphics will be loaded from that directory according to the visible emotion | |
nametag | The name to actually display to the player as this character's name. | character_name |
e | The character's starting emotion | normal |
be | The emotion to use while character is in the blink pose | |
x | set the x value | default x places character in the center of the screen |
y | set the y value | default y places the bottom of the character graphic at the bottom of the screen |
z | set the z value (check PyWright/core/sorting.txt for idea of z values) | sorting.txt lists default char z values |
name | Gives the object a unique name to be used for other commands | Default name will be character_name |
pri | Alter the default priority of the character animation | sorting.txt lists default pri values |
fade | Character will fade in instead of popping in | |
stack | Don't delete other characters before adding this one | All other characters are deleted |
hide | Don't actually show the character, just set who is talking | |
noauto | Just play the animation, don't let textboxes set talk/blink modes or do lip syncing. |
Create a character object, and set that object as the currently speaking character. (The variable _speaking_name contains
the object name of the currently speaking character). Character's in pywright refer to a folder containing various animations belonging
to the character. This "emotion" can be set with the e= keyword on the char command, as well as modified during text. Textboxes
also will control the animation of the currently speaking character to make the mouth movements match the speed the text is
printing.
There are several variables which further control properties of characters. All characters will, by default, use the sound
effect "blipmale.ogg" as the sound the text makes as it prints out, which is the male voice. If the character's name is located
under the female section in core/blipsounds.txt, the default sound used will instead be "blipfemale.ogg". The sound can be changed
on a text by text basis, with "{soundnewsound.ogg}The text sound has now been changed", but this can get tedious.
A new default sound, based on the characters id name (the name used for their art folder, and used by the char command as
in 'char name') can be set. The syntax is 'set char_defsound_[name] [sound file]', where [name] is the name you will use,
and [sound file] is the filename relative to the sfx/ folder to play for the text blip sound.
The default blip for characters who aren't predefined in this way can be changed from blipmale.ogg to something else by
setting the variable 'char_defsound': 'set char_defsound [sound file]'
The best place to set these variables is in a separate file included in intro.txt, so that the settings will remain
throughout the game.
delete name=VALUE suppress
Name | Description | Default value |
---|---|---|
name | Unique name of object to delete. | |
suppress | Don't show error message even if object cannot be found to delete |
Deletes the named object from the scene. (Any time you give an object a name, such as 'ev bloody_knife name=bk' you can use this command to delete it later, such as 'delete name=bk'.
emo emotion name
Name | Description | Default value |
---|---|---|
emotion | Emotion animation to set character to | |
name | Object name of character to change emotion of | Chooses currently speaking character (value of _speaking) |
Sets a current char object to a specific emotion animation.
ev evidencekey x=VALUE y=VALUE z=VALUE loops=VALUE flipx name=VALUE rotz=VALUE fade
Name | Description | Default value |
---|---|---|
evidencekey | Evidence id key. PyWright will look at the 'evidencekey_pic' variable to determine what graphic file to load | |
x | set the x value | 0 |
y | set the y value | 0 |
z | set the z value (check PyWright/core/sorting.txt for idea of z values) | sorting.txt lists default ev z values |
loops | alter the loops of the animation | |
flipx | Mirror the image on the x axis | |
name | Gives the object a unique name to be used for other commands | Default name will be the evidence key |
rotz | rotate the object on the z axis | 0 |
fade | Object will fade in instead of popping in |
Creates a graphic for an evidence key. The graphic is based on whatever you set for that specific evidence key. You can easily
add an item to the court record and then display the same item on screen. Example:
set housekey_pic key1 set housekey_name House Key set housekey_desc The key to the victim's house addev housekey ev housekey "House key added to court record"
fg fg_path x=VALUE y=VALUE z=VALUE loops=VALUE flipx name=VALUE rotz=VALUE nowait fade
Name | Description | Default value |
---|---|---|
fg_path | Path to the graphics file relative to case/art/fg and without extension; such as fence for games/mygame/mycase/art/fg/fence.png and fence.txt | |
x | set the x value | 0 |
y | set the y value | 0 |
z | set the z value (check PyWright/core/sorting.txt for idea of z values) | sorting.txt lists default fg z values |
loops | alter the loops of the fg animation | |
flipx | Mirror the image on the x axis | |
name | Gives the fg object a unique name to be used for other commands | Default name will be the fg path |
rotz | rotate the object on the z axis | 0 |
nowait | Continue game execution without waiting for foreground animation to finish. | |
fade | Object will fade in instead of popping in |
Creates a foreground object. These are just like any other object, except the default z value will place them in front of most of the objects in the scene.
obj graphic_path x=VALUE y=VALUE z=VALUE loops=VALUE flipx name=VALUE rotz=VALUE fade
Name | Description | Default value |
---|---|---|
graphic_path | Path to the graphics file relative to case/art and without extension; such as bg/scene1 for games/mygame/mycase/art/bg/scene1.png and scene1.txt | |
x | set the x value | 0 |
y | set the y value | 0 |
z | set the z value (check PyWright/core/sorting.txt for idea of z values) | sorting.txt lists default object z values |
loops | alter the loops of the object animation | |
flipx | Mirror the image on the x axis | |
name | Gives the object a unique name to be used for other commands | Default name will be the graphic path |
rotz | rotate the object on the z axis | 0 |
fade | Object will fade in instead of popping in |
Creates a generic graphics object and places it in the scene. It will be drawn on a layer according to it's z value. graphics objects may or may not be animated, which is defined in metadata files stored along with the graphics. ball.png will have a ball.txt describing it's animation qualities, if it has any.
penalty change_amount variable=VALUE threat=VALUE delay=VALUE
Name | Description | Default value |
---|---|---|
change_amount | Amount of health to change, either adding, subtracting, or setting the health, while animating the change on the bar | By default there will be no change |
variable | the health variable to use | "penalty" |
threat | Amount of health to threaten the player with losing (flashes this portion of the bar) | 0 |
delay | How long to delay the script before deleting the bar and continuing. A value of 0 means no delay and the bar will stay onscreen until deleted. | Default is 50 if the value is changing, and 0 if the value is not |
Display a health bar, and if change_amount is given, show the player that they are losing health,
and subtract the health. If change_amount starts with a minus sign, the amount will be subtracted from
the current health value. If it starts with a plus sign, the amount will be added to the current health value.
With no minus or plus sign, it will SET the health value to this amount, but still animate the change. At
your game's checkpoints, you will probably want "penalty 100", which will show the healthbar
filling up to that amount.
Without change_amount, you are just showing the player their current health, and optionally threatening
them with an amount they may lose if they make the wrong choice.
There is support for multiple health variables, if you were to have a multiple
character game, or maybe you want to keep score and have a new health bar in each case. The 'variable'
keyword allows you to choose which health bar the penalty command is referring to.
Since it just uses variables, you can also change the health bar values behind the scenes without showing
the penalty bar at all, by just using the normal variable commands. The default penalty variable is 'penalty'.
nt [nametag]
Name | Description | Default value |
---|---|---|
nametag | Text to set for the next nametag | If no text is given, the next nametag will be invisible |
Sets or clears the next nametag. Must be called immediately before the textbox it alters. Other commands like "char" or "set _speaking" which alter the nametag may conflict with this command.
textblock x y width height color=VALUE name=VALUE [text]
Name | Description | Default value |
---|---|---|
x | x value to place text | |
y | y value to place text | |
width | width of text block | |
height | height of text block (determines rows but the value is in pixels) | |
color | color of the text | |
name | id of textblock object for later reference | |
text | text to display |
Displays a block of text all at once on the screen somewhere. Used to create custom interfaces. The text doesn't support markup in the same way that textboxes do.
textbox [text]
Name | Description | Default value |
---|---|---|
text | Text to be print in the textbox, with markup. |
Draws a several line animated textbox to the screen. Uses art/general/textbox_2 as the back
drop. The letters of the textbox will print one by one at a set rate, which can be modified
with the markup commands. If there is a character speaking (the _speaking variable is set, a char
command has just been issued, etc) then the character will animate as the text is output.
The game script will pause until the player (or the textbox via markup) tells the game to
continue. This command can also be issued by having a blank line surrounded by quotes. Ex:
char test textbox This is some text that is printing #The same text could be printed this way: char test "This is some text that is printing."
casemenu pri=VALUE
Name | Description | Default value |
---|---|---|
pri | What priority to update the case menu | Default casemenu priority listed in core/sorting.txt |
Shows the phoenix wright styled case selection menu, allowing players to navigate available cases in a game folder and choose one to play. The priority might need to be adjusted if you have any special animation going on, but don't modify it unless you know you need it. This command should be the last command run from an intro.txt placed in a game's folder. PyWright will also run the case menu by default if there is NO intro.txt in a game's folder. Single case games may opt to have the "case" folder and "game" folder be the same, and not show a case menu at all.
addcase case_name
Name | Description | Default value |
---|---|---|
case_name | case folder name to add to the menu |
Adds a case to the next menu slot. After calling {locked_cases}, call {addcase [case]} for each case that should be on the menu when they are all unlocked.
addev tag page
Name | Description | Default value |
---|---|---|
tag | Name of evidence to add to the court record | |
page | Which page to add evidence to | Default is to add to the evidence page, unless the tag ends with a '$' in which case it will add to profiles |
Adds evidence to the court record based on an evidence 'tag'. The various properties of the evidence should be stored in variables based on this tag:
set [tag]_name: the name displayed to the player on court record screen for this item, defaults to the tag itself
set [tag]_pic: the image to use, should be in game/case/art/ev, or game/art/ev, defaults to the tag ([tag].png in art/ev)
set [tag]_desc: the long description of the evidence, shown on zoomed court record view, defaults to blank
set [tag]_check: name of a script to run if item is checked by player
delev tag
Name | Description | Default value |
---|---|---|
tag | name of evidence to delete from court record |
Delete an item from the court record.
examine fail=VALUE
Name | Description | Default value |
---|---|---|
fail | label to jump to when a specific evidence label is not found. | none |
Displays the examine cursor to allow the player to choose a spot on the screen, and jump to different labels based on the spot. Immediately following the examine command, you must use region commands to define where the player can click.
gui type macro var_name x=VALUE y=VALUE z=VALUE width=VALUE name=VALUE graphic=VALUE hold password try_bottom run=VALUE [text]
Name | Description | Default value |
---|---|---|
type | type of gui to create. (Back, Button, Input, or Wait) | |
macro | First argument after Button is the name of the macro to run when the button is pressed, valid for (Button) | |
var_name | Variable name to save input text into, valid for (Input) | |
x | x position of created item, valid for (Back, Button, Input) | |
y | y position of created item, valid for (Back, Button, Input) | |
z | z position of created item, valid for (Back, Button, Input) | |
width | pixel width of input box, valid for (Input) | |
name | id to give object for later reference, valid for (Back, Button, Input) | |
graphic | path to graphic file, valid for (Button) | default for buttons is to have an outline with the text of the button label |
hold | hold means that the macro will repeatedly execute as long as the button is held down, valid for (Button) | default is that it only executes with each distinct click |
password | typed text will be displayed with stars *****, valid for (Input) | default is to show text |
try_bottom | Try to keep object in bottom screen, but if no bottom screen exists move it up, valid for (Button) | |
run | repeatedly execute this macro, valid for (Wait) | default is no macro will be run |
text | remaining text will display for Button if there is no graphic, valid for (Button) | default is no text |
This complex command is used to build custom interfaces and behavior into your game. If you don't understand it you probably
don't need to use it, but if you are doing something that isn't quite standard you will probably need this command at one time or another.
The four types of gui you can create are:
* Button - This creates a button that can be clicked. When clicked a macro will run.
* Back - This is a specialized button which displays the PyWright back button. The game will halt until the back button is pressed, making it pretty easy to create a custom screen for evidence
* Input - this will show an input box allowing the player to input text. This text will be saved into a variable which you define.
* Wait - this command will pause the script and optionally execute a macro each frame
li [option] result=VALUE
Name | Description | Default value |
---|---|---|
option | text to display, and if 'result' not given, label to jump to if option is selected | |
result | specifically named label to jump to if this option is chosen |
Add an item to the current list. When clicked, PyWright will go to a label either matching the option text, or matching the value of 'result' if that was given. Must be used between 'list' and 'showlist' commands.
list tag noback
Name | Description | Default value |
---|---|---|
tag | Tag this list with some name so PyWright can keep track of which list options the player has tried already | Default is to name the list based on what script it's found in and on what line |
noback | No back button will be displayed if this token is included |
Start building a list of options to present the player. By default, each list will be unique. If you have a list appear in multiple parts of the code, but
they are meant to appear to the player as the same list, make sure they have the same tag. Also, the tag you give will do double duty, as you can use
'goto [tag]' to jump straight to the list without any other labels. If noback is included, then no back button will be displayed,
forcing the player to choose an option. You may not use "noback" as the tag. To actually build the list requires a series of 'li' commands, and then displaying the list
will require the command 'showlist'. Upon choosing an option, PyWright will try to jump to a label matching the text of the option. Example below, more info
under 'li' and 'showlist'.
"What is your favorite food?"
list faveorite_food li hamburger li HAMBURGER li hamburger? showlist
label hamburger "Wow you like hamburgers too?" exit
label HAMBURGER "Gee, you don't have to be so grumpy about it." exit
label hamburger? "Yes, that is correct. Don't be timid." exit
localmenu examine=VALUE talk=VALUE present=VALUE move=VALUE fail=VALUE
Name | Description | Default value |
---|---|---|
examine | whether to show the examine button | false |
talk | whether to show the talk button | false |
present | whether to show the present button | false |
move | whether to show the move button | false |
fail | label to jump to if the label for an action was not found | none |
Show an investigation menu of options. Should be run after the background of a scene is loaded. When an option is clicked, PyWright will jump to the label of the action, such as "label examine" or "label talk". You can control which options are shown through the keywords described.
menu scene_name examine=VALUE talk=VALUE present=VALUE move=VALUE
Name | Description | Default value |
---|---|---|
scene_name | Menu scene name. Scripts for each action should be named 'scene_name.examine.txt', 'scene_name.talk.txt', 'scene_name.present.txt', and 'scene_name.move.txt' | |
examine | whether to show the examine button | true |
talk | whether to show the talk button | true |
present | whether to show the present button | true |
move | whether to show the move button | true |
Show an investigation menu of options. Should be run after the background of a scene is loaded. When an option is clicked, a separate script will be run for that action, as determined by the value of scene_name. When that external script is finished, the game won't return to this spot automatically, so you will need to be sure you can create the proper menu from the external screen as well. People usually do this by creating a script [scene_name].txt which loads the background and shows the menu. Then, any external script can instantly load the proper scene with "script [scene_name]". You can control which options are shown through the keywords described.
present fail=VALUE noback
Name | Description | Default value |
---|---|---|
fail | label to jump to when a specific evidence label is not found. | none |
noback | Don't show back button |
Displays the court record and allows the player to present evidence. After the presentation,
will jump to the label named after the selected evidence tag. If a label for the chosen evidence
is not found, will either jump to 'label none', or the value of 'fail'. To disable showing the back
button, use the 'noback' token
#add some evidence addev sillyputty addev redherring
#show present screen present fail=badpresent
#back was pressed "So you don't want to present anything at all?" goto next
#silly putty was presented label sillyputty "That's just what I needed." goto next
#Something else was presented label badpresent "I don't care about that."
label next #show present with no back button present fail=badpresent noback "the code will never get here" label sillyputty "good I needed that" "by the way, I saw you couldn't press the back button" goto next label badpresent "I don't care about that." label next
region3d x y width height label
Name | Description | Default value |
---|---|---|
x | x value of rectangular region on the texture | |
y | y value of rectangular region on the texture | |
width | width of rectangular region on texture | |
height | height of rectangular region on texture | |
label | label to jump to when region is clicked |
Creates a clickable region on a 3d object by binding a rectangular region of the object's texture to a wrightscript label event. Applies to current 3d object if there is one.
forgetlist tag
Name | Description | Default value |
---|---|---|
tag | list tag to forget |
Clears the memory of which options player has chosen from a specific list. Normally, chosen options from a list will be shown with a checkmark to remind the player which options they have tried, and which ones are new. You can make all the options for a list not show checkmarks by clearing the memory.
forgetlistitem tag [option]
Name | Description | Default value |
---|---|---|
tag | list to forget item from | |
option | option from list to forget state of |
Forget checkmark status of a specific option from a specific list.
game game script
Name | Description | Default value |
---|---|---|
game | Path to game. Should be from the root, i.e. games/mygame or games/mygame/mycase | |
script | Script to look for in the game folder to run first | intro |
Can be used to start a new game or case.
script script_name label=VALUE noclear stack
Name | Description | Default value |
---|---|---|
script_name | name of the new script to load. Will look for 'script_name.script.txt', 'script_name.txt', or simple 'script_name', in the current case folder. | |
label | A label in the loading script to jump to after it loads. | Execution starts at the top of the script instead of a label |
noclear | If this token is present, all the objects that exist will carry over into the new script. | Otherwise, the scene will be cleared. |
stack | Puts the new script on top of the current script, instead of replacing it. When the new script exits, the current script will resume following this "script" command. | The new script will replace the current script. |
Stops or pauses execution of the current script and loads a new script. If the token stack is included, then the current script will resume when the new script exits, otherwise, the current script will vanish.
timer ticks command
Name | Description | Default value |
---|---|---|
ticks | How many ticks (1/60 of a second) before the command will be run | |
command | The name of a macro to be run after the timer runs out |
Schedule a macro to be executed after a certain amount of time. The rest of the game will proceed normally until the timer fires it's macro. Depending on what the macro does, the game may switch to a new mode or resume after the macro has completed.
controlanim name=VALUE start=VALUE end=VALUE jumpto=VALUE pause=VALUE loop noloop b t
Name | Description | Default value |
---|---|---|
name | Named object to control | Will alter animation of all current objects - not recommended to use the default value. |
start | Alter the starting frame of the animation | Leave starting frame what it was. |
end | Alter ending frame of the animation | Leave ending frame what it was. |
jumpto | Instantly set an animations frame to this value | Don't change frames |
pause | Pause animation | |
loop | Force animation to loop | |
noloop | Force animation not to loop | |
b | Alter blink animation of chars | |
t | Alter talk animation of chars |
Alter the animation settings for a currently playing animated object. Normally you will use the settings that come with the animation in the form of a .txt file next to the graphic file. Occasionally you may wish to play an animation differently, such as having a non looping animation play several times, or only playing a portion of a longer animation.
globaldelay speed name=VALUE b t
Name | Description | Default value |
---|---|---|
speed | The speed to set the selected animation to - this is the number of display frames to wait before showing the next animation frame. | |
name | Only change the animation speed of objects with the given name | Change animation speed of all objects (if you want to mimic fastforward or slowdown you want to leave name= off) |
b | Select blinking animation for char objects | |
t | Select talking animation for char objects |
Changes the default delay value for either all running animations or specific ones. First create the animation with a char, bg, fg, etc command, then call globaldelay to adjust the rate the animation will play. Use b or t to choose blinking or talking animations if used with char. Normally, you will use the delay values stored with the animations themselves, in the .txt files that go alongside the graphics. However, sometimes you may wish something to happen faster or slower.
pause ticks all script priority=VALUE
Name | Description | Default value |
---|---|---|
ticks | How many ticks (1/60 of a second) to wait | |
all | Pause EVERYTHING | default behavior pauses script execution but lets animation continue |
script | Pause only the script | this is the default behavior |
priority | Fine tune what gets paused and what doesnt. | 10000 (such a high number for priority means that most objects will not be paused |
This command will pause execution of various things. It's main use is to pause the script to let an animation finish before continuing.
mus [filename]
Name | Description | Default value |
---|---|---|
filename | Filename of song, searches game/case/music, game/music, and PyWright/music | If no path is listed, music will stop |
Stops currently playing music file, and if 'filename' is given, starts playing a new one. If you want to queue up a song to play when the current
song is finished, used for situations where you want an intro to a looping track, run this code anytime after the mus command:
set _music_loop track_name.
addvar variable amount
Name | Description | Default value |
---|---|---|
variable | variable to save to | |
amount | amount to add to the variable |
Adds an amount to a variable. If the variable 'x' were set to 4, the script:
addvar x 1would set 'x' to 5.
delflag flag_name
Name | Description | Default value |
---|---|---|
flag_name | flag to unset |
Deletes a flag. Flags will remain set for the remainder of the game, but can be forgotten with delflag.
divvar variable amount
Name | Description | Default value |
---|---|---|
variable | variable to save to | |
amount | amount to divide the variable by |
Divide a variable by a number. If the variable 'x' were set to 10, the script:
divvar x 2would set 'x' to 5.
flag [flag_expression] <? OR label > fail=VALUE
Name | Description | Default value |
---|---|---|
flag_expression | list of flag names joined with AND or OR | |
? | ||
label | label to jump to if the evaluation is true | |
fail | label to jump to if evaluation is false | none |
Evaluates an expression with flag names. If the expression is true, jumps to the listed label. Otherwise, will jump to the fail keyword if that was given. If the line ends with a '?', it will execute the next line and the next line only when the flag expression is true.
gamemenu [destination] fail=VALUE
Name | Description | Default value |
---|---|---|
destination | The destination label to move to | |
fail | A label to jump to if the destination can't be found |
Can be used to list games in a folder
getprop variable name=VALUE prop=VALUE
Name | Description | Default value |
---|---|---|
variable | The variable to save the value into | |
name | The object to get the property from | |
prop | The property to get from the object |
Copies the value of some property of an object into a variable
getvar variable [source variable]
Name | Description | Default value |
---|---|---|
variable | The variable to save the value into | |
source variable | The variable to get the value from. Can use $x to use another variable to point to which variable to copy from, like a signpost. |
Copies the value of one variable into another.
goto [destination] fail=VALUE
Name | Description | Default value |
---|---|---|
destination | The destination label to move to | |
fail | A label to jump to if the destination can't be found |
Makes the script go to a different section, based on the label name.
is [expression] fail=VALUE <label OR ? >
Name | Description | Default value |
---|---|---|
expression | ||
fail | label to jump to if expression fails | |
label | ||
? |
Evaluates the expression. If the expression is true, will either jump to 'label' or execute the next
line if a '?' is used instead of a label name. If 'fail=' is given, will jump to that label when the expression
is false.
Expressions are very simplistic, supporting only AND and OR for operations, and numbers/text
or $variables for operands.
is_ex [expression2] <label OR ? > fail=VALUE
Name | Description | Default value |
---|---|---|
expression2 | ||
label | ||
? | ||
fail | label to jump to if expression fails |
Evaluates the expression. If the expression is true, will either jump to 'label' or execute the next
line if a '?' is used instead of a label name. If 'fail=' is given, will jump to that label when the expression
is false.
Expressions are modelled after ace attorney online, and support () - + / * == < > <= >= AND and OR for
operations, and var1 (variables), 'blah' (text) or 239 (numbers) for values. Functions are not
supported, use pywright operations to manipulate variables before using the
variable in an expression.
isempty variable <label OR ? >
Name | Description | Default value |
---|---|---|
variable | Variable to check if it doesn't exist | |
label | a label to jump to if the variable has not been set or is blank | |
? | execute next line only if variable is unset or blank |
If the variable has not been set (it is equal to "") then either jump to the given label or execute the next line if the given label is a '?'.
isnot [expression] fail=VALUE <label OR ? >
Name | Description | Default value |
---|---|---|
expression | An expression that evaluates to true or false | |
fail | label to jump to if expression fails | |
label | a label to jump to if the expression evaluates to false | |
? | execute next line only if expression evaluates to false |
If the expression is false, will jump to the success label.
Otherwise, it will either continue to the next line, or jump to
the label set by the fail keyword
Expressions are very simplistic, supporting only AND and OR for operations, and numbers/text
or $variables for operands.
isnotempty variable <label OR ? >
Name | Description | Default value |
---|---|---|
variable | Variable to check if it exists | |
label | a label to jump to if the variable has been set and is not blank | |
? | execute next line only if variable is set and not blank |
If the variable has been set (it is not equal to "") then either jump to the given label or execute the next line if the given label is a '?'.
isnumber variable <label OR ? >
Name | Description | Default value |
---|---|---|
variable | Variable to check if it exists | |
label | a label to jump to if the variable has been set and is not blank | |
? | execute next line only if variable is set and not blank |
If the variable contains a number jump to the given label or execute the next line if the given label is a '?'
joinvar variable [words]
Name | Description | Default value |
---|---|---|
variable | variable to save value to | |
words | words to join together |
Takes a series of words and joins them together, save the joined
string to a variable. For instance:
setvar hour 3 setvar minute 15 joinvar time $hour : $minute "{$time}"will output "3:15"
label [label text]
Name | Description | Default value |
---|---|---|
label text | The name of this section of code |
Used to mark a spot in a wrightscript file. Other code can then refer to this spot, specifically for making the code reader "goto" this spot.
mulvar variable amount
Name | Description | Default value |
---|---|---|
variable | variable to save to | |
amount | amount to multiply the variable by |
Multiply a variable by a number. If the variable 'x' were set to 5, the script:
mulvar x 3would set 'x' to 15.
noflag [flag_expression] <? OR label > fail=VALUE
Name | Description | Default value |
---|---|---|
flag_expression | list of flag names joined with AND or OR | |
? | ||
label | label to jump to if the evaluation is true | |
fail | label to jump to if evaluation is false | none |
Evaluates an expression with flag names. If the expression is not true, jumps to the listed label. Otherwise, will jump to the fail keyword if that was given. If the line ends with a '?', it will execute the next line and the next line only when the flag expression is false.
random variable start end
Name | Description | Default value |
---|---|---|
variable | variable name to save random value to | |
start | smallest number to generate | |
end | largest number to generate |
Generates a random integer with a minimum value of START, a maximum value of END, and stores that value to VARIABLE
setvar variable [value]
Name | Description | Default value |
---|---|---|
variable | variable name to set | |
value | Text to assign to the variable. Can include $x to replace words of the text with the value of other variables. |
Sets a variable to some value.
setvar_ex variable [expression2]
Name | Description | Default value |
---|---|---|
variable | variable name to set | |
expression2 | The results of the expression will be stored in the variable. |
Sets a variable to some value based on an expression
setflag flag_name
Name | Description | Default value |
---|---|---|
flag_name | flag to set |
Sets a flag. Shorthand for setting a variable equal to true. Flags will remain set for the remainder of the game, and can be used to track what a player has done.
setprop variable name=VALUE prop=VALUE
Name | Description | Default value |
---|---|---|
variable | The variable to save the value into | |
name | The object to get the property from | |
prop | The property to get from the object |
Copies the value of a variable to some property of an object
setvar variable [value]
Name | Description | Default value |
---|---|---|
variable | variable name to set | |
value | Text to assign to the variable. Can include $x to replace words of the text with the value of other variables. |
Sets a variable to some value.
setvar_ex variable [expression2]
Name | Description | Default value |
---|---|---|
variable | variable name to set | |
expression2 | The results of the expression will be stored in the variable. |
Sets a variable to some value based on an expression
subvar variable amount
Name | Description | Default value |
---|---|---|
variable | variable to subtract from and save to | |
amount | amount to subtract from the variable |
Subtract an amount from a variable. If the variable 'x' were set to 33, the script:
subvar x 3would set 'x' to 30.
debug <true OR false >
Name | Description | Default value |
---|---|---|
true | turns on debug mode | |
false | turns off debug mode |
Used to turn debug mode on or off. Debug mode will print more errors to the screen, and allow you to skip through any text.
print [text]
Name | Description | Default value |
---|---|---|
text | Some text to print |
Prints some text to the logfile. Only useful for debugging purposes.
fade start=VALUE end=VALUE speed=VALUE name=VALUE nowait
Name | Description | Default value |
---|---|---|
start | What fade level to start at | 0 |
end | What fade level to end at | 100 |
speed | How many fade steps per frame | 1 |
name | Name a specific object to fade | Will try to fade all objects |
nowait | Continue script while fade happens | The script will pause until fade is finished |
Fade an object or objects in or out
grey value=VALUE name=VALUE
Name | Description | Default value |
---|---|---|
value | Whether an object should be greyscale or not: 1=greyscale 0=not | 1 |
name | Name a specific object to set to greyscale | Will try to greyscale all objects |
Makes an object display in greyscale.
invert value=VALUE name=VALUE
Name | Description | Default value |
---|---|---|
value | Whether an object should be inverted or not: 1=inverted 0=not | 1 |
name | Name a specific object to tint | Will try to tint all objects |
Invert the colors of an object.
rotate degrees=VALUE speed=VALUE axis=VALUE name=VALUE nowait
Name | Description | Default value |
---|---|---|
degrees | How many degrees to rotate | |
speed | How many degrees to rotate per frame | |
axis | which axis to rotate on, z is the only valid value | z |
name | Name a specific object to rotate | Will try to rotate all objects (not what you might expect) |
nowait | Continue script while rotation happens | The script will pause until rotation is finished |
Begins an object rotation animation. Will wait for rotation to finish unless 'nowait' is included.
scroll name=VALUE filter=VALUE x=VALUE y=VALUE z=VALUE speed=VALUE last nowait
Name | Description | Default value |
---|---|---|
name | Name of object to scroll | scrolls everything |
filter | select only objects on the 'top' screen or 'bottom' screen, leave blank for either | 'top' |
x | amount to scroll horizontally | 0 |
y | amount to scroll vertically | 0 |
z | amount to scroll into the screen, only really valid for mesh objects | 0 |
speed | pixels per frame to scroll | 1 |
last | select last added object as scroll target | |
nowait | continue script while scrolling |
Scrolls the screen around, can also be used to move individual objects. Positive values for x will move objects LEFT (consider moving the viewpoint/camera RIGHT) and positive values for y will move objects UP (moving the viewpoint/camera DOWN) If the scroll amount does not divide evenly by the speed, it will still stop at the right place. (In older versions you needed to make sure the speed would divide evenly over the distance).
shake ttl offset nowait both
Name | Description | Default value |
---|---|---|
ttl | Time for shake to last in frames | 30 |
offset | How many pixels away to move the screen (how violent) | 15 |
nowait | Continue executing script during shake | |
both | Shake affects both screens as a whole |
Shake the screen for effect.
tint start=VALUE end=VALUE speed=VALUE name=VALUE nowait
Name | Description | Default value |
---|---|---|
start | Color tint to start at | 'ffffff' or no tint (full color) |
end | Color tint to end at | '000000' or full black tint |
speed | How many color steps per frame | 1 |
name | Name a specific object to tint | Will try to tint all objects |
nowait | Continue script while fade happens | The script will pause until fade is finished |
Animate an object's tint from one color to another. You can make an object darker but not brighter. Tinting an object to red subtly can make a blush effect, tinting objects darker if there is a cloud overhead, or mixing tint with greyscale to make a sepia toned flashback scene are different ways this can be used.
zoom mag=VALUE frames=VALUE name=VALUE nowait last
Name | Description | Default value |
---|---|---|
mag | How many times to magnify | 1 (will magnify 1 time, which is 2x magnification) |
frames | how many frames for the zoom to take | 1 |
name | Which object to magnify | tries to magnify everything |
nowait | continue script during magnification | |
last | Choose last added object as target |
Causes a single object or all objects to be magnified. The value for 'mag' will be added to the current magnification
value of an object, and it will take 'frames' frames to get to the new value. By default, all objects are at a magnification
of 1. To shrink an object to half it's size for instance, you would use this command:
zoom mag=-0.5 frames=10This will subtract half magnification from an object over 10 frames: 1x - 0.5x = 0.5x.
sfx [filename] after=VALUE
Name | Description | Default value |
---|---|---|
filename | Filename of sound file, searches game/case/sfx, game/sfx, and PyWright/sfx | |
after | Delay sound for this many frames |
Play a sound effect. If 'after' will play the sound after a certain number of frames (useful to time an effect with a specific
frame of an animation).
Sound files can be .ogg or uncompressed .wav