Modding:MainScreen

From SkyCorp Global
Revision as of 04:04, 31 December 2025 by SkyCorp (talk | contribs) (Added documentation for changeToForcedTransformationScene(...))
Jump to navigation Jump to search

Public Methods

static void addGameText(string gameText)

Output string to screen. Does not automatically add newlines.

Unlike io.write, will only accept one string parameter, making it useful to get around the LUFA garbage array bug.

static void continueSceneToMapScene()

Removes screen buttons (but not shown text).  Will display one 'continue' button, which when pressed, will redirect flow back to the map (/ player navigation).  This is a shortcut into the game's scene flow control that handles most cases, but for instance, if you wanted to continue then go to somewhere else, you should bug Skye to expose the full scene control system.

Added in r35

static void changeToForcedTransformationScene(string prefix, Species species, bool allowEscape = true, function switchSceneAfterTransformationSequence = null, function teleportPlayerOnFinish = true, bool resetLustHP = true, function customOutputFunction = null, bool withContinueScene = true)

Using this, you can play the forced transformation sequence scene. This is primarily useful if you are doing a forced transformation sequence that should be triggered from customized monster logic (ex: not normal defeat logic) or triggered from an arbitrary object.

Sample code

Note there are several other methods you may want to consider instead of this:

  • If you just want to cause a single body part to be transformed at a time, see causeTF()
  • If you do want a multi-step tf sequence, and are already triggering this on player defeat to a monster, you probably want to use the normal player defeat logic. This will also check to see if the player is TF'able before trying to TF the player, as well as updating the monster's state to sleep, and inseminating the player if configured. You can trigger this logic on defeat by either
    • Not defining the doMonsterVictory function in the json, or
    • Defining the doMonsterVictory function, but inside your custom function, calling doMonsterVictoryDefault() to do normal logic

If you do want to call this function, then you'll need to define the following text variables:

Text Variable Purpose
<PREFIX>_PLAYER_DEFEAT Initial text shown to player on defeat
<PREFIX>_DEFEAT_TFTIME Text shown every step player is being tf'ed
<PREFIX>_DEFEAT_TFTOTAL Text shown at conclusion of tf
<PREFIX>_DEFEAT_TFESCAPE_SUCCESS Player tried to escape, and did
<PREFIX>_DEFEAT_TFESCAPE_FAILURE Player tried to escape, but failed
<PREFIX>_DEFEAT_TFACCEPT Player did not try to escape / accepted the tf

Function parameters:

string prefix

Defines the <PREFIX> part of the text keys, per the above table.

Species species

Which TF is being done

bool allowEscape = true

If escape is possible. Button will still be shown, but it will be impossible to escape regardless of lust level.

function switchSceneAfterTransformationSequenceScript = null

This can be used to transition to a different scene after the sequence, instead of back to the normal mapscene.

If not null, called to determine logic for switching scene. (If not set, just goes back to mapscene). The bool indicates if the full tf played out (false if the player escaped mid-tf)

(Most users will just leave this as 'null')

function teleportPlayerOnFinish = true

Whether to teleport player to a respawn position after the sequence finishes

bool resetLustHP = true

On full tf: whether to reset lust + hp.

On early escape: whether to reset lust.

function customOutputFunctionScript = null

If set, this function is called with the text key suffix each tf instead of outputting monsterPrefix+suffix text. (Most users will just leave this as 'null')

bool withContinueScene = true

If true, prepends a continue scene prior to switching the scene to the TF sequence scene. (Set true if you already have text on screen player should have a chance to read first)

Added in r56.1