— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
Variable | Description | Data Type |
---|---|---|
global.theme | Current UI theme. Can be used to retrieve or modify the theme. | String |
global.gameplay | Gameplay settings. Can be used to retrieve the gameplay settings as defined in your Game Configuration. | Codex |
global.time | Current game time (value will be between 0 and the configured day/night duration in seconds). | Number |
global.gravity | Current gravity used by free movement maps. Can be used to retrieve or modify the gravity. | Number |
global.random_seed | Seed value for random number generation (must be an integer). | Number |
global.noise_seed | Seed value for Get Noise 2D and Get Noise 3D scripting functions (must be an integer). | Number |
Variable | Description | Data Type |
---|---|---|
camera.direction | Direction in which the camera is currently facing (nearest cardinal direction, either NORTH, SOUTH, WEST, or EAST). | Cardinal Direction |
camera.type | Current camera type (STANDARD, ISOMETRIC, or FIRST_PERSON). | Camera Type |
camera.view_model | Current view model entity for the camera. Can be used to retrieve or modify the view model. | Entity |
Variable | Description | Data Type |
---|---|---|
party.member[“x”] | Character in the player's party, where “x” is the character's member ID as assigned via the Add Party Member function. The primary player character can be referenced using a member ID of “player”. | Entity |
party | Codex containing all members of the player's party. It will contain a key for each member ID, with each corresponding value a reference to the character. This can also be used as shorthand for “party.member”, e.g. party[“member_id”] is equivalent to party.member[“member_id”]. | Codex |
Parameters marked with an asterisk (*) are optional. If an optional parameter is passed to a function, any preceding optional parameters must also be included.
Signature | Description |
---|---|
random(min, max) | Returns a random number between the specified minimum and maximum value (inclusive). Both values should be integers. Random numbers can also be generated using D&D dice notation, e.g. 2d6 will roll two six-sided dice and add the resulting numbers together. |
str(value) | Converts the given value to a string. |
num(value) | Converts the given value to a number. |
len(value) | Returns the number of characters in a string, the number of elements in an array, or the number of keys in a codex. |
substr(string, start_position, *length) | Returns a substring of a string. The “length” parameter can be omitted to include all characters from the start position until the end of the string. |
range(min, *max, *step) | Returns an array of integers based on the supplied parameters. See “Range” section of Script Syntax for examples. |
inverse(value) | Returns the inverse of the specified value. Supported data types are number, boolean, array, coordinate, color, cardinal direction, and navigation type. See “Inverse” section of Script Syntax for examples. |
duplicate(value) | Duplicates an array or codex to create a unique copy of the data. |
clamp(value, min, max) | Returns a numeric value clamped to the specified range. The result will be no less than the minimum value and no more than the maximum value. |
round(x) | Rounds x to the nearest whole number. |
mod(x, y) | Gives the remainder of x divided by y. |
pow(x, y) | Gives the result of x raised to the power of y. |
sqrt(x) | Gives the square root of x. |
abs(x) | Gives the absolute value of x. |
floor(x) | Rounds x downwards to the nearest whole number. |
ceil(x) | Rounds x upwards to the nearest whole number. |
Event functions are used to trigger certain actions or events in your game, such as loading a map, playing an animation, or healing a character. These functions allow you to control the flow of your game and help give life to its world! Click on a function name for more details around its usage.
Parameters marked with an asterisk (*) are optional. If an optional parameter is passed to a function, any preceding optional parameters must also be included.
Name | Signature |
---|---|
Add Character | add_character(model_name, tile, *entity_id) |
Add Effect | add_effect(effect_name, coordinate, *entity_id) |
Add Item To Container | add_item_to_container(entity, item_id, *count) |
Add Item To Tile | add_item_to_tile(tile, item_id, *count) |
Add Object | add_object(model_name, tile, *entity_id) |
Add Party Member | add_party_member(model_name, member_id) |
Add Tile | add_tile(model_name, coordinate, *entity_id) |
Add To Group | add_to_group(entity, group_name) |
Add Waypoint | add_waypoint(tile, waypoint_name, waypoint_coordinate) |
Add Zone | add_zone(zone_name, passable, position, size_x, size_y, size_z) |
Apply Camera Preset | apply_camera_preset(preset_name) |
Apply Lighting Preset | apply_lighting_preset(preset_name, *duration) |
Apply Status Effect | apply_status_effect(status_effect_id, character, *duration) |
Assign Entity ID | assign_entity_id(entity, entity_id) |
Attach Effect | attach_effect(effect_name, target_entity, attach_id) |
Attach Object | attach_object(model_name, target_entity, attach_id, *target_attach_id) |
Change Camera | change_camera(camera_type) |
Change Player | change_player(character) |
Clear Log | clear_log() |
Clear Status Effects | clear_status_effects(character) |
Complete Quest | complete_quest(quest_id) |
Create Platform | create_platform(tile, speed) |
Damage Entity | damage_entity(entity, damage_amount) |
Decrease Stat | decrease_stat(stat_id, amount, *character) |
Delete Data | delete_data(filename) |
Delete Save | delete_save(*filename) |
Detach Effect | detach_effect(entity, attach_id) |
Detach Object | detach_object(entity, attach_id) |
Disable Action | disable_action(action_id) |
Disable Container | disable_container(entity_id) |
Disable Conveyor | disable_conveyor(conveyor_group) |
Disable Effect | disable_effect(entity) |
Disable Screen Effect | disable_screen_effect(*duration) |
Disable Turret | disable_turret(entity) |
Disable Zone | disable_zone(zone_name) |
Display Choices | display_choices(message_text, choices, *speaker) |
Display Image | display_image(image_name, *duration, *bg_color, *stretch_mode) |
Display Message | display_message(message_text, *speaker) |
Enable Action | enable_action(action_id) |
Enable Container | enable_container(entity_id) |
Enable Conveyor | enable_conveyor(conveyor_group) |
Enable Effect | enable_effect(entity) |
Enable Screen Effect | enable_screen_effect(*duration) |
Enable Turret | enable_turret(entity) |
Enable Zone | enable_zone(zone_name) |
End Battle | end_battle(victory) |
Equip Item | equip_item(character, slot_id, item_id, *count) |
Execute Script | execute_script(script_name, *pause) |
Fade In | fade_in(duration) |
Fade Out | fade_out(duration) |
Fail Quest | fail_quest(quest_id) |
Fire Projectile | fire_projectile(item_id, source, *target, *entity_id) |
Get Noise 2D | get_noise_2d(x, y) |
Get Noise 3D | get_noise_3d(x, y, z) |
Give Currency | give_currency(amount, *stat_id, *character) |
Give Item | give_item(item_id, *count, *character) |
Give Loot | give_loot(loot_name, *count, *character) |
Give Quest | give_quest(quest_id) |
Give Skill | give_skill(skill_id, *character) |
Heal Entity | heal_entity(entity, heal_amount) |
Hide Group | hide_group(group_name) |
Hide Inventory | hide_inventory() |
Hide Toolbar | hide_toolbar() |
Hide Widget | hide_widget(widget_id, *fade_out_length) |
Increase Stat | increase_stat(stat_id, amount, *character) |
Load Data | load_data(filename, *password) |
Load Game | load_game(*filename) |
Load Map | load_map(map_name, player_coord, *player_direction) |
Lock Camera | lock_camera() |
Lock/Unlock Player Interaction | set_player_interaction_locked(is_locked) |
Lock/Unlock Player Movement | set_player_movement_locked(is_locked) |
Log Message | log_message(message) |
Look At Target | look_at_target(target) |
Look At Target Over Time | look_at_target_over_time(target, duration) |
Modify Navigation | modify_navigation(first_tile_id, second_tile_id, navigation_type) |
Move Camera | move_camera(destination, *look_at_target) |
Move Camera At Speed | move_camera_at_speed(destination, speed, *look_at_target) |
Move Camera Over Time | move_camera_over_time(destination, duration, *look_at_target) |
Move Character | move_character(character, tile, *pause) |
Move Platform | move_platform(tile, waypoint_name, *pause) |
Move Player | move_player(tile) |
Open Container | open_container(entity) |
Override Action | override_action(action_id_to_override, override_with) |
Override Animation | override_animation(entity, anim_to_override, override_with) |
Perform Action | perform_action(action_id, *pressed) |
Play Animation | play_animation(entity, animation_name) |
Play Group Animation | play_group_animation(group_name, animation_name) |
Play Music | play_music(music_name, *fade_in_length, *loop) |
Play Sound | play_sound(sound_name, *loop, *interval) |
Play Video | play_video(video_name) |
print(data) | |
Put Entity | put_entity(entity, target_tile) |
Put Player | put_player(target_tile, *direction) |
Remove Currency | remove_currency(amount, *stat_id, *character) |
Remove Entity | remove_entity(entity) |
Remove From Group | remove_from_group(entity, group_name) |
Remove Item | remove_item(item_id, *count, *character) |
Remove Item From Container | remove_item_from_container(entity, item_id, *count) |
Remove Party Member | remove_party_member(member_id) |
Remove Skill | remove_skill(skill_id, *character) |
Remove Status Effect | remove_status_effect(status_effect_id, character) |
Remove Zone | remove_zone(zone_name) |
Replace Navigation | replace_navigation(entity, navigation_type, new_navigation_type) |
Request Coordinate | request_coordinate(start_z, min_z, max_z, step_z, *validation_func) |
Request Entity | request_entity(*validation_func) |
Reset Action | reset_action(action_id) |
Reset Camera | reset_camera() |
Reset Camera At Speed | reset_camera_at_speed(speed) |
Reset Camera Over Time | reset_camera_over_time(duration) |
Reset Entity Rotation | reset_entity_rotation(entity, *duration) |
Reset Map | reset_map(map_name) |
Restart Game | restart_game() |
Restore Party Member | restore_party_member(member_id) |
Revive Character | revive_character(character, heal_amount) |
Rotate Camera | rotate_camera(horizontal_angle, vertical_angle) |
Rotate Camera Over Time | rotate_camera_over_time(horizontal_angle, vertical_angle, duration) |
Rotate Entity Towards | rotate_entity_towards(entity, target_entity, also_rotate_target, *duration) |
Rotate Player To Direction | rotate_player_to_direction(direction) |
Save Data | save_data(data, filename, *password) |
Save Game | save_game(*filename) |
Set Ambient Light Color | set_ambient_light_color(color, *duration) |
Set Ambient Light Enabled | set_ambient_light_enabled(enabled) |
Set Ambient Light Intensity | set_ambient_light_intensity(intensity, *duration) |
Set Animation Speed | set_animation_speed(entity, animation_name, speed) |
Set Character Name | set_character_name(entity_id, name) |
Set Conveyor Reversed | set_conveyor_reversed(conveyor_group, is_reversed, *reverse_anim_dir) |
Set Conveyor Speed | set_conveyor_speed(conveyor_group, speed, *change_anim_speed) |
Set Dialogue | set_dialogue(entity_id, dialogue_name) |
Set Directional Light Color | set_directional_light_color(color, *duration) |
Set Directional Light Enabled | set_directional_light_enabled(enabled) |
Set Directional Light Intensity | set_directional_light_intensity(intensity, *duration) |
Set Entity Blocks Sight | set_entity_blocks_sight(entity, blocks_sight) |
Set Entity Direction | set_entity_direction(entity, direction) |
Set Entity Light Attenuation | set_entity_light_attenuation(entity, attenuation, *duration) |
Set Entity Light Color | set_entity_light_color(entity, color, *duration) |
Set Entity Light Diameter | set_entity_light_diameter(entity, diameter, *duration) |
Set Entity Light Enabled | set_entity_light_enabled(entity, enabled) |
Set Entity Light Intensity | set_entity_light_intensity(entity, intensity, *duration) |
Set Entity Model | set_entity_model(entity, model_name) |
Set Entity Offset | set_entity_offset(entity, x, y, z, *duration) |
Set Entity Property | set_entity_property(entity, property_name, property_value) |
Set Entity Rotation | set_entity_rotation(entity, x, y, z, *duration) |
Set Entity Scale | set_entity_scale(entity, x_scale, y_scale, z_scale, *duration) |
Set Entity Script | set_entity_script(entity, script_name, *script_trigger, *triggerable_by_npc) |
Set Entity Texture | set_entity_texture(entity, texture_name) |
Set Entity Tooltip | set_entity_tooltip(entity, tooltip_text) |
Set Gameplay Property | set_gameplay_property(property_name, property_value) |
Set Global Property | set_global_property(property_name, property_value) |
Set Group Light Color | set_group_light_color(group_name, color, *duration) |
Set Group Light Enabled | set_group_light_enabled(group_name, enabled) |
Set Language | set_language(locale_code) |
Set Movement Speed | set_movement_speed(character, speed) |
Set Screen Effect Property | set_screen_effect_property(property_name, property_value, *duration) |
Set Stat | set_stat(stat_id, value, *character) |
Set Terrain Types | set_terrain_types(entity, terrain_mode, *terrain_types) |
Set Vision Height | set_vision_height(character, height) |
Set Zone Script | set_zone_script(zone_name, script_name, script_trigger) |
Shake Screen | shake_screen(duration) |
Show Credits | show_credits() |
Show Group | show_group(group_name) |
Show Inventory | show_inventory() |
Show Toolbar | show_toolbar() |
Show Widget | show_widget(widget_id, *fade_in_length) |
Start Battle | start_battle(battle_name) |
Start Dialogue | start_dialogue(dialogue_name) |
Stop Animation | stop_animation(entity) |
Stop Music | stop_music(*fade_out_length) |
Stop Player | stop_player() |
Stop Sound | stop_sound(sound_id, *fade_out_length) |
Unequip Item | unequip_item(character, slot_id, *count) |
Use Item | use_item(item_id, *character) |
Use Skill | use_skill(skill_id, *character) |
Wait | wait(duration) |