general-purpose

Methods

(inner) advanced_random(…chances)

Description:
  • Implementation of advanced random trigger
Source:
Parameters:
Name Type Attributes Description
chances array <repeatable>
Chances of each group being called (e.g. [[group(1), 10], [group(2), 10]] is a valid input)

(inner) camera_edge(id, edge)

Description:
  • Makes one of the camera's edges a specific target object
Source:
Parameters:
Name Type Description
id group Group ID of target object
edge edge Defines the edge to set (LEFT_EDGE, RIGHT_EDGE, UP_EDGE, DOWN_EDGE)

(inner) camera_mode(free_modeopt, disable_grid_snapopt, edit_camopt, easingopt, paddingopt)

Description:
  • Toggles free mode
Source:
Parameters:
Name Type Attributes Default Description
free_mode boolean <optional>
true Whether to toggle free mode on or off
disable_grid_snap boolean <optional>
false Removes default snapping to nearest grid space for the camera center
edit_cam boolean <optional>
false Whether to edit camera settings
easing number <optional>
10 Easing for camera movement (requires edit_cam to be true)
padding number <optional>
0.50 Padding for camera movement (requires edit_cam to be true)

(inner) camera_offset(x, y, durationopt)

Description:
  • Offsets the camera by a position
Source:
Parameters:
Name Type Attributes Default Description
x number X offset of camera
y number X offset of camera
duration number <optional>
0 Duration that it takes for camera position to change

(inner) camera_rotate(degrees, move_timeopt, easingopt, addopt, snap360opt)

Description:
  • Rotates camera
Source:
Parameters:
Name Type Attributes Default Description
degrees number How many degrees to rotate camera by
move_time number <optional>
0 How fast rotation happens
easing easing <optional>
NONE How smooth rotation happens
add boolean <optional>
false Adds input rotation to current camera rotation
snap360 boolean <optional>
false Converts rotation to closest 360

(inner) camera_static(group, durationopt, easingopt, exit_instantopt, exit_staticopt, smooth_velopt, smooth_vel_modopt, followopt, x_onlyopt, x_onlyopt)

Description:
  • Makes the camera static around a target object (group ID)
Source:
Parameters:
Name Type Attributes Default Description
group group Group storing object to be the center of camera
duration number <optional>
0 Duration that it takes for camera to be centered around object
easing easing <optional>
NONE How smoothly the camera moves to the object
exit_instant boolean <optional>
false Stops static instantly
exit_static boolean <optional>
false Stops static
smooth_vel boolean <optional>
false Makes transition to target adapt to current camera velocity (no easing recommended)
smooth_vel_mod number <optional>
0 Modifier for smooth velocity
follow boolean <optional>
false Makes camera change according to object movement
x_only boolean <optional>
false Makes the camera only be static on X axis
x_only boolean <optional>
false Makes the camera only be static on Y axis

(inner) camera_zoom(zoom_amount, durationopt, easingopt)

Description:
  • Makes the camera zoom in/out by a specific amount
Source:
Parameters:
Name Type Attributes Default Description
zoom_amount number Amount to zoom the camera in by
duration number <optional>
0 How long it takes for camera to zoom in
easing easing <optional>
NONE How smoothly the camera zooms in

(inner) color_trigger(channel, r, g, b, durationopt, opacityopt, blendingopt) → {object}

Description:
  • Creates color trigger
Source:
Parameters:
Name Type Attributes Default Description
channel color Color channel to set
r number Red value in RGB to set
g number Green value in RGB to set
b number Blue value in RGB to set
duration number <optional>
0 Duration that it takes for color to change
opacity number <optional>
1 Opacity of color (1 = visible, 0 = invisible)
blending boolean <optional>
false Whether to blend color with others
Returns:
Resulting color trigger
Type
object

(inner) end(instant_end, no_effects, no_sfx, spawn_id, target_pos)

Description:
  • Ends level
Source:
Parameters:
Name Type Default Description
instant_end boolean false Whether to end level instantly
no_effects boolean false Whether to remove effects
no_sfx boolean false Whether to remove SFX
spawn_id group Group to spawn on end
target_pos group Object defining end position

(inner) gradient(color1, color2, bl, br, tl, tr, vertex_modeopt, blendingopt, layeropt) → {object}

Description:
  • Creates a gradient trigger and returns it
Source:
Parameters:
Name Type Attributes Default Description
color1 color First color of gradient
color2 color Second color of gradient
bl group Bottom left vertex
br group Bottom right vertex
tl group Top left vertex
tr group Top right vertex
vertex_mode boolean <optional>
true Whether to use vertex mode
blending boolean <optional>
false Whether to make the gradient blending
layer number <optional>
0 Layer of gradient (0-15)
Returns:
Resulting gradient trigger
Type
object

(inner) gravity(gravity, p1, p2, pt)

Description:
  • Implementation of gravity trigger
Source:
Parameters:
Name Type Description
gravity number Gravity magnitude
p1 boolean Only affect player 1
p2 boolean Only affect player 2
pt boolean Only affect player that touches trigger

(inner) hide_player()

Description:
  • Hides player
Source:

(inner) move_trigger(id, x, Y) → {object}

Description:
  • Adds a move trigger and returns it
Source:
Parameters:
Name Type Description
id group Group ID of target object
x number X amount of how much to move the object by
Y number Y amount of how much to move the object by
Returns:
Returned object
Type
object

(inner) options() → {options}

Description:
  • Implementation of options trigger
Source:
Returns:
Options trigger
Type
options

(inner) particle_system(props, use_obj_coloropt, animate_on_triggeropt, animate_active_onlyopt, quick_startopt) → {object}

Description:
  • Creates a particle system
Source:
Parameters:
Name Type Attributes Default Description
props dictionary Dictionary holding particle properties (check Particles for more info)
use_obj_color boolean <optional>
false Whether to make the particle system use the object color
animate_on_trigger boolean <optional>
false Whether to only start the particle system when the Animate trigger is used on the particle system instead of immediately
animate_active_only boolean <optional>
false Only makes animate_on_trigger true if the object is active
quick_start boolean <optional>
false Makes normal movement be achieved instantly instead of gradually
Returns:
Returned particle system
Type
object

(inner) player_control(p1, p2, stop_jump, stop_move, stop_rot, stop_slide)

Description:
  • Implementation of player control trigger
Source:
Parameters:
Name Type Default Description
p1 boolean false Only controls P1
p2 boolean false Only controls P2
stop_jump boolean false Stops player from jumping
stop_move boolean false Stops player from moving
stop_rot boolean false Stops player from rotating
stop_slide boolean false Stops player from sliding

(inner) random(gr1, gr2, chance)

Description:
  • Implementation of random trigger
Source:
Parameters:
Name Type Description
gr1 group Group 1
gr2 group Group 2
chance number Chance of either group being called

(inner) song(song_id, loopopt, preloadopt, channelopt, volumeopt, speedopt, startopt, endopt, fadeinopt, fadeoutopt) → {song}

Description:
  • Implementation of song trigger in GD
Source:
Parameters:
Name Type Attributes Default Description
song_id number ID of song in-game
loop boolean <optional>
false Whether to loop the song
preload boolean <optional>
true Whether to preload the song first before playing
channel number <optional>
0 What channel to put the song on
volume number <optional>
1 Volume of song
speed number <optional>
0 Speed of song
start number <optional>
0 Where the song should start in MS
end number <optional>
0 Where the song should end in MS
fadein number <optional>
0 When to fade the song in
fadeout number <optional>
0 When to fade the song out
Returns:
Type
song

(inner) spawn_particle(particle_group, pos_group, offset_x, offset_y, scale, scale_var, rotation, rotation_var, offvar_x, offvar_y, match_rot)

Description:
  • Implementation of Spawn Particle trigger
Source:
Parameters:
Name Type Default Description
particle_group group Group ID of particle system
pos_group group Target location to spawn trigger system in
offset_x number 0 How much to to offset the particle system from the target on the X axis
offset_y number 0 How much to to offset the particle system from the target on the Y axis
scale number 1 Scale of particle system
scale_var number 0 Value to randomly add or decrease to scale
rotation number 0 How many angles the system is rotated by
rotation_var number 0 Value to randomly add or decrease to rotation
offvar_x number 0 Area to randomly spawn particles in on X axis
offvar_y number 0 Area to randomly spawn particles in on Y axis
match_rot boolean false Makes the rotation of several particles match

(inner) teleport(id)

Description:
  • Teleports the player to a specific target object
Source:
Parameters:
Name Type Description
id group Group ID of target object

(inner) timewarp(value)

Description:
  • Warps all time by given amount
Source:
Parameters:
Name Type Description
value number How much to warp time by

(inner) toggle_off_trigger(group) → {object}

Description:
  • Returns an inactive toggle trigger
Source:
Parameters:
Name Type Description
group group Group of object
Returns:
Resulting object
Type
object

(inner) toggle_on_trigger(group) → {object}

Description:
  • Returns an activated toggle trigger
Source:
Parameters:
Name Type Description
group group Group of object
Returns:
Resulting object
Type
object

Type Definitions

edit(new_volume, new_speed, duration, stop, stop_loop, gid_1, gid_2, vol_near, vol_med, vol_far, min_dist, dist_2, dist_3, p1, p2, cam, vol_dir)

Description:
  • Implementation of Edit Song trigger
Source:
Parameters:
Name Type Description
new_volume number
new_speed number
duration number
stop boolean
stop_loop boolean
gid_1 group
gid_2 group
vol_near number
vol_med number
vol_far number
min_dist number
dist_2 number
dist_3 number
p1 boolean
p2 boolean
cam boolean
vol_dir 0

options

Description:
  • Represents an options trigger
Source:
Properties:
Name Type Description
STREAK_ADDITIVE function Streak additive (arg = boolean, optional)
HIDE_GROUND function Hide ground (arg = boolean, optional)
HIDE_MG function Hide middle ground (arg = boolean, optional)
HIDE_P1 function Hide player 1 (arg = boolean, optional)
HIDE_P2 function Hide player 2 (arg = boolean, optional)
DISABLE_CONTROLS_P1 function Disable player 1 controls (arg = boolean, optional)
DISABLE_CONTROLS_P2 function Disable player 2 controls (arg = boolean, optional)
UNLINK_DUAL_GRAVITY function Unlink dual gravity (arg = boolean, optional)
HIDE_ATTEMPTS function Hide attempts (arg = boolean, optional)
AUDIO_ON_DEATH function Audio on death (arg = boolean, optional)
NO_DEATH_SFX function No death SFX (arg = boolean, optional)
RESPAWN_TIME function Respawn time (arg = number, required)
add function Adds options trigger
Represents an options trigger
Type:
  • object

song

Description:
  • Represents a song trigger in GD
Source:
Properties:
Name Type Description
start start_song Starts song
edit edit Edit Song trigger implementation
stop stop Stops playing the song
Represents a song trigger in GD
Type:
  • object

start_song()

Description:
  • Starts playing the song
Source:

stop()

Description:
  • Stops song
Source: