Wikia

Touhou Wiki

Touhou Danmakufu: Stage Script Functions

7,297pages on
this wiki
Talk0

Functions for stage scripts.


Stage Control Functions

Functions to control the stage.

CreateEnemyFromScript

Create an enemy which behavior is defined in the script.

6 Parameters
    1) child enemy script's name (string)
    2) x-coordinate
    3) y-coordinate
    4) velocity
    5) direction
    6) user-defined argument

CreateEnemyFromFile

Create an enemy which behavior is defined in the file. Plural-script files can not be passed. When the enemy is going to be boss character, use CreateEnemyBossFromFile function.

6 Parameters
    1) path of the enemy script (string)
    2) x-coordinate
    3) y-coordinate
    4) velocity
    5) direction
    6) user-defined argument

CreateEnemyBossFromFile

Create a boss character which behavior is defined in the file. Plural-script files can be passed. The health bar, the timer, and the enemy marker are shown (enemy marker can be hidden). When there is already another boss character, this function is ignored.

6 Parameters
    1) path of the enemy script (string)
    2) x-coordinate
    3) y-coordinate
    4) velocity
    5) direction
    6) user-defined argument

CompileEnemyFromFile

Compile the enemy script file into the corresponding bytecode format. This function accelerates the subsequent CreateEnemyFromFile call.

1 Parameter
    1) path of the enemy script (string)

ClearByteCodeCash

Clear all the cached bytecodes. This function can be performed only when there are no enemies.

CreateEventFromScript

Start the talk event.

1 Parameter
    1) path of the  event script (string)

ClearStage

Let the game cleared. This function must be called at the end of the stage script.

IsClear

Get whether cleared or not.

Return value
    true : cleared
    false: not cleared (on playing or all the lives are lost)

Expert

Disable continue and the debug keys.

ExpertEx

Configure some settings.

3 Parameters
    1) whether debug keys are enabled or not
        true : enable
        false: disable
    2) allowed times to continue
    3) player's lives

ExtendPlayer

Extend the player's lives. Negative values are allowed. This function cannot be run in @Initialize

1 Parameter
    1) extra player's lives

SetClearFrameEffectEnable

Enables or disables the zoom out on the playfield after clearing the stage.

1 Parameter
    1) whether the playfield is zoomed or not when clearing the stage.
        true: zoomout and shrink (default)
        false: no zoomout


SuperNaturalBorder

Spread out the super natural border.

1 Parameter
    1) frames

Retry

End the stage script and restart it.


Drawing Functions

Functions to draw graphics for stage scripts only.

DrawGraphic3D

Draw the graphic in the world coordinate system. This function is often used with SetGraphicAngle.

3 Parameters
    1) x-coordinate
    2) y-coordinate
    3) z-coordinate

SetViewTo

Set the focus of the camera.

3 Parameters
    1) x-coordinate (default is 0)
    2) y-coordinate (default is 0)
    3) z-coordinate (default is 0)

SetViewFrom

Set the position of the camera.

3 Parameters
    1) distance between focus and camera (default is 500)
    2) azimuthal angle (angle of direction) (default is 90)
    3) angle of elevation (default is 45)

SetPerspectiveClip

Set the clipping distance. Objects which are nearer than 1) and farther than 2) are not drawn.

2 Parameters
    1) near clipping distance (default is 10)
    2) far clipping distance (default is 1500)

WriteZBuffer

Set whether the Z-buffer is writable or not.

1 Parameter
    1) writability of the Z-buffer
        true : writable
        false: read only (default)

UseZBuffer

Set whether the Z-buffer is enabled or not.

1 Parameter
    1) whether the Z-buffer is enabled or not
        true : enable
        false: disable (default)

SetFog

Generate fog. Since the fog is cleaned each frame, this function must be called every frame, if you want to keep the fog.

5 Parameters
    1) start point (distance from camera)
    2) end point (distance from camera)
    3) red (0 ~ 255)
    4) green (0 ~ 255)
    5) blue (0 ~ 255)

Around Wikia's network

Random Wiki