Story State Controller Reference

Dolmexica Infinite, presented by Dogma 2018-2023

Documentation for release version (2023)

Updated 30 June 2023

Contents

About Story Controllers

Story controllers work the same way as original controllers.

Story Controller Reference

AnimAddAngle

Add animation rotation.

Required parameters:
ID = identifier (int)
Identifier for animation.
angle = angle (float)
Angle used for the rotation in degrees.
Optional parameters:
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimPosAdd

Add to animation position.

Required parameters:
ID = identifier (int)
Identifier for animation.
Optional parameters:
x = val_x (float)
Position to add to x-axis.
y = val_y (float)
Position to add to y-axis.
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimPosSet

Set animation position.

Required parameters:
ID = identifier (int)
Identifier for animation.
Optional parameters:
x = val_x (float)
Position to set on x-axis.
y = val_y (float)
Position to set on y-axis.
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimScaleSet

Set animation scale.

Required parameters:
ID = identifier (int)
Identifier for animation.
Optional parameters:
x = val_x (float)
Scale on x-axis.
y = val_y (float)
Scale on y-axis.
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimSetAngle

Set animation rotation.

Required parameters:
ID = identifier (int)
Identifier for animation.
angle = angle (float)
Angle used for the rotation in degrees.
Optional parameters:
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimSetColor

Set animation color tint.

Required parameters:
ID = identifier (int)
Identifier for animation.
color = r, g, b (float, float, float)
Color tint to use with animation.
Optional parameters:
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimSetFacing

Set animation scale.

Required parameters:
ID = identifier (int)
Identifier for animation.
facing = direction (int)
1 to set facing right, -1 to set facing left, 0 for no change.
Optional parameters:
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimSetOpacity

Set animation opacity.

Required parameters:
ID = identifier (int)
Identifier for animation.
opacity = alpha (float)
Set opacity of animation.
Optional parameters:
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

AnimStagePosSet

Set animation position in stage coordinates.

Required parameters:
ID = identifier (int)
Identifier for animation.
Optional parameters:
x = val_x (float)
Position to set on x-axis.
y = val_y (float)
Position to set on y-axis.
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CameraFocus

Set focus position for camera (zoom center).

Required parameters:
x = val_x (float)
Position on x-axis.
y = val_y (float)
Position on y-axis.
Optional parameters:
None
Example:
none

CameraZoom

Set camera zoom.

Required parameters:
value = zoom (float)
Zoom value.
Optional parameters:
None
Example:
none

ChangeAnim

Change action for animation with id.

Required parameters:
ID = identifier (int)
Identifier for animation defined in CreateAnim.
anim = action_no (int)
Action number to play.
Optional parameters:
target = target_value (string)
Can be used to change animations in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

ChangeState

Change state machine state.

Required parameters:
value = state_no (int)
State number to change into.
Optional parameters:
none
Example:
none

ChangeStateParent

Change state machine state in parent.

Required parameters:
value = state_no (int)
State number to change parent into.
Optional parameters:
none
Example:
none

ChangeStateRoot

Change state machine state in root.

Required parameters:
value = state_no (int)
State number to change root into.
Optional parameters:
none
Example:
none

ChangeText

Update text. Takes all parameters that CreateText does as optional parameters.

Required parameters:
ID = identifier (int)
Identifier for text defined in CreateText.
Optional parameters:
none
Example:
none

CharAddAngle

Add character rotation.

Required parameters:
ID = identifier (int)
Identifier for character.
angle = angle (float)
Angle used for the rotation in degrees.
Optional parameters:
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharChangeAnim

Change action for character with id.

Required parameters:
ID = identifier (int)
Identifier for character defined in CreateChar.
anim = action_no (int)
Action number to play.
Optional parameters:
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharPosAdd

Add to character position.

Required parameters:
ID = identifier (int)
Identifier for character.
Optional parameters:
x = val_x (float)
Position to add to x-axis.
y = val_y (float)
Position to add to y-axis.
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharPosSet

Set character position.

Required parameters:
ID = identifier (int)
Identifier for character.
Optional parameters:
x = val_x (float)
Position to set on x-axis.
y = val_y (float)
Position to set on y-axis.
z = val_z (float)
Can be used to override the id ordering of characters. Like ids, lower values are drawn behind higher values.
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharScaleSet

Set character scale.

Required parameters:
ID = identifier (int)
Identifier for character.
Optional parameters:
x = val_x (float)
Scale on x-axis.
y = val_y (float)
Scale on y-axis.
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharSetAngle

Set character rotation.

Required parameters:
ID = identifier (int)
Identifier for character.
angle = angle (float)
Angle used for the rotation in degrees.
Optional parameters:
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharSetColor

Set character color tint.

Required parameters:
ID = identifier (int)
Identifier for character.
color = r, g, b (float, float, float)
Color tint to use with character.
Optional parameters:
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharSetFacing

Set character scale.

Required parameters:
ID = identifier (int)
Identifier for character.
facing = direction (int)
1 to set facing right, -1 to set facing left, 0 for no change.
Optional parameters:
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharSetOpacity

Set character opacity.

Required parameters:
ID = identifier (int)
Identifier for character.
opacity = alpha (float)
Set opacity of character.
Optional parameters:
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CharStagePosSet

Set character position in stage coordinates.

Required parameters:
ID = identifier (int)
Identifier for character.
Optional parameters:
x = val_x (float)
Position to set on x-axis.
y = val_y (float)
Position to set on y-axis.
target = target_value (string)
Can be used to change characters in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

CreateAnim

Create animation. Uses sprite/animation files from header info. Z-order is based on ids, higher ids are drawn in front of lower ids.

Required parameters:
ID = identifier (int)
Identifier for animation used in other state controllers. Higher ids are drawn in front of lower ids.
anim = action_no (int)
Action number to play.
Optional parameters:
loop = bvalue (boolean)
If 0 remove after animation has finished. Defaults to 1.
pos = off_x, off_y (float, float)
Position to place animation. Default to 0 when omitted.
stage = bvalue (boolean)
If set to 1, animation is bound to stage and coordinate system used in pos is based on stage coordinate system. Defaults to 0.
shadow = shadow_y (float)
If used, the animation will have a shadow at the y-position given here.
Example:
none

CreateChar

Create character from character files. Basically an animation with its own set of sprites and actions defined in the character files. Z-order is based on ids, higher ids are drawn in front of lower ids. Most character controllers are the same as the anim controllers with the same parameters.

Required parameters:
ID = identifier (int)
Identifier for character used in other state controllers. Higher ids are drawn in front of lower ids.
name = character_name (string)
Character name in chars folder.
anim = action_no (int)
Start action number to play.
Optional parameters:
palette = preferred_palette (int)
Palette to use with the character. Defaults to first palette defined in character definition.
pos = off_x, off_y (float, float)
Position to place character. Default to 0 when omitted.dd>
stage = bvalue (boolean)
If set to 1, character is bound to stage and coordinate system used in pos is based on stage coordinate system. Defaults to 0.
shadow = shadow_y (float)
If used, the character will have a shadow at the y-position given here.
Example:
none

CreateHelper

Create helper that runs state machine concurrently to root state machine. Helpers have their own animations, characters, texts and variables.

Required parameters:
ID = identifier (int)
Identifier used to adress helper in other state controllers.
state = state_no (int)
State to put the helper in.
Optional parameters:
none
Example:
none

CreateText

Create story text with optional text box, face sprite, continue animation and name text. If the text component is not empty, the text will be displayed and visible until the text has completely appeared and the player presses the advance button.

Required parameters:
ID = identifier (int)
Identifier for text used in other state controllers.
Optional parameters:
pos = off_x, off_y (float, float)
Base position to place text element. Default to 0 when omitted.
text.offset = off_x, off_y (float, float)
Offset for main text to be drawn.
text.scale = scale (float)
Scaling value for text. Default is 1.
text.snd = snd_grp, snd_item (int, int)
Optional sound to play while typewriter effect is active.
text.snd.freq = freq (int)
Frequency in frames how often the optional typewriter sound effect is played. Defaults to 7.
bg.anim = action_no (int)
Action number of background behind text. Use either this or bg.spr. When neither is set no background is drawn.
bg.spr = group, item (int, int)
Sprite element of background behind text. Use either this or bg.anim. When neither is set no background is drawn.
bg.offset = off_x, off_y (float, float)
Offset for background to be drawn.
bg.scale = scale_x, scale_y (float, float)
Scaling values for bg. Default is 1.
face.anim = action_no (int)
Action number of face. Use either this or face.spr. When neither is set no face is drawn.
face.spr = group, item (int, int)
Sprite element of face. Use either this or face.anim. When neither is set no face is drawn.
face.offset = off_x, off_y (float, float)
Offset for face to be drawn.
face.scale = scale_x, scale_y (float, float)
Scaling values for face. Default is 1.
continue.anim = action_no (int)
Action number of continue text anim. Use either this or continue.spr. When neither is set no continue anim is drawn.
continue.spr = group, item (int, int)
Sprite element of continue. Use either this or continue.anim. When neither is set no continue is drawn.
continue.offset = off_x, off_y (float, float)
Offset for continue to be drawn.
continue.scale = scale_x, scale_y (float, float)
Scaling values for continue. Default is 1.
continue.snd = snd_grp, snd_item (int, int)
Optional sound to play when text is finished and when typewriter effect is skipped.
name = name_text (string)
Name text to draw alongside regular text.
name.font = font_index, color, alignment (int, int, int)
Font used to draw name. See original documentation for more info on the font format.
name.offset = off_x, off_y (float, float)
Offset for name to be drawn.
name.scale = scale (float)
Scaling value for name text. Default is 1.
text = text (string)
Main text to display. Defaults to empty string when omitted.
font = font_index, color, alignment (int, int, int)
Font used to draw main text. See original documentation for more info on the font format.
width = width (int)
Size after which text wraps and starts the word on a new line. Defaults to no wrapping.
buildup = bvalue (boolean)
If set to 1, text appears on the screen letter by letter, typewriter style. Defaults to 1.
nextstate = state_no (int)
If this parameter is set, the statemachine will change to the specified state after the text has disappeared.
Example:
none

DestroySelf

Call from helper to destroy helper. Also removes all animations and texts belonging to the helper.

Required parameters:
none
Optional parameters:
none
Example:
none

EndStoryboard

End storyboard and go to story step set in value.

Required parameters:
value = story_state (int)
Story step to go to.
Optional parameters:
none
Example:
none

FadeIn

Fade in effect.

Required parameters:
duration = ticks (int)
Time to play fade in from total black to total transparency.
Optional parameters:
color = r, g, b (float, float, float)
Fade color, defaults to black (0,0,0).
Example:
none

FadeOut

Fade in effect.

Required parameters:
duration = ticks (int)
Time to play fade in from total black to total transparency.
Optional parameters:
color = r, g, b (float, float, float)
Fade color, defaults to black (0,0,0).
Example:
none

GlobalVarAdd

Same as VarAdd controller, but for global variables that are shared between storyboards/fights.

GlobalVarSet

Same as VarSet controller, but for global variables that are shared between storyboards/fights.

GoToIntro

Ends storyboard and goes to intro storyboard if it exists. Otherwise go to title.

Required parameters:
none
Optional parameters:
none
Example:
none

GoToStoryStep

End storyboard and go to specified step in story definition.

Required parameters:
value = story_state (int)
Story step to go to.
Optional parameters:
none
Example:
none

GoToTitle

End storyboard and go to title.

Required parameters:
none
Optional parameters:
none
Example:
none

LockText

Lock text to character so that text updates its position in relation to character automatically. Useful for speech bubbles etc.

Required parameters:
ID = text_identifier (int)
Identifier for text that is supposed to be locked to the character.
character = character_identifier, character_location (int, int)
Identifier for character the text is locked to. The second parameter is optional and can be used to adress characters in helpers, in that case character_location is the helper id.
offset = off_x, off_y (float, float)
Offset in relation to character to lock the text at.
Optional parameters:
None
Example:
none

MoveStage

Move stage if stage is set.

Required parameters:
None
Optional parameters:
x = val_x (float)
Movement on x-axis.
y = val_y (float)
Movement on y-axis.
Example:
none

NameID

This state controller can be used to define an alias for an integer identifier. So if you link "Sagat" with 10, you can use Sagat instead of 10 in id parameters. You can recover the numerical value with the nameid(string_value) array trigger. You don't have to use this state controller, but referring to things by name and not by numbers can make life easier.

Required parameters:
ID = identifier (int)
Numerical identifier to set an alias for.
name = alias (string)
String to use as an alias for an identifier.
Optional parameters:
none
Example:
none

Null

Same as original M.U.G.E.N controller.

Required parameters:
none
Optional parameters:
none
Example:
none

ParentVarAdd

Same as original M.U.G.E.N controller. Can also add integers to svar string variables, in which case the last character will be increased by the integer value.

ParentVarSet

Same as original M.U.G.E.N controller, but can also set string variables with svar.

PauseMusic

Pause active music.

Required parameters:
none
Optional parameters:
none
Example:
none

PlayMusic

Play music from path. Same rules apply as for music paths in stages.

Required parameters:
path = path_string (string)
Path to music file.
Optional parameters:
none
Example:
none

PlaySnd

Same as original M.U.G.E.N controller, except that only abspan is supported.

RemoveAnim

Remove animation with id.

Required parameters:
ID = identifier (int)
Identifier for animation defined in CreateAnim.
Optional parameters:
none
Example:
none

RemoveChar

Remove character with id.

Required parameters:
ID = identifier (int)
Identifier for character defined in CreateChar.
Optional parameters:
none
Example:
none

RemoveHelper

Remove helper with id from root.

Required parameters:
ID = identifier (int)
Helper id set in CreateHelper.
Optional parameters:
none
Example:
none

RemoveText

Remove text with id.

Required parameters:
ID = identifier (int)
Identifier for text defined in CreateText.
Optional parameters:
none
Example:
none

ResumeMusic

Resume active music.

Required parameters:
none
Optional parameters:
none
Example:
none

SndPan

Same as original M.U.G.E.N controller, except that only abspan is supported.

StopMusic

Stop active music.

Required parameters:
none
Optional parameters:
none
Example:
none

StopSnd

Same as original M.U.G.E.N controller.

TextPosAdd

Add to base position of text element.

Required parameters:
ID = identifier (int)
Text element identifier.
Optional parameters:
x = val_x (float)
Position to add to x-axis.
y = val_y (float)
Position to add to y-axis.
target = target_value (string)
Can be used to change texts in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

TextPosSet

Set base position of text element.

Required parameters:
ID = identifier (int)
Text element identifier.
Optional parameters:
x = val_x (float)
Position to set on x-axis.
y = val_y (float)
Position to set on y-axis.
target = target_value (string)
Can be used to change texts in helpers (set target_value to helper id) or from helpers in root (set target_value to root).
Example:
none

VarAdd

Same as original M.U.G.E.N controller. Can also add integers to svar string variables, in which case the last character will be increased by the integer value.

VarSet

Same as original M.U.G.E.N controller, but can also set string variables with svar.