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

m
missed these self-links because of the lack of underscores in the names
(more testing)
m (missed these self-links because of the lack of underscores in the names)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{|align=right
{{finish}}
{|style="float:right"
|__TOC__
|__TOC__
|}
|}
### AIRPORT 1 LEVEL LOGIC ###
=### AIRPORT 1 LEVEL LOGIC ###=
 
[[BSL:Tutorial/airport1 level logic.bsl#thing]]
   
   
### START, SAVE & OBJECTIVES ###
==### START, SAVE & OBJECTIVES ###==
   
   
  <span id="thing">func void func_start(string ai_name)</span>
===func func_start===
  func void func_start(string ai_name)
  {
  {
  [[dprint]] start_active
  [[dprint]] start_active
Line 53: 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 110: 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 120: 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 236: 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 246: 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 252: 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 263: 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 590: 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 '''[[#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.
  func void i_uh_heheheh(string char_index)
  func void i_uh_heheheh(string char_index)
  {
  {
  dprint iuh_heheheh
  [[dprint]] iuh_heheheh
  ai2_dopath finalam_striker_1 strategic_retreat1
  [[ai2_dopath]] finalam_striker_1 strategic_retreat1
  ai2_dopath finalam_striker_2 strategic_retreat2
  ai2_dopath finalam_striker_2 strategic_retreat2
  }
  }
 
==### DOOR LOCK LIGHTS ###==
==### DOOR LOCK LIGHTS ###==
===func change_terminaldoor_light===
===func change_terminaldoor_light===
A typical door-unlocking function, called from [[OBD:BINA/OBJC/CONS|console]] number 1. Control is taken away from the player with '''input 0''' and given back with '''input 1'''. The camera instantly moves (interpolates over 0 frames) to the position and orientation specified by '''[[OBAN|OBANdoor1]]''' and refocuses on the player 3.5 seconds later. In the meantime, the '''door1_locklight01''' particle (looked up in '''[[ENVP]]''') turns on, whereby the apparent light changes from red to green. Note that the door (number 2) is unlocked directly by the console, so there's no need for a '''door_unlock 2''' here.
  func void change_terminaldoor_light(void)
  func void change_terminaldoor_light(void)
  {
  {
Line 645: Line 659:
  input 1
  input 1
  }
  }
===func change_door2_light===
===func change_door2_light===
Same as above except before giving control back to the player, the objective and compass target are updated (by user functions). This is called from [[OBD:BINA/OBJC/CONS|console]] number 2, and the [[OBD:BINA/OBJC/DOOR|door]] (number 10) is also unlocked directly by the console.
  func void change_door2_light(void)
  func void change_door2_light(void)
  {
  {
  dprint door2
  [[dprint]] door2
  input 0  
  [[input]] 0  
  cm_interpolate door2 0
  [[cm_interpolate]] door2 0
  sleep 60
  [[sleep]] 60
  particle door2_locklight01 do start
  [[particle]] door2_locklight01 do start
  sleep 150
  sleep 150
  set_objective_3
  [[#func set_objective_3|set_objective_3]]
  set_target_6
  [[#func set_target_6|set_target_6]]
  cm_reset
  [[cm_reset]]
  input 1
  input 1
  }
  }
===func change_enddoor_light===
===func change_enddoor_light===
Same as above for [[OBAN]] and [[ENVP]] lookup. The '''door_unlock 14''' is redundant here because the [[OBD:BINA/OBJC/CONS|console]] (number 4) actually takes care of unlocking [[OBD:BINA/OBJC/DOOR|door]] number 14 (the final door). There is no unlocking sound so it really doesn't make sense to unlock the door a second time while the camera is close to it.
  func void change_enddoor_light(void)
  func void change_enddoor_light(void)
  {
  {
Line 672: Line 689:
  input 1
  input 1
  }
  }
=### Level scripted by Joseph ###=
 
[[Category:Modding tutorials]]