BSL:Functions

From OniGalore
Revision as of 02:53, 3 July 2006 by EdT (talk | contribs) (→‎diary)
Jump to navigation Jump to search

Signature

Arguments

Put usage of brackets and commas here. Also tell about the weak syntax (with space as a separator).

Return value

Put usage of return here.

Declaration

Put usage of func here.

Multithreading

Put usage of fork here.

Native functions

Note the following were originally compiled by ssg

Line structure: script command [parameter] - description - example

Parameter:

  • parameter you have to use this parameter
  • [parameter] IMO, this parameter is an option. You can use it or not.
  • (null) type only the script command, nothing else
  • no parameter given type the script command and add = 0 or = 1 (sometimes you can add higher numbers, f.e. cm_distance = 200)
  • Commands surrounded with * An example, which I've tried and which works fine. (Examples without the *, you can find in the level scripts. If there is no example given, so either I've tested it, but there was no visible effect, or I haven't tested it, because I was to lazy or to stupid to understand the meaning of the command or something else;-)
  • Commands surrounded with ** The same as above, but you have to activate the developer mode.
  • Commands in this colour will not work on a Mac nor the PC demo version

ai2_

Commands which have an effect on all AIs:

  • ai2_allpassive passive:int {0 | 1} - stops all AIs from thinking for themselves - ai2_allpassive 1
  • ai2_blind - turns off the AI's visual sensing system - *ai2_blind = 1*
  • ai2_boss_battle - enables AI boss-battle target selection - ai2_boss_battle = 1
  • ai2_deaf - turns off the AI's sound sensing system - *ai2_deaf = 1*
  • ai2_ignore_player - makes all AI ignore the player - ai2_ignore_player = 1
  • ai2_spawnall (null) - spawns all AI, even those not initially present - *ai2_spawnall*
  • ai2_stopignoring_count - set the number of events before the AI will stop ignoring
  • ai2_stopignoring_time - set the delay timer before the AI forgets about ignored events
  • ai2_takecontrol on_off:int {0 | 1} - makes the AI movement system take control of the player - ai2_takecontrol 1

Commands which have an effect on one AI:

  • ai2_active [ai_name:string | script_id:int] - forces an AI into active mode
  • ai2_attack [ai_name:string | script_id:int] [target_name:string | target_script_id:int] - forces an AI to attack another character - ai2_attack IntroNinja 0
  • ai2_barabbas_retrievegun [ai_name:string | script_id:int] - makes barabbas retrieve his gun if it is lost - ai2_barabbas_retrievegun barabus
  • ai2_barabbas_run - lets Barabbas run while carrying his gun
  • ai2_chump (null) - creates a chump
  • ai2_chump_stop - stops the chump
  • ai2_comehere [ai_name:string | script_id:int] - tells an AI to come to the player
  • 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
  • ai2_dopath [ai_name:string | script_id:int] path_name:string - tells an AI to run a particular path - ai2_dopath A_E3 patrol_49if the AI is passive, ai2_dopath cannot be executed
  • 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_idle [ai_name:string | script_id:int] - tells an AI to become idle - *ai2_idle A1_intro01*
  • ai2_inactive [ai_name:string | script_id:int] - forces an AI into inactive mode
  • ai2_kill [param1:string] [param2:string] - kills one or more AIs - ai2_kill ScanKerr01 // *ai2_kill*
  • ai2_lookatchar [ai_name:string | script_id:int] [ai_name:string | script_id:int] - tells an AI to look at a character - *ai2_lookatchar 0 Barabus needs ai2_takecontrol 1 if Konoko should do that
  • ai2_lookatme [ai_name:string | script_id:int] - tells an AI to look at the player - ai2_lookatme s2_t05
  • ai2_makeaware [ai_name:string | script_id:int] [target_name:string | target_script_id:int] - makes an AI aware of another character - ai2_makeaware GrifElite04 char_0
  • ai2_makeblind [ai_name:string | script_id:int] on_off:int{0 | 1} - makes a single AI blind - ai2_makeblind ShinShin 1
  • ai2_makedeaf [ai_name:string | script_id:int] on_off:int{0 | 1} - makes a single AI deaf - ai2_makedeaf ShinShin 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 needs ai2_takecontrol 1 if Konoko should do that
  • ai2_neutralbehavior [ai_name:string | script_id:int] behavior:string - sets up an AI's neutral-interaction - *ai2_neutralbehavior neutral_3 none
  • ai2_noncombatant [ai_name:string | script_id:int] non_combatant:int{0 | 1} - sets or clears an AI's non-combatant state - ai2_noncombatant A1_intro01 1
  • 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
  • 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_reset [reset_player:int] - resets AI as if start of level - *ai2_reset*
  • 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_Er34if the AI is passive, ai2_setjobstate cannot be executed
  • 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
  • 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

chr_

Commands which have an effect on all characters:

  • chr_active - enables character activity - *chr_active = 0*
  • chr_aim_width - number of degress of aiming width
  • chr_all_active - forces all characters to be active - *chr_all_active = 1*
  • chr_auto_aim_arc - number of degress of auto aiming arc
  • chr_auto_aim_dist - distance for auto aiming
  • chr_big_head - Draws everyone with a big head - chr_big_head = 1
  • chr_big_head_amount - Controls the size of the big head - *chr_big_head_amount = 5 needs chr_big_head = 1
  • chr_block_angle - controls the angle at which the characters can block
  • chr_corpse_fade_offscreen - makes corpses fade when they are offscreen
  • chr_death_fade_frames - the number of game ticks until charaters fade over
  • chr_death_fade_start - the number of game ticks until charaters begin to fade
  • chr_disable_melee - turns off all melee damage
  • chr_disable_visactive - disable visibility activation - *chr_disable_visactive = 1*
  • chr_enable_collision - enables character collision - *chr_enable_collision = 0*
  • chr_kill_all_ai (null) - kills all the AI
  • chr_lod - forces a given lod if it is between 0 and 4
  • chr_mini_me - decreases the size of the main character - *chr_mini_me = 1*
  • chr_mini_me_amount - controls the size of the main character - *chr_mini_me_amount = 20* needs chr_mini_me = 1
  • chr_pin_character - pins a character to the ground - *chr_pin_character = 1*
  • chr_weapon_auto_aim - enables auto aiming

Commands which have an effect on one character:

  • chr_animate [ai_name:string | script_id:int] anim_name:string [num_frames:int] [interp_frames:int] - plays an animation on a character - chr_animate 0 KONOKOcycle_ride 500
  • 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_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, Switzlerland, SyndicateAccessory
  • chr_create script_id:int [start_create:string {"start"} | ] - creates a character from an ID of the AISA file - chr_create 1050 start
  • chr_death_lock [ai_name:string | script_id:int] [on_off:int{0 | 1}] - this character will not die too much - chr_death_lock dum_hit_flash 1
  • chr_delete [ai_name:string | script_id:int] - deletes a character - chr_delete liliput_striker_1
  • chr_disarm chr_index:int - disarms a character or everyone
  • chr_dontaim [ai_name:string | script_id:int] on_off:int{0 | 1} - disables the weapon variant for a character
  • 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_stop [ai_name:string | script_id:int] - stops any environment animation on a character - chr_envanim_stop IntroNinja
  • chr_facetoflag [ai_name:string | script_id:int] flag_id:int - snaps a character's facing to a flag's facing - chr_facetoflag IntroNinja 600
  • chr_focus chr_index:int - Selects what character to control - *chr_focus 1*
  • chr_forceholster [ai_name:string | script_id:int] holster:int{0 | 1} [force_draw:int{0 | 1}] - forces a character to holster their weapon - chr_forceholster IntroStriker02 1
  • chr_freeze [ai_name:string | script_id:int] passive:int{0 | 1} - stops an AI from thinking for itself -*chr_freeze A1_intro01 1* [ai_name:string | script_id:int] = 0 don't work
  • chr_full_health [ai_name:string | script_id:int] - sets a characters health to full by script id - chr_full_health 0
  • chr_givepowerup [ai_name:string | script_id:int] powerup:string [amount:int] - gives a character a powerup -*chr_givepowerup 0 ammo 1* powerup strings: ammo, cell, hypo, shield (in percent), invis (invisibility in 1/60 seonds), lsi
  • 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
  • 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_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_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_is_player [ai_name:string | script_id:int] - returns if this character is the player - chr_is_player(character)
  • chr_location chr_index:int [loc_x:float loc_y:float loc_z:float] - Sets the location of any character -*chr_location 0 100 100 100*
  • chr_location_settocamera chr_index:int - Sets the location of any character to the camera location -*chr_location_settocamera 1*
  • chr_lock_active [ai_name:string | script_id:int] - locks the character active - chr_lock_active IntroMuro
  • 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_pain [ai_name:string | script_id:int] pain_type:string - forces a character to play a pain sound pain type strings: light, medium, heavy, death
  • chr_peace [ai_name:string | script_id:int] - turns off fight mode - chr_peace 0
  • 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_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_set_health [ai_name:string | script_id:int] hit_points:int - sets a characters health by script id - chr_set_health dum_hit_flash 50
  • chr_shadow [ai_name:string | script_id:int] [on_off:int{0 | 1}] - turns of the shadow for this character - chr_shadow ZomShin 1
  • chr_super [ai_name:string | script_id:int] super_amount:float - set's a character's super value - chr_super 0 1
  • 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_ultra_mode [ai_name:string | script_id:int] [on_off:int{0 | 1}] - enables ultra mode for a character
  • chr_unkillable [ai_name:string | script_id:int] [on_off:int{0 | 1}] - makes a character unkillable -*chr_unkillable A1_intro01 1*
  • chr_unlock_active [ai_name:string | script_id:int] - unlocks the character active
  • chr_unstoppable [ai_name:string | script_id:int] [on_off:int{0 | 1}] - makes a character unstoppable - chr_unstoppable IntroMuro 1
  • chr_vocalize [ai_name:string | script_id:int] type:string - makes a character utter a vocalization (vocalize type strings: override, yell, pain, call, say, chatter, idle)
  • chr_wait_animation [ai_name:string | script_id:int] [anim_name:string] - waits for a character to play a specific animation - chr_wait_animation 0 KONSPRrun_lt KONSPRrun_rt
  • chr_wait_animstate [ai_name:string | script_id:int] [anim_name:string] - waits for a character to reach a specific animation state - chr_wait_animstate 0 run_slide
  • 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_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*

cinematic_

  • cinematic_start bitmap_name:string draw_width:int draw_height:int start:int end:int velocity:float mirror:bool - start the display of a cinematic insert - cinematic_start (MUROtalking, 180, 180, 15, 1, 15, false)
  • cinematic_stop bitmap_name:string end:int velocity:float - stop the display of a cinematic insert - cinematic_stop (KONtalkangryfront, 16, 20)
  • cinematic_xoffset - offset from the vertical edge of the screen for the cinematic insert
  • cinematic_yoffset - offset from the horizontal edge of the screen for the cinematic insert

cm_

  • 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_barabus [ai_name:string | script_id:int] away:float up:float time:int - special camera for barabus
  • cm_canter_unarmed - camera canter - *cm_canter_unarmed = 30*
  • cm_canter_weapon - camera canter
  • cm_detach (null) - detaches the camera - cm_detach
  • cm_distance - camera distance - *cm_distance = 200*
  • cm_height - camera height - *cm_height = 50*
  • cm_interpolate cam_name:string num_frames:int - initiates a camera interpolation - cm_interpolate GrifCam01 180
  • cm_interpolate_block anim_name:string num_frames:int - initiates a camera interpolation - cm_interpolate_block OutroCam05 180
  • cm_jello mode:int {0 | 1} - toggles camera Jello(tm) mode - cm_jello 1 if cm_jello 0, the walls aren't transparent any longer
  • cm_jello_amt - sets the transparency of walls - *cm_jello_amt = 50*
  • cm_jello_radius - !no description!
  • cm_lookspring_percent - at what percent of lookspring fight mode turns off
  • cm_orbit speed:float [stopangle:float] - puts the camera in orbit mode - cm_orbit .1
  • cm_orbit_block speed:float [stopangle:float] - puts the camera in orbit mode - *cm_orbit_block 2 180*
  • cm_plane_test - jello camera plane test
  • cm_reset [maxspeed:float] [maxFocalAccel:float] - resets the camera - cm_reset
  • cm_wait (null) - makes the camera wait until it is no longer busy - cm_wait

console_

  • console_activate console_id:int - activates a console - console_activate 14
  • console_deactivate console_id:int - deactivates a console - console_deactivate 5
  • console_reset console_id:int - resets a console to initial state - console_reset 7 text_console name:string - Turns on the text console display - text_console level_6d

corpse

  • chr_corpse_fade_offscreen - makes corpses fade when they are offscreen
  • chr_death_fade_frames - the number of game ticks until charaters fade over
  • chr_death_fade_start - the number of game ticks until charaters begin to fade
  • corpse_reset (null) - resets corpses to their initial state - *corpse_reset*
  • make_corpse corpse_name:string - makes a corpse
  • trigvolume_corpse trig_id:int - kills all the corpses inside a trigger volume - trigvolume_corpse 32

cutscene

  • begin_cutscene (null) - begins a cutscene - begin_cutscene
  • cutscene_sync (null) - marks a point in a cutscene - cutscene_sync on
  • end_cutscene (null) - ends a cutscene - end_cutscene
  • fade_in ticks:int - fades the screen in - fade_in 120
  • fade_out [r:float | r:int] [g:float | g:int] [b:float | b:int] ticks:int - fades the screen out - fade_out 0 0 0 120
  • 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
  • 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_page_unlock page:int - unlocks a specific diary page on the current level

door

Commands which have an effect on all doors:

  • door_ignore_locks - disables all door locks - *door_ignore_locks = 1*

Commands which have an effect on one door:

  • door_open door_id:int - opens a door (may not stay open) - door_open 21
  • door_close door_id:int - closes a door (may not stay open) - door_close 27
  • door_lock door_id:int - locks a door - door_lock 6
  • door_unlock door_id:int - unlocks a door - door_unlock 5
  • door_jam door_id:int - jams a door in its current state - door_jam 5
  • door_unjam door_id:int - unjams a door so characters can open it - door_unjam 8