BSL:Functions: Difference between revisions

→‎Native functions: adding all the functions I just realized are missing...
(→‎Native functions: adding missed function chr_display_combat_stats!)
(→‎Native functions: adding all the functions I just realized are missing...)
Line 95: Line 95:


===ai2_===
===ai2_===
'''Commands which have an effect on all AIs:'''
'''Commands which can have an effect on all AIs (see below to use these same commands on one AI):'''


*ai2_allpassive passive:int {0 | 1} - stops all AIs from thinking for themselves - ai2_allpassive 1
*ai2_allpassive passive:int {0 | 1} - stops all AIs from thinking for themselves - ai2_allpassive 1
Line 108: Line 108:
*ai2_chump (null) - creates a chump
*ai2_chump (null) - creates a chump
*ai2_comehere [ai_name:string | script_id:int] - tells an AI to come to the player
*ai2_comehere [ai_name:string | script_id:int] - tells an AI to come to the player
*ai2_debug_makesound [sound_type:string | ] [volume:float | ] - causes the player to make a sound (alerts nearby AIs)
*ai2_doalarm [ai_name:string | script_id:int] [console_id:int] - tells an AI to run for an alarm - ai2_doalarm ambush_commguy_2 4
*ai2_doalarm [ai_name:string | script_id:int] [console_id:int] - tells an AI to run for an alarm - ai2_doalarm ambush_commguy_2 4
''if the AI is passive, ai2_doalarm cannot be executed''
''if the AI is passive, ai2_doalarm cannot be executed''
*ai2_dopath [ai_name:string | script_id:int] path_name:string - tells an AI to run a particular path - ai2_dopath A_E3 patrol_49
*ai2_dopath [ai_name:string | script_id:int] path_name:string - tells an AI to run a particular path - ai2_dopath A_E3 patrol_49
''if the AI is passive, ai2_dopath cannot be executed''
''if the AI is passive, ai2_dopath cannot be executed''
*ai2_findconnections [distance:int | ] - finds all BNV connections from the player's location
*ai2_followme [ai_name:string | script_id:int] - tells an AI to follow the player - ai2_followme s2_t05
*ai2_followme [ai_name:string | script_id:int] - tells an AI to follow the player - ai2_followme s2_t05
*ai2_forget [ai_name:string | script_id:int] [forget_char:string] - makes one or all AIs forget they saw anything - ai2_forget Sec_Ambush_BOL_1
*ai2_forget [ai_name:string | script_id:int] [forget_char:string] - makes one or all AIs forget they saw anything - ai2_forget Sec_Ambush_BOL_1
Line 125: Line 127:
*ai2_makeignoreplayer [ai_name:string | script_id:int] on_off:int{0 | 1} - makes a single AI ignore the player - ai2_makeignoreplayer ParkStriker 1
*ai2_makeignoreplayer [ai_name:string | script_id:int] on_off:int{0 | 1} - makes a single AI ignore the player - ai2_makeignoreplayer ParkStriker 1
*ai2_movetoflag [ai_name:string | script_id:int] flag_id:int [setfacing:string{"setfacing"}] - tells an AI to move to a flag - ai2_movetoflag 0 1091
*ai2_movetoflag [ai_name:string | script_id:int] flag_id:int [setfacing:string{"setfacing"}] - tells an AI to move to a flag - ai2_movetoflag 0 1091
''needs ai2_takecontrol 1 if Konoko should do that''
''needs ai2_takecontrol 1 if Konoko should do that''<br />
 
''ai2_movetoflag will only work if there is a path to that flag''
''ai2_movetoflag will only work if there is a path to that flag''
*ai2_neutralbehavior [ai_name:string | script_id:int] behavior:string - sets up an AI's neutral-interaction - ai2_neutralbehavior neutral_3 none
*ai2_neutralbehavior [ai_name:string | script_id:int] behavior:string - sets up an AI's neutral-interaction - ai2_neutralbehavior neutral_3 none
Line 132: Line 133:
*ai2_panic [ai_name:string | script_id:int] timer:int - makes an AI panic or not panic - ai2_panic A1_s_red02 300
*ai2_panic [ai_name:string | script_id:int] timer:int - makes an AI panic or not panic - ai2_panic A1_s_red02 300
''I've tried ai2_panic A1_s_red02 300 ==> Oni crashed''
''I've tried ai2_panic A1_s_red02 300 ==> Oni crashed''
*ai2_pathdebugsquare x:int y:int - selects a path square in the player's BNV for debugging
*ai2_passive [ai_name:string | script_id:int] passive:int{0 | 1} - stops an AI from thinking for itself - ai2_passive Intro_Striker_4 1
*ai2_passive [ai_name:string | script_id:int] passive:int{0 | 1} - stops an AI from thinking for itself - ai2_passive Intro_Striker_4 1
*ai2_report [ai_name:string | script_id:int | ] - tells an AI to report in
*ai2_report_verbose [ai_name:string | script_id:int | ] - tells an AI to report in verbosely
*ai2_reset [reset_player:int] - resets AI as if start of level - ai2_reset
*ai2_reset [reset_player:int] - resets AI as if start of level - ai2_reset
''It reset consoles, and clears characters like you started the level again''
''resets consoles and clears characters as if you started the level again''
*ai2_set_handlesilenterror handle_silent:bool [subsystem:string | ] - sets whether handled errors are silent
*ai2_set_logerror error_level:string [subsystem:string | ] - sets the level of errors to log to file
*ai2_set_reporterror error_level:string [subsystem:string | ] - sets the level of errors to report at console
*ai2_setalert [ai_name:string | script_id:int] alert:string - sets the alert state of an AI - ai2_setalert Floor2_Striker_2 high (alert strings: lull, low, medium, high, combat)
*ai2_setalert [ai_name:string | script_id:int] alert:string - sets the alert state of an AI - ai2_setalert Floor2_Striker_2 high (alert strings: lull, low, medium, high, combat)
*ai2_setjobstate [ai_name:string | script_id:int] - tells an AI to take its current state as its job - ai2_setjobstate E_Er34
*ai2_setjobstate [ai_name:string | script_id:int] - tells an AI to take its current state as its job - ai2_setjobstate E_Er34
Line 140: Line 147:
*ai2_setmovementmode [ai_name:string | script_id:int] mode:string - sets an AI's current movement mode - ai2_setmovementmode finalam_striker_1 walk  (movement mode strings: creep, walk, walk_noaim, run, run_noaim)
*ai2_setmovementmode [ai_name:string | script_id:int] mode:string - sets an AI's current movement mode - ai2_setmovementmode finalam_striker_1 walk  (movement mode strings: creep, walk, walk_noaim, run, run_noaim)
''needs ai2_takecontrol 1 if Konoko should do that''
''needs ai2_takecontrol 1 if Konoko should do that''
*ai2_showmem - shows AI memory usage
*ai2_skill_bestangle best_angle:float - sets an AI's best aiming angle in degrees
*ai2_skill_decay decay_amount:float - sets an AI's grouping decay
*ai2_skill_delaymax maxdelay:int - sets an AI's max delay between shots, in frames
*ai2_skill_delaymin mindelay:int - sets an AI's min delay between shots, in frames
*ai2_skill_error error_amount:float - sets an AI's grouping error
*ai2_skill_inaccuracy inaccuracy:float - sets an AI's shooting inaccuracy multiplier
*ai2_skill_recoil recoil_compensation:float - sets an AI's recoil compensation amount (0-1)
*ai2_skill_revert - reverts the shooting skill being edited to the saved copy
*ai2_skill_save - saves the shooting skill being edited out as a text file
*ai2_skill_select char_class:string weapon_name:string - selects a shooting skill to edit
*ai2_skill_show - shows the currently selected shooting skill
*ai2_spawn ai_name:string [force_spawn:string{"force"}] - creates and starts an AI from a character object - ai2_spawn ambush_striker_2
*ai2_spawn ai_name:string [force_spawn:string{"force"}] - creates and starts an AI from a character object - ai2_spawn ambush_striker_2
*ai2_tripalarm - alarm_id:int [ai_name:string | script_id:int] - trips an alarm - ai2_tripalarm 2 0
*ai2_tripalarm - alarm_id:int [ai_name:string | script_id:int] - trips an alarm - ai2_tripalarm 2 0
Line 161: Line 180:
*chr_display_combat_stats chr_index:int - displays the characters combat stats
*chr_display_combat_stats chr_index:int - displays the characters combat stats
*chr_dontaim [ai_name:string | script_id:int] on_off:int{0 | 1} - disables the weapon variant for a character
*chr_dontaim [ai_name:string | script_id:int] on_off:int{0 | 1} - disables the weapon variant for a character
*chr_draw_dot - draws a dot at a specified location
*chr_envanim [ai_name:string | script_id:int] anim:string [norotation:string{"norotation"} | ] - plays an environment animation on a character - chr_envanim 111 OutroNinjaBox01 norotation
*chr_envanim [ai_name:string | script_id:int] anim:string [norotation:string{"norotation"} | ] - plays an environment animation on a character - chr_envanim 111 OutroNinjaBox01 norotation
*chr_envanim_block [ai_name:string | script_id:int] anim:string [norotation:string{"norotation"}] - plays an environment animation on a character and blocks - chr_envanim_block 110 OutroNinjaBox01 norotation
*chr_envanim_block [ai_name:string | script_id:int] anim:string [norotation:string{"norotation"}] - plays an environment animation on a character and blocks - chr_envanim_block 110 OutroNinjaBox01 norotation
Line 195: Line 215:
*chr_playback [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film
*chr_playback [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film
*chr_playback_block [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film and blocks until complete
*chr_playback_block [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film and blocks until complete
*chr_playback_debug film_name:string - dumps stats for a playback film
*chr_poison [ai_name:string | script_id:int] damage:int interval:int [initial_interval:int] - slowly poisons a character - chr_poison (konoko, 10, 60, 90);
*chr_poison [ai_name:string | script_id:int] damage:int interval:int [initial_interval:int] - slowly poisons a character - chr_poison (konoko, 10, 60, 90);
''This is intended to be called repeatedly by a trigger volume for a character standing in an area that does continual damage, such as a fire; thus, calling the function once directly from a script will have no effect.''
''This is intended to be called repeatedly by a trigger volume for a character standing in an area that does continual damage, such as a fire; thus, calling the function once directly from a script will have no effect.''
Line 215: Line 236:
*chr_wait_animtype [ai_name:string | script_id:int] [anim_name:string] - waits for a character to play a specific animation type - chr_wait_animtype 0 jump
*chr_wait_animtype [ai_name:string | script_id:int] [anim_name:string] - waits for a character to play a specific animation type - chr_wait_animtype 0 jump
*chr_wait_health [ai_name:string | script_id:int] health_amount:float - waits until a character's health falls below a value - chr_wait_health Muro 200
*chr_wait_health [ai_name:string | script_id:int] health_amount:float - waits until a character's health falls below a value - chr_wait_health Muro 200
* chr_weapon chr_index:int [weapon_name:string | weapon_num:int] - sets the weapon for a give character
*chr_weapon chr_index:int [weapon_name:string | weapon_num:int] - sets the weapon for a give character
*chr_weapon_immune [ai_name:string | script_id:int] - makes a character weapon immune - chr_weapon_immune(vat_bot_1); // chr_weapon_immune 0
*chr_weapon_immune [ai_name:string | script_id:int] - makes a character weapon immune - chr_weapon_immune(vat_bot_1); // chr_weapon_immune 0
*chr_who - lists all the players
*where [ai_name:string | script_id:int | ] - prints location of a character
*who - prints AIs that are nearby


===cinematic_===
===cinematic_===
Line 226: Line 250:
[[image:Cinematic_flags.jpg]]
[[image:Cinematic_flags.jpg]]


===cm_===
===camera===
*cm_anim cam_spec:string{"move" | "look" | "both"} anim_name:string - initiates a camera animation - cm_anim both OutroCam03
*cm_anim cam_spec:string{"move" | "look" | "both"} anim_name:string - initiates a camera animation - cm_anim both OutroCam03
*cm_anim_block cam_spec:string{"move" | "look" | "both"} anim_name:string - initiates a camera animation - cm_anim_block both OutroCam04
*cm_anim_block cam_spec:string{"move" | "look" | "both"} anim_name:string - initiates a camera animation - cm_anim_block both OutroCam04
Line 240: Line 264:
*cm_wait (null) - makes the camera wait until it is no longer busy - cm_wait
*cm_wait (null) - makes the camera wait until it is no longer busy - cm_wait


===console_===
===developer console===
*<span style="color:green">co_show_all - shows all registered variables and commands - co_show_all<span>
*<span style="color:green">co_show_all - shows all registered variables and commands - co_show_all<span>
*console_print - dumps all arguments
*co_toggle_text - cycles console text color
*dump_docs - shows all registered variables and commands
*text_console name:string - turns on the text console display
===console===
*console_activate console_id:int - activates a console - console_activate 14
*console_activate console_id:int - activates a console - console_activate 14
*console_deactivate console_id:int - deactivates a console - console_deactivate 5
*console_deactivate console_id:int - deactivates a console - console_deactivate 5
Line 253: Line 283:
===cutscene===
===cutscene===
*begin_cutscene (null) - begins a cutscene - begin_cutscene
*begin_cutscene (null) - begins a cutscene - begin_cutscene
 
''begin_cutscene weapon - player does not holster his weapon when cutscene starts''<br />
''begin_cutscene weapon - player does not holster his weapon when cutscene starts''<!-- what about ai, animation, invis, jello, keepparticles, nojump, nosync ? -->
''what about ai, animation, invis, jello, keepparticles, nojump, nosync?''
 
*cutscene_sync (null) - marks a point in a cutscene - cutscene_sync on
*cutscene_sync (null) - marks a point in a cutscene - cutscene_sync on
*end_cutscene (null) - ends a cutscene - end_cutscene
*end_cutscene (null) - ends a cutscene - end_cutscene
Line 262: Line 291:
*input on_off:int{0 | 1} - turns input on or off - input 0
*input on_off:int{0 | 1} - turns input on or off - input 0
*letterbox start_stop:int{0 | 1} - starts or stops letterboxing - letterbox 0
*letterbox start_stop:int{0 | 1} - starts or stops letterboxing - letterbox 0
*playback [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film -  Hangar1_A_Striker_1 hangar1_striker1 interp 30
*playback_block [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film and blocks until complete - playback_block Start_Friend_1 roll fromhere // playback_block hangar1f_enemy_2 bomber_jump interp 30


===diary_===
===diary_===
* diary_page_unlock page:int - unlocks a specific diary page on the current level
*diary_page_unlock page:int - unlocks a specific diary page on the current level


===door_===
===door_===
Line 277: Line 304:


===env_===
===env_===
*debug_env_anim name:string - draws a line for an environment animation
*env_anim obj_id:int [ obj_id:int] - initiates an environment animation for an object - env_anim 901 906
*env_anim obj_id:int [ obj_id:int] - initiates an environment animation for an object - env_anim 901 906
*env_anim_block obj_id:int [ obj_id:int] - initiates an environment animation: blocks until completed
*env_anim_block obj_id:int [ obj_id:int] - initiates an environment animation: blocks until completed
Line 286: Line 314:
*env_texswap gq_start:int tex_name:string - swaps an environment texture - env_texswap 401 PIPE_YELLOW
*env_texswap gq_start:int tex_name:string - swaps an environment texture - env_texswap 401 PIPE_YELLOW
''tested in level 19 save point 4''
''tested in level 19 save point 4''
   
 
===game===
===film===
*chr_playback [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film
*chr_playback_block [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film and blocks until complete
*chr_playback_debug film_name:string - dumps stats for a playback film
*playback [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film - Hangar1_A_Striker_1 hangar1_striker1 interp 30
*playback_block [ai_name:string | script_id:int] film_name:string [mode:string{"fromhere" | "interp"}] [num_frames:int] - plays back a film and blocks until complete - playback_block Start_Friend_1 roll fromhere // playback_block hangar1f_enemy_2 bomber_jump interp 30
*playback_debug film_name:string - dumps stats for a playback film
*sc_focus chr_index:int - sets which character we're authoring for a film
 
===game (miscellaneous)===
*chr_has_empty_weapon [ai_name:string | script_id:int] - returns if this character is holding a weapon that is empty - chr_has_empty_weapon(char_0)
*chr_has_empty_weapon [ai_name:string | script_id:int] - returns if this character is holding a weapon that is empty - chr_has_empty_weapon(char_0)
*chr_has_lsi [ai_name:string | script_id:int] - records that the character has the lsi - chr_has_lsi(0)
*chr_has_lsi [ai_name:string | script_id:int] - records that the character has the lsi - chr_has_lsi(0)
*chr_is_player [ai_name:string | script_id:int] - returns if this character is the player - chr_is_player(character)
*chr_is_player [ai_name:string | script_id:int] - returns if this character is the player - chr_is_player(character)
*crash when:string{"now"} - crashes the game (used for testing error handling)
*did_kill_griffen (null) - returns if we did kill griffen - did_kill_griffen()
*did_kill_griffen (null) - returns if we did kill griffen - did_kill_griffen()
*difficulty (null) - returns the difficulty level
*difficulty (null) - returns the difficulty level
*flag_view_prefix prefix:string - view flags with a specific prefix
*hang when:string{"now"} - hangs the game (used for testing error handling)
*killed_griffen murder:bool - sets if we killed griffen - killed_griffen 1
*killed_griffen murder:bool - sets if we killed griffen - killed_griffen 1
*lose (null) - lose this level - lose
*lose (null) - lose this level - lose
*p3_removedangerous (null) - removes all "dangerous projectile" particles by making their lifetime expire - p3_removedangerous
*perf_prefix - sets the perf prefix
*ph_status - xxx
''the "ph" is for physics''
*print_state state:int - prints an anim state
*print_type type:int - prints an anim type
*restore_game (null) - restores the game - restore_game
*restore_game (null) - restores the game - restore_game
*save_game save_point:int [type:string{"autosave"}] - saves the game - save_game 1 autosave
*save_game save_point:int [type:string{"autosave"}] - saves the game - save_game 1 autosave
*splash_screen texture:string - displays a splash screen - splash_screen warehouse_splash_screen
*splash_screen texture:string - displays a splash screen - splash_screen warehouse_splash_screen
*tr_stop_lookup - bla bla bla
*tr_write_animation anim_name:string file_name:string - bla bla bla
*tr_write_collection collection_name:string file_name:string - bla bla bla
*tr_write_lookup file_name:string - bla bla bla
*win (null) - win this level - win
*win (null) - win this level - win


Line 306: Line 354:
*gs_farclipplane_set plane:float - sets the far clipping plane - gs_farclipplane_set 5000
*gs_farclipplane_set plane:float - sets the far clipping plane - gs_farclipplane_set 5000
*gs_fov_set fov_degrees:float - sets the field of view - gs_fov_set 300
*gs_fov_set fov_degrees:float - sets the field of view - gs_fov_set 300
*m3_display_list - lists all the display modes
*m3_display_set device_index:int mode_index:int - sets the active display mode
*m3_draw_engine_list - lists all the engines
*m3_engine_set geom_engine:int draw_engine:int - sets the active engine
*m3_geom_engine_list - lists all the engines
*m3_quality_set quality:string - sets the current graphics quality


===input===
===input===
Line 316: Line 370:
*dmsg astring:string - debugging message - dmsg [b. hello]
*dmsg astring:string - debugging message - dmsg [b. hello]
''[b. hello] ==> b stands for blue, it's the colour of the word hello [.hello] ==> without a character in front of the point, the colour of the word is white. Available colours: b (blue), c (cyan), g (green), l (lila), o (orange), r (red), u (umber), y (yellow)''
''[b. hello] ==> b stands for blue, it's the colour of the word hello [.hello] ==> without a character in front of the point, the colour of the word is white. Available colours: b (blue), c (cyan), g (green), l (lila), o (orange), r (red), u (umber), y (yellow)''
*dprint astring:string - debugging print
*message message:string [timer:int] - sends a message from the subtitle file - message begin_fight 240
*message message:string [timer:int] - sends a message from the subtitle file - message begin_fight 240
*message_remove [message:string] - removes a currently displayed message - message_remove c01_50_23 // message_remove
*message_remove [message:string] - removes a currently displayed message - message_remove c01_50_23 // message_remove
Line 332: Line 387:
===objective===
===objective===
*objective_complete (null) - plays the objective-complete sound
*objective_complete (null) - plays the objective-complete sound
*objective_set page:int [make_silent:string {"silent"}] - Sets the current objective page - objective_set(7,silent) // objective_set 3 silent
*objective_set page:int [make_silent:string {"silent"}] - sets the current objective page - objective_set(7,silent) // objective_set 3 silent
 
===particle===
*p3_callevent particle_class:string event_index:int - triggers an event on all P3 particles of a specified class
*p3_count - lists a count of P3 particles
*p3_daodan_disable - disables parts of the daodan shield (for debugging)
*p3_dumpparticles - jump all particles to a text file
*p3_killall - kills all P3 particles
*p3_killnearest - kills the nearest P3 particle
*p3_printtags - prints out all environmental particles with tags
*p3_removedangerous (null) - removes all "dangerous projectile" particles by making their lifetime expire - p3_removedangerous
*p3_spawn particle_class:string [velocity:float | ] - spawns a new P3 particle
*p3_startall - creates and starts all environmental particles
*p3_stopall - stops all environmental particles
*p3_writeusedparticles - writes all particles used on this level to a text file
*particle - sends a command to environmental particles with a given tag
*particle_temp_kill - kills any temporary particles
*particle_temp_start - starts temporary-particle-creation mode
*particle_temp_stop - stops temporary-particle-creation mode


===player===
===player===
Line 357: Line 430:
*powerup_reset (null) - resets all placed powerups to their starting points - powerup_reset
*powerup_reset (null) - resets all placed powerups to their starting points - powerup_reset
*reset_mechanics (null) - resets all level mechanics (triggers, turrets, consoles, etc...) to initial state - reset_mechanics
*reset_mechanics (null) - resets all level mechanics (triggers, turrets, consoles, etc...) to initial state - reset_mechanics
*script_reload - reload scripts for a level
*sound_objects_reset (null) - reloads the sounds objects
*sound_objects_reset (null) - reloads the sounds objects
*trig_reset trigger_id:int - resets a trigger to non-triggered state - trig_reset 91
*trig_reset trigger_id:int - resets a trigger to non-triggered state - trig_reset 91
Line 377: Line 451:
*sound_dialog_play_interrupt name:string - function to interrupt the current character dialog and play a new one - sound_dialog_play_interrupt c00_01_66shinatama
*sound_dialog_play_interrupt name:string - function to interrupt the current character dialog and play a new one - sound_dialog_play_interrupt c00_01_66shinatama
*sound_impulse_play name:string [volume:float] - function plays an impulse sound - sound_impulse_play glass_big 1.0
*sound_impulse_play name:string [volume:float] - function plays an impulse sound - sound_impulse_play glass_big 1.0
*sound_list_broken_links - function writes a list of sounds which have broken links to a file
*sound_music_start name:string [volume:float] - function to start music playing - sound_music_start mus_asian 0.75
*sound_music_start name:string [volume:float] - function to start music playing - sound_music_start mus_asian 0.75
*sound_music_stop name:string - function to stop playing music - sound_music_stop mus_asian
*sound_music_stop name:string - function to stop playing music - sound_music_stop mus_asian