BSL:Tutorial/airport1 level logic.bsl: Difference between revisions

m
missed these self-links because of the lack of underscores in the names
(→‎func i_uh_heheheh: so much for ssg's "overcommented" scripts... sigh)
m (missed these self-links because of the lack of underscores in the names)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{|align=right
{{finish}}
{|style="float:right"
|__TOC__
|__TOC__
|}
|}
Line 52: Line 53:
  particle fx3 do start
  particle fx3 do start
  particle exhaust create
  particle exhaust create
  [[BSL:Tutorial/airport1_level_logic.bsl#func Tarmac1|Tarmac1]]
  [[#func Tarmac1|Tarmac1]]
  trigvolume_enable tarmac 0
  trigvolume_enable tarmac 0
  trigvolume_enable trigger_volume_03 0
  trigvolume_enable trigger_volume_03 0
Line 109: Line 110:
  func void you_lose(string ai_name)
  func void you_lose(string ai_name)
  {
  {
  [[BSL:Tutorial/airport1_level_logic.bsl#func all_music_counters|all_music_counters]]
  [[#func all_music_counters|all_music_counters]]
  [[sleep]] 240
  [[sleep]] 240
  [[fade_out]] 0 0 0 180  
  [[fade_out]] 0 0 0 180  
Line 119: Line 120:
  func void you_win(int char_index)
  func void you_win(int char_index)
  {
  {
  [[BSL:Tutorial/airport1_level_logic.bsl#func all_music_counters|all_music_counters]]
  [[#func all_music_counters|all_music_counters]]
  [[win]]
  [[win]]
  }
  }
Line 235: Line 236:
  {
  {
  [[sleep]] 4500
  [[sleep]] 4500
  [[if]] (0 ne [[BSL:Tutorial/airport1_level_logic.bsl#var music_counter|music_counter]])  
  [[if]] (0 ne [[#var music_counter|music_counter]])  
  {
  {
  [[dprint]] music_force_stop
  [[dprint]] music_force_stop
  music_counter = 0
  music_counter = 0
  [[BSL:Tutorial/airport1_level_logic.bsl#func all_music_counters|all_music_counters]]
  [[#func all_music_counters|all_music_counters]]
  }
  }
  }
  }
Line 245: Line 246:
  func void music_script_start(void)
  func void music_script_start(void)
  {
  {
  [[BSL:Tutorial/airport1_level_logic.bsl#var music_counter|music_counter]] = 2
  [[#var music_counter|music_counter]] = 2
  }
  }
===func striker_lullaby_1===
===func striker_lullaby_1===
Line 251: Line 252:
  {
  {
  [[dprint]] striker_lullaby1
  [[dprint]] striker_lullaby1
  [[BSL:Tutorial/airport1_level_logic.bsl#var music_counter|music_counter]] = music_counter - 1
  [[#var music_counter|music_counter]] = music_counter - 1
  [[if]] (music_counter eq 0)
  [[if]] (music_counter eq 0)
  {
  {
  [[BSL:Tutorial/airport1_level_logic.bsl#func all_music_counters|all_music_counters]]();
  [[#func all_music_counters|all_music_counters]]();
  [[sleep]] f120
  [[sleep]] f120
  }
  }
Line 262: Line 263:
  {
  {
  [[dprint]] striker_lullaby2
  [[dprint]] striker_lullaby2
  [[BSL:Tutorial/airport1_level_logic.bsl#var music_counter|music_counter]] = music_counter - 1
  [[#var music_counter|music_counter]] = music_counter - 1
  [[if]] (music_counter eq 0)
  [[if]] (music_counter eq 0)
  {
  {
  [[BSL:Tutorial/airport1_level_logic.bsl#func all_music_counters|all_music_counters]]();
  [[#func all_music_counters|all_music_counters]]();
  [[sleep]] f120
  [[sleep]] f120
  }
  }
Line 589: Line 590:
  }
  }
===func final_ambush===
===func final_ambush===
This is triggered by the pre-final [[OBD:BINA/OBJC/CONS|console]] (number 3). That console doesn't do anything else (in particular, it doesn't activate console number 4, because in this case a ''delayed'' activation is needed. Control is taken away from the player with '''input 0''' and given back with '''input 1'''. Actually, this is redundant here because '''begin_cutscene''' and '''end_cutscene''' take care of the player's controls too (along with letterboxing etc).
;Camera stuff
:The camera cuts to a view of console 4 (interpolation over 0 frames to the position and rotation of '''[[OBAN|OBANambush1]]''') after 1 second. Another 2.5 seconds later, console 4 is activated, and then after another 2.5 seconds the actual "ambush" starts: the camera cuts to a view of console 3 (with Konoko still in front of it) and then interpolates over 5 seconds to a view of the final door, '''OBANambush3''': [[cm_interpolate_block]] makes sure that the ''previous'' camera relocation (the cut to '''OBANambush2''') is complete. 50 frames after the camera has reached '''OBANambush3''', it closes in on the door over another 5 seconds ('''OBANambush4'''). The camera stays there until the end of the cutscene, when it focuses back on Konoko.
;Music
:The music starts as the camera cuts back to Konoko's pod and starts panning towards the door. '''[[#func music_script_start|func music_script_start]]''' sets the user variable '''music_counter''' to 2 so that the music stops when and if both Strikers are killed (when either of them is killed, a function is called that decrements the counter and stops the music if it reaches zero: see '''[[#func striker_lullaby_2|func striker_lullaby_2]]''' and '''[[#func all_music_counters|func all_music_counters]]''').
;Door and locklight
:The [[OBD:BINA/OBJC/DOOR|door]] unlocks to let the Strikers pass and locks behind them (the locklight, looked up in [[ENVP]], changes accordingly). It is later unlocked by console 4.
;Characters
:The Strikers have their movement mode set to "walk", which is only effective after they stop '''playback'''ing and start '''do_path'''ing (they wander off towards the middle of the hangar). The '''i_uh_heheheh1''' [[OBD:BINA/OBJC/TRGV|trigger volume]] makes sure they'll retreat to guard the door if Konoko heads for the console that unlocks it (see '''[[#func i_uh_heheheh|func i_uh_heheheh]]''' below). The purpose of "interp 30" modifier to the '''playback''' command is not clear, as the scene looks just the same without it.
  func void final_ambush(string char_index)
  func void final_ambush(string char_index)
  {
  {
  dprint finalambush
  [[dprint]] finalambush
  input 0
  [[input]] 0
  begin_cutscene
  [[begin_cutscene]]
  sleep 60
  [[sleep]] 60
  cm_interpolate ambush1 0
  [[cm_interpolate]] ambush1 0
  sleep 150
  sleep 150
  console_activate 4
  [[console_activate]] 4
  sleep 150
  sleep 150
  sound_music_start mus_fitec_hd 0.91
  [[sound_music_start]] mus_fitec_hd 0.91
  music_script_start
  [[#func music_script_start|music_script_start]]
  cm_interpolate ambush2 0
  cm_interpolate ambush2 0
  cm_interpolate_block ambush3 300
  [[cm_interpolate_block]] ambush3 300
  sleep 350
  sleep 350
  cm_interpolate ambush4 300
  cm_interpolate ambush4 300
  door_unlock 14
  [[door_unlock]] 14
  particle door3_locklight01 do start
  [[particle]] door3_locklight01 do start
  ai2_spawn finalam_striker_1
  [[ai2_spawn]] finalam_striker_1
  ai2_spawn finalam_striker_2
  ai2_spawn finalam_striker_2
  ai2_setmovementmode finalam_striker_1 walk
  [[ai2_setmovementmode]] finalam_striker_1 walk
  ai2_setmovementmode finalam_striker_2 walk
  ai2_setmovementmode finalam_striker_2 walk
  playback finalam_striker_1 finalam_striker1 interp 30
  [[playback]] finalam_striker_1 finalam_striker1 interp 30
  playback finalam_striker_2 finalam_striker2 interp 30
  playback finalam_striker_2 finalam_striker2 interp 30
  sleep 300
  sleep 300
  particle door3_locklight01 do stop
  particle door3_locklight01 do stop
  sleep 300
  sleep 300
  door_lock 14
  [[door_lock]] 14
  ai2_dopath finalam_striker1 finalam_1 1
  [[ai2_dopath]] finalam_striker1 finalam_1 1
  ai2_dopath finalam_striker2 finalam_2 1
  ai2_dopath finalam_striker2 finalam_2 1
  trigvolume_enable i_uh_heheheh1 1
  [[trigvolume_enable]] i_uh_heheheh1 1
  cm_reset
  [[cm_reset]]
  end_cutscene
  [[end_cutscene]]
  input 1
  input 1
  }
  }
===func i_uh_heheheh===
===func i_uh_heheheh===
This forces the two Red Strikers from the final fight to retreat to the end-of-level door when and if Konoko is about to unlock it from the faraway console. The [[TRGV|trigger volume]] responsible for this is '''i_uh_heheheh1''' (number 6): '''func i_uh_heheheh''' is its '''entry''' function; it spans the stairs that lead to the [[OBD:BINA/OBJC/CONS|console]] number 4. That trigger volume is disabled at level start. It's enabled in '''[[BSL:Tutorial/airport1 level logic.bsl#func final_ambush|func final_ambush]]''' (see above), after both Strikers are spawned. Once enabled, it can only be triggered once, and only by the player.
This forces the two Red Strikers from the final fight to retreat to the end-of-level door when and if Konoko is about to unlock it from the faraway console. The [[TRGV|trigger volume]] responsible for this is '''i_uh_heheheh1''' (number 6): '''func i_uh_heheheh''' is its '''entry''' function; it spans the stairs that lead to the [[OBD:BINA/OBJC/CONS|console]] number 4. That trigger volume is disabled at level start. It's enabled in '''[[#func final_ambush|func final_ambush]]''' (see above), after both Strikers are spawned. Once enabled, it can only be triggered once, and only by the player.
:Note the typically inconsistent '''string char_index''' parameter: this is actually the ''name'' of the character who fired the trigger volume function.
:Note the typically inconsistent '''string char_index''' parameter: this is actually the ''name'' of the character who fired the trigger volume function.
  func void i_uh_heheheh(string char_index)
  func void i_uh_heheheh(string char_index)
Line 659: Line 670:
  [[particle]] door2_locklight01 do start
  [[particle]] door2_locklight01 do start
  sleep 150
  sleep 150
  [[BSL:Tutorial/airport1_level_logic.bsl#func set_objective_3|set_objective_3]]
  [[#func set_objective_3|set_objective_3]]
  [[BSL:Tutorial/airport1_level_logic.bsl#func set_target_6|set_target_6]]
  [[#func set_target_6|set_target_6]]
  [[cm_reset]]
  [[cm_reset]]
  input 1
  input 1
Line 678: Line 689:
  input 1
  input 1
  }
  }
=### Level scripted by Joseph ###=
 
[[Category:Modding tutorials]]