This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
scripting_reference [2020/09/27 00:04] – justin | scripting_reference [2024/02/28 10:35] – justin | ||
---|---|---|---|
Line 1: | Line 1: | ||
======Scripting Reference====== | ======Scripting Reference====== | ||
---- | ---- | ||
- | =====Action | + | =====Global Variables===== |
- | Action | + | ^Variable^Description^Data Type^ |
+ | |global.theme|Current UI [[theme_editor|theme]]. Can be used to retrieve or modify the [[theme_editor|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]]| | ||
+ | |||
+ | =====Map Variables===== | ||
+ | ^Variable^Description^Data Type^ | ||
+ | |map.name|Name of the current [[map]].|[[String]]| | ||
+ | |map.groups|List of [[groups]] defined for the current [[map]].|[[Array]]| | ||
+ | |||
+ | =====Camera Variables===== | ||
+ | ^Variable^Description^Data Type^ | ||
+ | |camera.direction|Direction in which the camera is currently facing (nearest [[cardinal direction]], | ||
+ | |camera.type|Current camera type (STANDARD, ISOMETRIC, or FIRST_PERSON).|Camera Type| | ||
+ | |||
+ | =====Party Variables===== | ||
+ | ^Variable^Description^Data Type^ | ||
+ | |party.member[" | ||
+ | |party|[[Codex]] containing all members of the player' | ||
+ | |||
+ | =====System Variables===== | ||
+ | ^Variable^Description^Data Type^ | ||
+ | |system.time|Current system time as a [[codex]] containing key/value pairs for " | ||
+ | |||
+ | =====Utility Functions===== | ||
+ | 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(// | ||
+ | |str(// | ||
+ | |num(// | ||
+ | |len(// | ||
+ | |substr(// | ||
+ | |range(// | ||
+ | |inverse(// | ||
+ | |duplicate(// | ||
+ | |clamp(// | ||
+ | |round(// | ||
+ | |mod(//x//, // | ||
+ | |pow(//x//, // | ||
+ | |sqrt(// | ||
+ | |abs(// | ||
+ | |floor(// | ||
+ | |ceil(// | ||
+ | |||
+ | =====Event | ||
+ | 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^ | ^Name^Signature^ | ||
- | |[[add_character|Add Character]]|**add_character**(// | + | |[[add_character|Add Character]]|**add_character**(// |
- | |[[add_item_to_container|Add Item To Container]]|**add_item_to_container**(// | + | |[[add_effect|Add Effect]]|**add_effect**(// |
- | |[[add_object|Add Object]]|**add_object**(// | + | |[[add_item_to_container|Add Item To Container]]|**add_item_to_container**(// |
+ | |[[add_item_to_tile|Add Item To Tile]]|**add_item_to_tile**(// | ||
+ | |[[add_object|Add Object]]|**add_object**(// | ||
|[[add_party_member|Add Party Member]]|**add_party_member**(// | |[[add_party_member|Add Party Member]]|**add_party_member**(// | ||
- | |[[add_tile|Add Tile]]|**add_tile**(// | + | |[[add_tile|Add Tile]]|**add_tile**(// |
|[[add_to_group|Add To Group]]|**add_to_group**(// | |[[add_to_group|Add To Group]]|**add_to_group**(// | ||
|[[add_waypoint|Add Waypoint]]|**add_waypoint**(// | |[[add_waypoint|Add Waypoint]]|**add_waypoint**(// | ||
+ | |[[add_zone|Add Zone]]|**add_zone**(// | ||
+ | |[[apply_camera_preset|Apply Camera Preset]]|**apply_camera_preset**(// | ||
+ | |[[apply_lighting_preset|Apply Lighting Preset]]|**apply_lighting_preset**(// | ||
+ | |[[apply_status_effect|Apply Status Effect]]|**apply_status_effect**(// | ||
|[[assign_entity_id|Assign Entity ID]]|**assign_entity_id**(// | |[[assign_entity_id|Assign Entity ID]]|**assign_entity_id**(// | ||
- | |[[attach_object|Attach Object]]|**attach_object**(// | + | |[[attach_effect|Attach Effect]]|**attach_effect**(// |
+ | |[[attach_object|Attach Object]]|**attach_object**(// | ||
+ | |[[change_camera|Change Camera]]|**change_camera**(// | ||
+ | |[[change_player|Change Player]]|**change_player**(// | ||
+ | |[[clear_log|Clear Log]]|**clear_log**()| | ||
+ | |[[clear_status_effects|Clear Status Effects]]|**clear_status_effects**(// | ||
+ | |[[complete_quest|Complete Quest]]|**complete_quest**(// | ||
|[[create_platform|Create Platform]]|**create_platform**(// | |[[create_platform|Create Platform]]|**create_platform**(// | ||
|[[damage_entity|Damage Entity]]|**damage_entity**(// | |[[damage_entity|Damage Entity]]|**damage_entity**(// | ||
- | |[[detach_object|Detach Object]]|**detach_object**(// | + | |[[decrease_stat|Decrease Stat]]|**decrease_stat**(// |
+ | |[[delete_data|Delete Data]]|**delete_data**(// | ||
+ | |[[delete_save|Delete Save]]|**delete_save**(// | ||
+ | |[[detach_effect|Detach Effect]]|**detach_effect**(// | ||
+ | |[[detach_object|Detach Object]]|**detach_object**(// | ||
|[[disable_container|Disable Container]]|**disable_container**(// | |[[disable_container|Disable Container]]|**disable_container**(// | ||
- | |[[display_message|Display Message]]|**display_message**(// | + | |[[disable_conveyor|Disable Conveyor]]|**disable_conveyor**(// |
+ | |[[disable_effect|Disable Effect]]|**disable_effect**(// | ||
+ | |[[disable_screen_effect|Disable Screen Effect]]|**disable_screen_effect**(// | ||
+ | |[[disable_turret|Disable Turret]]|**disable_turret**(// | ||
+ | |[[disable_zone|Disable Zone]]|**disable_zone**(// | ||
+ | |[[display_choices|Display Choices]]|**display_choices**(// | ||
+ | |[[display_image|Display Image]]|**display_image**(// | ||
+ | |[[display_message|Display Message]]|**display_message**(// | ||
|[[enable_container|Enable Container]]|**enable_container**(// | |[[enable_container|Enable Container]]|**enable_container**(// | ||
+ | |[[enable_conveyor|Enable Conveyor]]|**enable_conveyor**(// | ||
+ | |[[enable_effect|Enable Effect]]|**enable_effect**(// | ||
+ | |[[enable_screen_effect|Enable Screen Effect]]|**enable_screen_effect**(// | ||
+ | |[[enable_turret|Enable Turret]]|**enable_turret**(// | ||
+ | |[[enable_zone|Enable Zone]]|**enable_zone**(// | ||
|[[end_battle|End Battle]]|**end_battle**(// | |[[end_battle|End Battle]]|**end_battle**(// | ||
- | |[[equip_item|Equip Item]]|**equip_item**(// | + | |[[equip_item|Equip Item]]|**equip_item**(// |
- | |[[execute_script|Execute Script]]|**execute_script**(// | + | |[[execute_script|Execute Script]]|**execute_script**(// |
|[[fade_in|Fade In]]|**fade_in**(// | |[[fade_in|Fade In]]|**fade_in**(// | ||
|[[fade_out|Fade Out]]|**fade_out**(// | |[[fade_out|Fade Out]]|**fade_out**(// | ||
- | |[[give_item|Give Item]]|**give_item**(// | + | |[[fail_quest|Fail Quest]]|**fail_quest**(// |
+ | |[[fire_projectile|Fire Projectile]]|**fire_projectile**(// | ||
+ | |[[get_noise_2d|Get Noise 2D]]|**get_noise_2d**(// | ||
+ | |[[get_noise_3d|Get Noise 3D]]|**get_noise_3d**(// | ||
+ | |[[give_item|Give Item]]|**give_item**(// | ||
+ | |[[give_loot|Give Loot]]|**give_loot**(// | ||
+ | |[[give_quest|Give Quest]]|**give_quest**(// | ||
+ | |[[give_skill|Give Skill]]|**give_skill**(// | ||
|[[heal_entity|Heal Entity]]|**heal_entity**(// | |[[heal_entity|Heal Entity]]|**heal_entity**(// | ||
|[[hide_group|Hide Group]]|**hide_group**(// | |[[hide_group|Hide Group]]|**hide_group**(// | ||
|[[hide_inventory|Hide Inventory]]|**hide_inventory**()| | |[[hide_inventory|Hide Inventory]]|**hide_inventory**()| | ||
|[[hide_toolbar|Hide Toolbar]]|**hide_toolbar**()| | |[[hide_toolbar|Hide Toolbar]]|**hide_toolbar**()| | ||
- | |[[load_map|Load Map]]|**load_map**(// | + | |[[hide_widget|Hide Widget]]|**hide_widget**(// |
+ | |[[increase_stat|Increase Stat]]|**increase_stat**(// | ||
+ | |[[load_data|Load Data]]|**load_data**(// | ||
+ | |[[load_game|Load Game]]|**load_game**(// | ||
+ | |[[load_map|Load Map]]|**load_map**(// | ||
|[[lock_camera|Lock Camera]]|**lock_camera**()| | |[[lock_camera|Lock Camera]]|**lock_camera**()| | ||
|[[set_player_interaction_locked|Lock/ | |[[set_player_interaction_locked|Lock/ | ||
Line 37: | Line 127: | ||
|[[look_at_target_over_time|Look At Target Over Time]]|**look_at_target_over_time**(// | |[[look_at_target_over_time|Look At Target Over Time]]|**look_at_target_over_time**(// | ||
|[[modify_navigation|Modify Navigation]]|**modify_navigation**(// | |[[modify_navigation|Modify Navigation]]|**modify_navigation**(// | ||
- | |[[move_camera|Move Camera]]|**move_camera**(// | + | |[[move_camera|Move Camera]]|**move_camera**(// |
- | |[[move_camera_at_speed|Move Camera At Speed]]|**move_camera_at_speed**(// | + | |[[move_camera_at_speed|Move Camera At Speed]]|**move_camera_at_speed**(// |
- | |[[move_camera_over_time|Move Camera Over Time]]|**move_camera_over_time**(// | + | |[[move_camera_over_time|Move Camera Over Time]]|**move_camera_over_time**(// |
- | |[[move_character|Move Character]]|**move_character**(// | + | |[[move_character|Move Character]]|**move_character**(// |
+ | |[[move_platform|Move Platform]]|**move_platform**(// | ||
|[[move_player|Move Player]]|**move_player**(// | |[[move_player|Move Player]]|**move_player**(// | ||
- | |[[move_platform|Move Platform]]|**move_platform**(//tile//, //waypoint_name//, //pause//)| | + | |[[open_container|Open Container]]|**open_container**(//entity//)| |
+ | |[[override_action|Override Action]]|**override_action**(//action_id_to_override//, //override_with//)| | ||
|[[override_animation|Override Animation]]|**override_animation**(// | |[[override_animation|Override Animation]]|**override_animation**(// | ||
+ | |[[perform_action|Perform Action]]|**perform_action**(// | ||
|[[play_animation|Play Animation]]|**play_animation**(// | |[[play_animation|Play Animation]]|**play_animation**(// | ||
|[[play_group_animation|Play Group Animation]]|**play_group_animation**(// | |[[play_group_animation|Play Group Animation]]|**play_group_animation**(// | ||
- | |[[play_music|Play Music]]|**play_music**(// | + | |[[play_music|Play Music]]|**play_music**(// |
- | |[[play_sound|Play Sound]]|**play_sound**(// | + | |[[play_sound|Play Sound]]|**play_sound**(// |
+ | |[[play_video|Play Video]]|**play_video**(// | ||
|[[print|Print]]|**print**(// | |[[print|Print]]|**print**(// | ||
- | |[[put_entity|Put Entity]]|**put_entity**(// | + | |[[put_entity|Put Entity]]|**put_entity**(// |
- | |[[put_player|Put Player]]|**put_player**(// | + | |[[put_player|Put Player]]|**put_player**(// |
|[[remove_entity|Remove Entity]]|**remove_entity**(// | |[[remove_entity|Remove Entity]]|**remove_entity**(// | ||
|[[remove_from_group|Remove From Group]]|**remove_from_group**(// | |[[remove_from_group|Remove From Group]]|**remove_from_group**(// | ||
- | |[[remove_item|Remove Item]]|**remove_item**(// | + | |[[remove_item|Remove Item]]|**remove_item**(// |
+ | |[[remove_item_from_container|Remove Item From Container]]|**remove_item_from_container**(// | ||
|[[remove_party_member|Remove Party Member]]|**remove_party_member**(// | |[[remove_party_member|Remove Party Member]]|**remove_party_member**(// | ||
+ | |[[remove_skill|Remove Skill]]|**remove_skill**(// | ||
+ | |[[remove_status_effect|Remove Status Effect]]|**remove_status_effect**(// | ||
+ | |[[remove_zone|Remove Zone]]|**remove_zone**(// | ||
|[[replace_navigation|Replace Navigation]]|**replace_navigation**(// | |[[replace_navigation|Replace Navigation]]|**replace_navigation**(// | ||
+ | |[[request_coordinate|Request Coordinate]]|**request_coordinate**(// | ||
+ | |[[request_entity|Request Entity]]|**request_entity**(// | ||
+ | |[[reset_action|Reset Action]]|**reset_action**(// | ||
|[[reset_camera|Reset Camera]]|**reset_camera**()| | |[[reset_camera|Reset Camera]]|**reset_camera**()| | ||
|[[reset_camera_at_speed|Reset Camera At Speed]]|**reset_camera_at_speed**(// | |[[reset_camera_at_speed|Reset Camera At Speed]]|**reset_camera_at_speed**(// | ||
|[[reset_camera_over_time|Reset Camera Over Time]]|**reset_camera_over_time**(// | |[[reset_camera_over_time|Reset Camera Over Time]]|**reset_camera_over_time**(// | ||
- | |[[reset_entity_rotation|Reset Entity Rotation]]|**reset_entity_rotation**(// | + | |[[reset_entity_rotation|Reset Entity Rotation]]|**reset_entity_rotation**(// |
|[[reset_map|Reset Map]]|**reset_map**(// | |[[reset_map|Reset Map]]|**reset_map**(// | ||
|[[restart_game|Restart Game]]|**restart_game**()| | |[[restart_game|Restart Game]]|**restart_game**()| | ||
Line 66: | Line 167: | ||
|[[rotate_camera|Rotate Camera]]|**rotate_camera**(// | |[[rotate_camera|Rotate Camera]]|**rotate_camera**(// | ||
|[[rotate_camera_over_time|Rotate Camera Over Time]]|**rotate_camera_over_time**(// | |[[rotate_camera_over_time|Rotate Camera Over Time]]|**rotate_camera_over_time**(// | ||
- | |[[rotate_entity_towards|Rotate Entity Towards]]|**rotate_entity_towards**(// | + | |[[rotate_entity_towards|Rotate Entity Towards]]|**rotate_entity_towards**(// |
|[[rotate_player_to_direction|Rotate Player To Direction]]|**rotate_player_to_direction**(// | |[[rotate_player_to_direction|Rotate Player To Direction]]|**rotate_player_to_direction**(// | ||
- | |[[set_ambient_light_color|Set Ambient Light Color]]|**set_ambient_light_color**(// | + | |[[save_data|Save Data]]|**save_data**(// |
+ | |[[save_game|Save Game]]|**save_game**(// | ||
+ | |[[set_ambient_light_color|Set Ambient Light Color]]|**set_ambient_light_color**(// | ||
|[[set_ambient_light_enabled|Set Ambient Light Enabled]]|**set_ambient_light_enabled**(// | |[[set_ambient_light_enabled|Set Ambient Light Enabled]]|**set_ambient_light_enabled**(// | ||
+ | |[[set_ambient_light_intensity|Set Ambient Light Intensity]]|**set_ambient_light_intensity**(// | ||
|[[set_animation_speed|Set Animation Speed]]|**set_animation_speed**(// | |[[set_animation_speed|Set Animation Speed]]|**set_animation_speed**(// | ||
|[[set_character_name|Set Character Name]]|**set_character_name**(// | |[[set_character_name|Set Character Name]]|**set_character_name**(// | ||
+ | |[[set_conveyor_reversed|Set Conveyor Reversed]]|**set_conveyor_reversed**(// | ||
+ | |[[set_conveyor_speed|Set Conveyor Speed]]|**set_conveyor_speed**(// | ||
|[[set_dialogue|Set Dialogue]]|**set_dialogue**(// | |[[set_dialogue|Set Dialogue]]|**set_dialogue**(// | ||
- | |[[set_directional_light_color|Set Directional Light Color]]|**set_directional_light_color**(// | + | |[[set_directional_light_color|Set Directional Light Color]]|**set_directional_light_color**(// |
|[[set_directional_light_enabled|Set Directional Light Enabled]]|**set_directional_light_enabled**(// | |[[set_directional_light_enabled|Set Directional Light Enabled]]|**set_directional_light_enabled**(// | ||
+ | |[[set_directional_light_intensity|Set Directional Light Intensity]]|**set_directional_light_intensity**(// | ||
|[[set_entity_blocks_sight|Set Entity Blocks Sight]]|**set_entity_blocks_sight**(// | |[[set_entity_blocks_sight|Set Entity Blocks Sight]]|**set_entity_blocks_sight**(// | ||
- | |[[set_entity_light_attenuation|Set Entity Light Attenuation]]|**set_entity_light_attenuation**(// | + | |[[set_entity_direction|Set Entity Direction]]|**set_entity_direction**(// |
- | |[[set_entity_light_color|Set Entity Light Color]]|**set_entity_light_color**(// | + | |[[set_entity_light_attenuation|Set Entity Light Attenuation]]|**set_entity_light_attenuation**(// |
- | |[[set_entity_light_diameter|Set Entity Light Diameter]]|**set_entity_light_diameter**(// | + | |[[set_entity_light_color|Set Entity Light Color]]|**set_entity_light_color**(// |
+ | |[[set_entity_light_diameter|Set Entity Light Diameter]]|**set_entity_light_diameter**(// | ||
|[[set_entity_light_enabled|Set Entity Light Enabled]]|**set_entity_light_enabled**(// | |[[set_entity_light_enabled|Set Entity Light Enabled]]|**set_entity_light_enabled**(// | ||
- | |[[set_entity_light_intensity|Set Entity Light Intensity]]|**set_entity_light_intensity**(// | + | |[[set_entity_light_intensity|Set Entity Light Intensity]]|**set_entity_light_intensity**(// |
|[[set_entity_model|Set Entity Model]]|**set_entity_model**(// | |[[set_entity_model|Set Entity Model]]|**set_entity_model**(// | ||
+ | |[[set_entity_offset|Set Entity Offset]]|**set_entity_offset**(// | ||
|[[set_entity_property|Set Entity Property]]|**set_entity_property**(// | |[[set_entity_property|Set Entity Property]]|**set_entity_property**(// | ||
- | |[[set_entity_script|Set Entity Script]]|**set_entity_script**(// | + | |[[set_entity_rotation|Set Entity Rotation]]|**set_entity_rotation**(// |
+ | |[[set_entity_scale|Set Entity Scale]]|**set_entity_scale**(// | ||
+ | |[[set_entity_script|Set Entity Script]]|**set_entity_script**(// | ||
+ | |[[set_entity_texture|Set Entity Texture]]|**set_entity_texture**(// | ||
|[[set_entity_tooltip|Set Entity Tooltip]]|**set_entity_tooltip**(// | |[[set_entity_tooltip|Set Entity Tooltip]]|**set_entity_tooltip**(// | ||
+ | |[[set_gameplay_property|Set Gameplay Property]]|**set_gameplay_property**(// | ||
|[[set_global_property|Set Global Property]]|**set_global_property**(// | |[[set_global_property|Set Global Property]]|**set_global_property**(// | ||
- | |[[set_group_light_color|Set Group Light Color]]|**set_group_light_color**(// | + | |[[set_group_light_color|Set Group Light Color]]|**set_group_light_color**(// |
|[[set_group_light_enabled|Set Group Light Enabled]]|**set_group_light_enabled**(// | |[[set_group_light_enabled|Set Group Light Enabled]]|**set_group_light_enabled**(// | ||
|[[set_language|Set Language]]|**set_language**(// | |[[set_language|Set Language]]|**set_language**(// | ||
|[[set_movement_speed|Set Movement Speed]]|**set_movement_speed**(// | |[[set_movement_speed|Set Movement Speed]]|**set_movement_speed**(// | ||
+ | |[[set_screen_effect_property|Set Screen Effect Property]]|**set_screen_effect_property**(// | ||
+ | |[[set_stat|Set Stat]]|**set_stat**(// | ||
+ | |[[set_terrain_types|Set Terrain Types]]|**set_terrain_types**(// | ||
|[[set_vision_height|Set Vision Height]]|**set_vision_height**(// | |[[set_vision_height|Set Vision Height]]|**set_vision_height**(// | ||
+ | |[[set_zone_script|Set Zone Script]]|**set_zone_script**(// | ||
|[[show_credits|Show Credits]]|**show_credits**()| | |[[show_credits|Show Credits]]|**show_credits**()| | ||
|[[show_group|Show Group]]|**show_group**(// | |[[show_group|Show Group]]|**show_group**(// | ||
|[[show_inventory|Show Inventory]]|**show_inventory**()| | |[[show_inventory|Show Inventory]]|**show_inventory**()| | ||
|[[show_toolbar|Show Toolbar]]|**show_toolbar**()| | |[[show_toolbar|Show Toolbar]]|**show_toolbar**()| | ||
+ | |[[show_widget|Show Widget]]|**show_widget**(// | ||
|[[start_battle|Start Battle]]|**start_battle**(// | |[[start_battle|Start Battle]]|**start_battle**(// | ||
|[[start_dialogue|Start Dialogue]]|**start_dialogue**(// | |[[start_dialogue|Start Dialogue]]|**start_dialogue**(// | ||
+ | |[[stop_animation|Stop Animation]]|**stop_animation**(// | ||
+ | |[[stop_music|Stop Music]]|**stop_music**(// | ||
|[[stop_player|Stop Player]]|**stop_player**()| | |[[stop_player|Stop Player]]|**stop_player**()| | ||
- | |[[unequip_item|Unequip Item]]|*unequip_item**(// | + | |[[stop_sound|Stop Sound]]|**stop_sound**(// |
+ | |[[unequip_item|Unequip Item]]|**unequip_item**(// | ||
+ | |[[use_item|Use Item]]|**use_item**(// | ||
+ | |[[use_skill|Use Skill]]|**use_skill**(// | ||
|[[wait|Wait]]|**wait**(// | |[[wait|Wait]]|**wait**(// | ||
+ | |||
+ | ~~NOTOC~~ | ||