BSL:Functions: Difference between revisions

added key names for chr_holdkey
m (→‎game (miscellaneous): added note on save_game)
(added key names for chr_holdkey)
 
(5 intermediate revisions by the same user not shown)
Line 128: Line 128:
*chr_animate_block [ai_name:string | script_id:int] anim_name:string [num_frames:int] [interp_frames:int] - plays an animation on a character and blocks until done - chr_animate_block 0 KONOKOlev11_cnsl_idle 300
*chr_animate_block [ai_name:string | script_id:int] anim_name:string [num_frames:int] [interp_frames:int] - plays an animation on a character and blocks until done - chr_animate_block 0 KONOKOlev11_cnsl_idle 300
*chr_boss_shield [ai_name:string | script_id:int] - turns on the boss shield for a character - chr_boss_shield OutroNinja
*chr_boss_shield [ai_name:string | script_id:int] - turns on the boss shield for a character - chr_boss_shield OutroNinja
''See [[Shields]] for a definition of "boss shield".''
*chr_changeteam [ai_name:string | script_id:int] team_name:string - changes a character's team - chr_changeteam guard1 Syndicate
*chr_changeteam [ai_name:string | script_id:int] team_name:string - changes a character's team - chr_changeteam guard1 Syndicate
''Team name strings: Konoko, TCTF, Syndicate, Neutral, SecurityGuard, RogueKonoko, Switzerland, SyndicateAccessory''
''Team name strings: Konoko, TCTF, Syndicate, Neutral, SecurityGuard, RogueKonoko, Switzerland, SyndicateAccessory''
Line 149: Line 150:
''powerup strings: ammo, cell, hypo, shield (in percent), invis (invisibility in frames, -1 = forever), lsi (amount is ignored)''
''powerup strings: ammo, cell, hypo, shield (in percent), invis (invisibility in frames, -1 = forever), lsi (amount is ignored)''
*chr_giveweapon [ai_name:string | script_id:int] weapon_name:string - gives a character a new weapon - chr_giveweapon 0 w1_tap
*chr_giveweapon [ai_name:string | script_id:int] weapon_name:string - gives a character a new weapon - chr_giveweapon 0 w1_tap
''weapon strings: w1_tap, w2_sap, w3_phr, w4_psm, w5_sbg, w6_vdg, w7_scc, w8_mbo, w9_scr, w10_sni, w11_ba1, w12_ba2''
''weapon names: w1_tap, w2_sap, w3_phr, w4_psm, w5_sbg, w6_vdg, w7_scc, w8_mbo, w9_scr, w10_sni, w11_ba1, w12_ba2''
*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)
''This function only returns if the player is out of ammo for the weapon and the weapon is also empty.''
''This function only returns if the player is out of ammo for the weapon and the weapon is also empty.''
Line 155: Line 156:
*chr_health chr_index:int [hit_points:int] - sets character's health  - chr_health 0 300
*chr_health chr_index:int [hit_points:int] - sets character's health  - chr_health 0 300
*chr_holdkey [ai_name:string | script_id:int] key_name:string num_frames:int - forces a character to hold a key down for some frames
*chr_holdkey [ai_name:string | script_id:int] key_name:string num_frames:int - forces a character to hold a key down for some frames
''key names: forward, back, stepleft, stepright, turnleft, turnright, crouch, jump, fire, altfire, punch, kick, action''
*chr_inv_reset [ai_name:string | script_id:int] - clears a characters inventory - chr_inv_reset ambush_tanker_1a
*chr_inv_reset [ai_name:string | script_id:int] - clears a characters inventory - chr_inv_reset ambush_tanker_1a
*chr_invincible [ai_name:string | script_id:int] [on_off:int{0 | 1}] - makes a character invincible - chr_invincible char_0 1
*chr_invincible [ai_name:string | script_id:int] [on_off:int{0 | 1}] - makes a character invincible - chr_invincible char_0 1
Line 165: Line 167:
''If you provide an index number ("IN") higher than the available number of characters ("NC"), the engine will keep iterating through the available characters, wrapping around when it hits the end, until it has traversed IN characters. For instance if NC = 85 and you input chr_main_class(180), the engine will change your class to the index 10 (180-85-85).''
''If you provide an index number ("IN") higher than the available number of characters ("NC"), the engine will keep iterating through the available characters, wrapping around when it hits the end, until it has traversed IN characters. For instance if NC = 85 and you input chr_main_class(180), the engine will change your class to the index 10 (180-85-85).''


''The practical effect seems to be different than chr_set_class (besides the parameters). For example with chr_main_class(ninja_hard_1) your ninja will be right handed while with chr_set_class(0,ninja_hard_1) your ninja will be left handed. Other difference is that chr_main_class seem to disable the daodan effect when using chr_super in the character itself.''
''The practical effect seems to be different than chr_set_class (besides the parameters). For example with chr_main_class(ninja_hard_1) your ninja will be righthanded while with chr_set_class(0,ninja_hard_1) your ninja will be lefthanded. Another difference is that chr_main_class seem to disable the Daodan effect when using chr_super on the character itself.''
*chr_neutral [ai_name:string | script_id:int] passive:int{0 | 1} - stops an AI from thinking for itself - chr_neutral ParkStriker 1
*chr_neutral [ai_name:string | script_id:int] passive:int{0 | 1} - stops an AI from thinking for itself - chr_neutral ParkStriker 1
*chr_nocollision [ai_name:string | script_id:int] on_off:int{0 | 1} - disables collision for a character - chr_nocollision 0 1
*chr_nocollision [ai_name:string | script_id:int] on_off:int{0 | 1} - disables collision for a character - chr_nocollision 0 1
Line 183: Line 185:
''chr_showextent_globals must be on for this to work.''
''chr_showextent_globals must be on for this to work.''
*<span style="color:blue">chr_showextent_globals - shows the global parts of an attack animation's extent - chr_showextent 1</span>
*<span style="color:blue">chr_showextent_globals - shows the global parts of an attack animation's extent - chr_showextent 1</span>
*chr_super [ai_name:string | script_id:int] super_amount:float - set's a character's super value (the command isn't restricted to enable or disable the daodan particles, a value > 1 will make the daodan particles glow more), this command does not seem to affect the damage dealt in any way (differently from normal hypo over health) - chr_super 0 1
*chr_super [ai_name:string | script_id:int] super_amount:float - set's a character's super value
''This sets a character's "<u>external</u> super" value, meaning their Daodan glow, but will not grant them any special powers such as Daodan overpower. It is used to give Konoko her Daodan glow in the Mountain Compound opening cutscene (she isn't granted overhealth until the cutscene ends). The super_amount value determines the brightness of the Daodan particles: consider the effective range to be 1-10. The Compound cutscene gives Konoko a glow of 1, and the cheat code "chenille" gives her a glow of 10.''
*chr_talk [ai_name:string | script_id:int] sound_name:string pre_pause:int post_pause:int [priority:string | ] - causes a character to play a line of dialogue - chr_talk victim_mansci_1 c02_62_11sci 0 0
*chr_talk [ai_name:string | script_id:int] sound_name:string pre_pause:int post_pause:int [priority:string | ] - causes a character to play a line of dialogue - chr_talk victim_mansci_1 c02_62_11sci 0 0
*chr_teleport [ai_name:string | script_id:int] flag_id:int - teleports a character to a flag - chr_teleport 0 105
*chr_teleport [ai_name:string | script_id:int] flag_id:int - teleports a character to a flag - chr_teleport 0 105
Line 300: Line 303:
*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
''See [[Difficulty modes]] for all the factors changed with the difficulty level.''
*flag_view_prefix prefix:string - view flags with a specific prefix
*flag_view_prefix prefix:string - view flags with a specific prefix
*hang when:string{"now"} - hangs the game (used for testing error handling)
*hang when:string{"now"} - hangs the game (used for testing error handling)
Line 310: Line 314:
*print_type type:int - prints an anim type  
*print_type type:int - prints an anim type  
*restore_game (null) - restores the game - restore_game
*restore_game (null) - restores the game - restore_game
''Tells the game to load from disk the player state data saved in [[persist.dat]] – Konoko's position, health and inventory – for the current save point. The save point can be set in two ways: the player selecting an option from the Load Game screen, and the <tt>save_game</tt> function being called.''
*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
''The only thing which passing in "autosave" as the third parameter accomplishes is playing the save sound effect and displaying the message "Game saved." No other value for this parameter has special meaning.''
''Saves the player state to persist.dat. <tt>save_point</tt> is restricted to the range 0-10, but only values 1-10 are expected to be passed in. If you pass in "0", the error "invalid save point" will print on the console line but Oni will actually create "Save Point 0" under that level (or "Save Point -1" in the case of Chapter 1!). Loading this save point will be equivalent to clicking on the level title.<br>The only effect of passing "autosave" as the third parameter is playing the game-saved sound effect and displaying the message "Game saved." The game will be saved with or without it. No other value for this parameter has special meaning.''
*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_stop_lookup - bla bla bla