Wikia

Touhou Wiki

Touhou Danmakufu: Object Control Functions

7,297pages on
this wiki
Talk0

Functions for bullet objects, laser objects, and effect objects.


Common Object Functions

Functions to control any kinds of the objects.

Obj_Create

Create an object. All the object functions except this use object IDs returned this function to control the object.

1 Parameter
    1) type
        OBJ_SHOT         : bullet
        OBJ_LASER        : laser
        OBJ_SINUATE_LASER: A curving laser
        OBJ_EFFECT       : effect
        OBJ_SPELL        : player's spell card attack
Return value
    object ID

Obj_Delete

Delete the object.

1 Parameter
    1) object ID

Obj_BeDeleted

Get whether the object is deleted or not.

1 Parameter
    1) object ID
Return value
    true : deleted
    false: existing

Obj_SetX

Set the x-coordinate of the object.

2 Parameters
    1) object ID
    2) x-coordinate

Obj_SetY

Set the y-coordinate of the object.

2 Parameters
    1) object ID
    2) y-coordinate

Obj_SetPosition

Set the position of the object.

3 Parameters
    1) object ID
    2) x-coordinate
    3) y-coordinate

Obj_SetSpeed

Set the velocity of the object.

2 Parameters
    1) object ID
    2) velocity

Obj_SetAngle

Set the direction angle of the object.

2 Parameters
    1) object ID
    2) direction angle

Obj_SetAutoDelete

Set whether the object is automatically deleted out of the game field or not.

2 Parameters
    1) object ID
    2) auto-delete setting
        true : auto-deleted (default)
        false: not auto-deleted

Obj_SetAlpha

Set the alpha value of the object graphic.

2 Parameters
    1) object ID
    2) alpha value (0 ~ 255)

Obj_SetCollisionToPlayer

Set whether the collision detection with player's character is performed or not.

2 Parameters
    1) object ID
    2) collision detection setting
        true : performed
        false: not performed

Obj_SetCollisionToObject

Set whether the collision detection with other objects is performed or not. The collision detection can be performed by Collision_Obj_Obj.

2 Parameters
    1) object ID
    2) collision detection setting
        true : performed
        false: not performed

Obj_IsIntersected

Get whether the object is intersected with the target of attack.

1 Parameter
    1) object ID
Return value
    true : intersected
    false: apart from target

Obj_GetX

Get the x-coordinate of the object.

1 Parameter
    1) object ID
Return value
    x-coordinate

Obj_GetY

Get the y-coordinate of the object.

1 Parameter
    1) object ID
Return value
    y-coordinate

Obj_GetSpeed

Get the velocity of the object.

1 Parameter
    1) object ID
Return value
    velocity

Obj_GetAngle

Get the direction angle of the object.

1 Parameter
    1) object ID
Return value
    direction angle

Object Shot Functions

Functions to control bullet objects and laser objects. These functions are ignored when the object is neither a bullet nor a laser.

ObjShot_FadeDelete

Delete the object with fading. No collision detection is performed during fading.

1 Parameter
    1) object ID

ObjShot_SetDelay

Set the delay frames of the object. The object is fired after the frames.

2 Parameters
    1) object ID
    2) delay frames

ObjShot_SetBombResist

Set whether the object is vanished by bomb or not.

2 Parameters
    1) object ID
    2) resistance property
        true : resist
        false: vanished

ObjShot_SetGraphic

Set the graphic of the object.

2 Parameters
    1) object ID
    2) graphic

ObjShot_SetDamage

Set the offensive power of the object. For player's bullets only.

2 Parameters
    1) object ID
    2) damage point (before multiplying the damage rate)

ObjShot_SetPenetration

Set the penetration of the object. For player's bullets only.

2 Parameters
    1) object ID
    2) penetration (default is 1)
       The object is deleted after attack this times.

Object Curving Laser Functions

Functions to control curving lasers. These functions are ignored when the object is not a curving laser created by OBJ_SINUATE_LASER.

ObjSinuateLaser_SetWidth

Set the width of the sinuate laser.

2 Parameters
    1) object ID
    1) width

ObjSinuateLaser_SetLength

Set the length of the sinuate laser. Be careful, as too long sinuate lasers will drop your framerate severely.

2 Parameters
    1) object ID
    1) length

Laser Object Functions

Functions to control laser objects. These functions are ignored when the object is not a laser.

ObjLaser_SetLength

Set the length of the laser object.

2 Parameters
    1) object ID
    2) length

ObjLaser_SetWidth

Set the width of the laser object.

2 Parameters
    1) object ID
    2) width

ObjLaser_SetSource

Set whether the light source of the laser object is drawn or not.

2 Parameters
    1) object ID
    2) source setting
        true : drawn
        false: not drawn

ObjLaser_GetEndX

Get the x-coordinate of the termination of the laser object.

1 Parameter
    1) object ID
Return value
    x-coordinate

ObjLaser_GetEndY

Get the y-coordinate of the termination of the laser object.

1 Parameter
    1) object ID
Return value
    y-coordinate

ObjLaser_GetLength

Get the length of the laser object.

1 Parameter
    1) object ID
Return value
    length

ObjLaser_GetWidth

Get the width of the laser object.

1 Parameter
    1) object ID
Return value
    width


Effect Object Function

Functions to control effect objects and spell card attack objects. The effect objects are used to dress up the danmaku. These functions are ignored when the object is neither an effect object nor a spell card attack object.

The vertices of the polygons are directly treated.

ObjEffect_SetTexture

Set the texture to the object. This function must be called before creating the vertices.

2 Parameters
    1) object ID
    2) path of the graphic (string)

ObjEffect_SetRenderState

Set the render type of the object.

2 Parameters
    1) object ID
    2) render type
        ALPHA   : alpha blend
        ADD     : additive blend
        MULTIPLY: multiplicative blend
        SUBTRACT: subtractive blend

ObjEffect_SetPrimitiveType

Set the primitive type of the object.

2 Parameters
    1) object ID
    2) primitive type
        PRIMITIVE_TRIANGLELIST : share no vertices
        PRIMITIVE_TRIANGLESTRIP: share the last two vertices
        PRIMITIVE_TRIANGLEFAN  : share the first and the last vertices

ObjEffect_SetScale

Set the scale of the object.

3 Parameters
    1) object ID
    2) x-scale
    3) y-scale

ObjEffect_SetAngle

Set the rotation angle of the object.

4 Parameters
    1) object ID
    2) x-angle
    3) y-angle
    4) z-angle

ObjEffect_SetLayer

Set the layer (z-coordinate) where the object is drawn.

2 Parameters
    1) object ID
    2) layer (0 ~ 8)
        0: background
        1: between background and enemies
        2: enemies
        3: player's character (default)
        4: items
        5: bullets
        6: talking character
        7: foreground
        8: frame

ObjEffect_CreateVertex

Create vertices of the object.

2 Parameters
    1) object ID
    2) number of vertices

ObjEffect_SetVertexXY

Set the coordinates of the object. The coordinates is that before translation, scaling, and rotation.

4 Parameters
    1) object ID
    2) vertex index
    3) x-coordinate
    4) y-coordinate

ObjEffect_SetVertexColor

Set the vertex color of the object.

6 Parameters
    1) object ID
    2) vertex index
    3) alpha value (0 ~ 255)
    4) red (0 ~ 255)
    5) green (0 ~ 255)
    6) blue (0 ~ 255)

ObjEffect_SetVertexUV

Set the coordinates in the infinitely paved texture corresponding to the vertex of the object.

4 Parameters
    1) object ID
    2) vertex index
    3) x-coordinate (not U value)
    4) y-coordinate (not V value)

Spell Card Attack Object Functions

Functions to control spell card attack objects.These functions are ignored when the object is not a spell card attack object.

ObjSpell_SetIntersecrionCircle

Set the collision detection circle of the object. The object attacks the enemies in the circle.

6 Parameters
    1) object ID
    2) x-coordinate
    3) y-coordinate
    4) radius
    5) damage per frame (before multiplying the damage rate)
    6) whether it can vanish the bullets of the enemies or not
        true : vanish
        false: not vanish

ObjSpell_SetIntersecrionLine

Set the collision detection line of the object. The object attacks the enemies on the line.

8 Parameters
    1) object ID
    2) x-coordinate (one edge)
    3) y-coordinate (one edge)
    4) x-coordinate (another edge)
    5) y-coordinate (another edge)
    6) width
    7) damage per frame (before multiplying the damage rate)
    8) whether it can vanish the bullets of the enemies or not
        true : vanish
        false: not vanish

Around Wikia's network

Random Wiki