Template:PatchDiff/October 4, 2011 Patch/update/scripts/vscripts/transitions/sp transition list.nut

N/A 1 DBG <- 0  N/A 2 FORCE_GUN_AND_HALLWAY <- 0   N/A 3    N/A 4 FIRST_MAP_WITH_GUN <- "sp_a1_intro4"   N/A 5 FIRST_MAP_WITH_UPGRADE_GUN <- "sp_a2_laser_intro"   N/A 6 FIRST_MAP_WITH_POTATO_GUN <- "sp_a3_speed_ramp"   N/A 7 LAST_PLAYTEST_MAP <- "sp_a4_finale4"   N/A 8    N/A 9    N/A 10 CHAPTER_TITLES <-   N/A 11 [   N/A 12        { map = "sp_a1_intro1", title_text = "#portal2_Chapter1_Title", subtitle_text = "#portal2_Chapter1_Subtitle", displayOnSpawn = false,                displaydelay = 1.0 },   N/A 13        { map = "sp_a2_laser_intro", title_text = "#portal2_Chapter2_Title", subtitle_text = "#portal2_Chapter2_Subtitle", displayOnSpawn = true,        displaydelay = 2.5 },   N/A 14        { map = "sp_a2_sphere_peek", title_text = "#portal2_Chapter3_Title", subtitle_text = "#portal2_Chapter3_Subtitle", displayOnSpawn = true,        displaydelay = 2.5 },   N/A 15        { map = "sp_a2_column_blocker", title_text = "#portal2_Chapter4_Title", subtitle_text = "#portal2_Chapter4_Subtitle", displayOnSpawn = true, displaydelay = 2.5 },   N/A 16        { map = "sp_a2_bts3", title_text = "#portal2_Chapter5_Title", subtitle_text = "#portal2_Chapter5_Subtitle", displayOnSpawn = true,                        displaydelay = 1.0 },   N/A 17        { map = "sp_a3_00", title_text = "#portal2_Chapter6_Title", subtitle_text = "#portal2_Chapter6_Subtitle", displayOnSpawn = true,                        displaydelay = 1.5 },   N/A 18        { map = "sp_a3_speed_ramp", title_text = "#portal2_Chapter7_Title", subtitle_text = "#portal2_Chapter7_Subtitle", displayOnSpawn = true,        displaydelay = 1.0 },   N/A 19        { map = "sp_a4_intro", title_text = "#portal2_Chapter8_Title", subtitle_text = "#portal2_Chapter8_Subtitle", displayOnSpawn = true,                        displaydelay = 2.5 },   N/A 20        { map = "sp_a4_finale1", title_text = "#portal2_Chapter9_Title", subtitle_text = "#portal2_Chapter9_Subtitle", displayOnSpawn = false,                displaydelay = 1.0 },   N/A 21 ]   N/A 22    N/A 23 // Display the chapter title   N/A 24 function DisplayChapterTitle   N/A 25 {   N/A 26        foreach (index, level in CHAPTER_TITLES)   N/A 27        {   N/A 28                if (level.map == GetMapName )   N/A 29                {   N/A 30                        EntFire( "@chapter_title_text", "SetTextColor", "210 210 210 128", 0.0 )   N/A 31                        EntFire( "@chapter_title_text", "SetTextColor2", "50 90 116 128", 0.0 )   N/A 32                        EntFire( "@chapter_title_text", "SetPosY", "0.32", 0.0 )   N/A 33                        EntFire( "@chapter_title_text", "SetText", level.title_text, 0.0 )   N/A 34                        EntFire( "@chapter_title_text", "display", "", level.displaydelay )   N/A 35    N/A 36                        EntFire( "@chapter_subtitle_text", "SetTextColor", "210 210 210 128", 0.0 )   N/A 37                        EntFire( "@chapter_subtitle_text", "SetTextColor2", "50 90 116 128", 0.0 )   N/A 38                        EntFire( "@chapter_subtitle_text", "SetPosY", "0.35", 0.0 )   N/A 39                        EntFire( "@chapter_subtitle_text", "settext", level.subtitle_text, 0.0 )   N/A 40                        EntFire( "@chapter_subtitle_text", "display", "", level.displaydelay )   N/A 41                }   N/A 42        }   N/A 43 }   N/A 44    N/A 45 // Display the chapter title on spawn if it is flagged to show up on spawn   N/A 46 function TryDisplayChapterTitle   N/A 47 {   N/A 48        foreach (index, level in CHAPTER_TITLES)   N/A 49        {   N/A 50                if (level.map == GetMapName && level.displayOnSpawn )   N/A 51                {   N/A 52                        DisplayChapterTitle   N/A 53                }          N/A 54        }   N/A 55 }   N/A 56    N/A 57 LOOP_TIMER <- 0   N/A 58    N/A 59 initialized <- false   N/A 60    N/A 61 // This is the order to play the maps   N/A 62 MapPlayOrder<- [   N/A 63    N/A 64 // ===================================================   N/A 65 // ====================== ACT 1 ======================   N/A 66 // ===================================================   N/A 67    N/A 68 // ---   N/A 69 //         Intro   N/A 70 // ---   N/A 71 "sp_a1_intro1",                                // motel to box-on-button   N/A 72 "sp_a1_intro2",                                // portal carousel   N/A 73 "sp_a1_intro3",                                // fall-through-floor, dioramas, portal gun   N/A 74 "sp_a1_intro4",                                // box-in-hole for placing on button   N/A 75 "sp_a1_intro5",                                // fling hinting   N/A 76 "sp_a1_intro6",                                // fling training   N/A 77 "sp_a1_intro7",                                // wheatley meetup   N/A 78 "sp_a1_wakeup",                                // glados   N/A 79        "@incinerator",   N/A 80    N/A 81 // ===================================================   N/A 82 // ====================== ACT 2 ======================   N/A 83 // ===================================================   N/A 84    N/A 85 "sp_a2_intro",                 // upgraded portal gun track   N/A 86    N/A 87 // ---   N/A 88 //        Lasers   N/A 89 // ---   N/A 90 "sp_a2_laser_intro",   N/A 91 "sp_a2_laser_stairs",   N/A 92 "sp_a2_dual_lasers",   N/A 93 "sp_a2_laser_over_goo",   N/A 94    N/A 95 // ---   N/A 96 //         Catapult   N/A 97 // ---   N/A 98 "sp_a2_catapult_intro",   N/A 99 "sp_a2_trust_fling",   N/A 100    N/A 101 // ---   N/A 102 //        More Lasers   N/A 103 // ---   N/A 104 "sp_a2_pit_flings",   N/A 105 "sp_a2_fizzler_intro",   N/A 106    N/A 107 // ---   N/A 108 //        Lasers + Catapult   N/A 109 // ---   N/A 110 "sp_a2_sphere_peek",   N/A 111 "sp_a2_ricochet",   N/A 112    N/A 113 // ---   N/A 114 //         Bridges   N/A 115 // ---   N/A 116 "sp_a2_bridge_intro",   N/A 117 "sp_a2_bridge_the_gap",   N/A 118    N/A 119 // ---   N/A 120 //         Turrets   N/A 121 // ---   N/A 122 "sp_a2_turret_intro",   N/A 123 "sp_a2_laser_relays", // breather   N/A 124 "sp_a2_turret_blocker",   N/A 125 "sp_a2_laser_vs_turret", // Elevator Glados Chat - Should be removed? N/A 126   N/A 127 // ---   N/A 128 //         Graduation   N/A 129 // ---   N/A 130 "sp_a2_pull_the_rug",   N/A 131 "sp_a2_column_blocker",                // Elevator_vista   N/A 132 "sp_a2_laser_chaining",   N/A 133 //"sp_a2_turret_tower",   N/A 134 "sp_a2_triple_laser",   N/A 135    N/A 136 // ---   N/A 137 //         Sabotage   N/A 138 // ---   N/A 139    N/A 140 "sp_a2_bts1",   N/A 141 "sp_a2_bts2",   N/A 142 "sp_a2_bts3",   N/A 143 "sp_a2_bts4",   N/A 144 "sp_a2_bts5",   N/A 145 "sp_a2_bts6",   N/A 146    N/A 147 // ---   N/A 148 //         Glados Chamber Sequence   N/A 149 // ---   N/A 150 "sp_a2_core",   N/A 151    N/A 152    N/A 153 // ===================================================   N/A 154 // ====================== ACT 3 ======================   N/A 155 // ===================================================   N/A 156    N/A 157 // ---   N/A 158 //         Underground   N/A 159 // ---   N/A 160    N/A 161        "@bottomless_pit",   N/A 162 "sp_a3_00",   N/A 163 "sp_a3_01",   N/A 164 "sp_a3_03",   N/A 165        "@test_dome_lift",   N/A 166 "sp_a3_jump_intro",   N/A 167        "@test_dome_lift",   N/A 168 "sp_a3_bomb_flings",   N/A 169        "@test_dome_lift",   N/A 170 "sp_a3_crazy_box",   N/A 171        "@test_dome_lift",   N/A 172 "sp_a3_transition01",   N/A 173        "@test_dome_lift",   N/A 174 "sp_a3_speed_ramp",   N/A 175        "@test_dome_lift",   N/A 176 "sp_a3_speed_flings",   N/A 177        "@test_dome_lift",   N/A 178 "sp_a3_portal_intro",   N/A 179        "@hallway",   N/A 180 "sp_a3_end",   N/A 181    N/A 182 // ===================================================   N/A 183 // ====================== ACT 4 ======================   N/A 184 // ===================================================   N/A 185    N/A 186 // ---   N/A 187 //         Recapture   N/A 188 // ---   N/A 189 "sp_a4_intro",   N/A 190    N/A 191 // ---   N/A 192 //         Tractor beam   N/A 193 // ---   N/A 194 "sp_a4_tb_intro",   N/A 195 "sp_a4_tb_trust_drop",          N/A 196 //        "@hallway",   N/A 197 "sp_a4_tb_wall_button",   N/A 198 //        "@hallway",   N/A 199 "sp_a4_tb_polarity",   N/A 200 //        "@hallway",   N/A 201 "sp_a4_tb_catch",        // GRAD   N/A 202    N/A 203 // ---   N/A 204 //         Crushers   N/A 205 // ---   N/A 206    N/A 207 // ---   N/A 208 //         Graduation Combos   N/A 209 // ---   N/A 210 "sp_a4_stop_the_box",        // Grad? N/A 211 //       "@hallway",   N/A 212 "sp_a4_laser_catapult", // Grad   N/A 213 //        "@hallway",   N/A 214 //"sp_catapult_course"   N/A 215 //        "@hallway",   N/A 216 //"sp_box_over_goo", // Grad   N/A 217 //        "@hallway",   N/A 218 "sp_a4_laser_platform",   N/A 219    N/A 220 // ---   N/A 221 // Tbeam + Paint   N/A 222 // ---   N/A 223 //"sp_paint_jump_tbeam",   N/A 224 //        "@hallway",   N/A 225 "sp_a4_speed_tb_catch",   N/A 226 //        "@hallway",   N/A 227 "sp_a4_jump_polarity",        // GRAD   N/A 228 //        "@hallway",   N/A 229 //"sp_paint_portal_tbeams",   N/A 230    N/A 231 // ---   N/A 232 // Wheatley Escape   N/A 233 // ---   N/A 234    N/A 235 "sp_a4_finale1",   N/A 236        "@hallway",   N/A 237 "sp_a4_finale2",   N/A 238        "@hallway",   N/A 239 "sp_a4_finale3",   N/A 240        "@hallway",   N/A 241    N/A 242 // ---   N/A 243 //         FIXME: WHEATLEY BATTLE   N/A 244 // ---   N/A 245    N/A 246 "sp_a4_finale4",   N/A 247    N/A 248 // ---   N/A 249 //         Demo files   N/A 250 // ---   N/A 251 "demo_intro",   N/A 252 "demo_underground",   N/A 253 "demo_paint",   N/A 254 ]   N/A 255    N/A 256    N/A 257 //   N/A 258 // OnPostTransition - we just transitioned, teleport us to the correct place. N/A 259 //  N/A 260 function OnPostTransition   N/A 261 {   N/A 262        local foundMap = false   N/A 263    N/A 264        foreach (index, map in MapPlayOrder)   N/A 265        {          N/A 266                if (GetMapName == MapPlayOrder[index])   N/A 267                {   N/A 268                        foundMap = true   N/A 269    N/A 270                        // hook up our entry elevator   N/A 271                        if( index - 1 >= 0 )   N/A 272                        {   N/A 273                                if( MapPlayOrder[index-1].find("@") == null )   N/A 274                                {   N/A 275                                        printl( "Teleporting to default start pos" )   N/A 276                                        EntFire( "@elevator_entry_teleport", "Teleport", 0, 0 )                  N/A 277                                        EntFire( "@arrival_teleport", "Teleport", 0, 0 )                  N/A 278                                }   N/A 279                                else   N/A 280                                {   N/A 281                                        printl( "Trying to teleport to " + MapPlayOrder[index - 1] + "_teleport" )   N/A 282                                        EntFire( MapPlayOrder[index - 1] + "_entry_teleport", "Teleport", 0, 0.0 )                          N/A 283                                }   N/A 284                        }   N/A 285                        break   N/A 286                }   N/A 287        }   N/A 288    N/A 289        if (foundMap == false )   N/A 290        {   N/A 291                EntFire( "@elevator_entry_teleport", "Teleport", 0, 0 )   N/A 292                EntFire( "@arrival_teleport", "Teleport", 0, 0 )                  N/A 293        }   N/A 294    N/A 295        EntFire( "portal_stats_controller", "OnLevelStart", 5.0, 0 );   N/A 296 }   N/A 297    N/A 298 //   N/A 299 // EntFire_MapLoopHelper   N/A 300 //   N/A 301 function EntFire_MapLoopHelper( classname, suffix, command, param, delay )   N/A 302 {   N/A 303        // This calls EntFire on an entity of a given type, named with the given suffix. N/A 304       // This deals with instance name mangling (though it doesn't guarantee uniqueness)   N/A 305        local suffix_len = suffix.len   N/A 306        for ( local ent = Entities.FindByClassname( null, classname ); ent != null; ent = Entities.FindByClassname( ent, classname ) )   N/A 307        {   N/A 308                local ent_name = ent.GetName   N/A 309                local suffix_offset = ent_name.find( suffix )   N/A 310                if ( ( suffix_offset != null ) && ( suffix_offset == ( ent_name.len - suffix_len ) ) )   N/A 311                {   N/A 312                        EntFire( ent_name, command, param, delay )   N/A 313                        return   N/A 314                }   N/A 315        }   N/A 316        printl( "MAPLOOP:  ERROR! Failed to find entity " + suffix + " while initiating map transition" );   N/A 317 }   N/A 318    N/A 319 //   N/A 320 // Think   N/A 321 //   N/A 322 function Think   N/A 323 {          N/A 324        // Start the game loop if the cvar is set   N/A 325        if ( initialized && LoopSinglePlayerMaps )   N/A 326        {   N/A 327                // initialize the timer   N/A 328                if( LOOP_TIMER == 0 )   N/A 329                {   N/A 330                        LOOP_TIMER = Time + 10 // restart time in seconds   N/A 331                }   N/A 332    N/A 333                // transition to the next map if the timer has expired   N/A 334                if ( LOOP_TIMER < Time )   N/A 335                {   N/A 336                        // reset loop timer   N/A 337                        LOOP_TIMER = 0   N/A 338    N/A 339                        printl( "\nMAPLOOP: timer expired, moving on..." )  N/A 340    N/A 341                        // Ensure point_viewcontrollers are disabled   N/A 342                        EntFire( "point_viewcontrol", "disable", 0, 0 )   N/A 343    N/A 344                        // Change the level (this sequence was originally in the 'transition_without_survey' logic_relay)   N/A 345                        EntFire_MapLoopHelper( "trigger_once",   "survey_trigger",    "Disable",       "",                    0.0 )   N/A 346                        EntFire_MapLoopHelper( "env_fade",       "exit_fade",         "Fade",          "",                    0.0 )   N/A 347                        EntFire_MapLoopHelper( "point_teleport", "exit_teleport",     "Teleport",      "",                    0.3 )   N/A 348                        EntFire_MapLoopHelper( "logic_script",   "transition_script", "RunScriptCode", "TransitionFromMap", 0.4 )   N/A 349                }   N/A 350        }   N/A 351    N/A 352    N/A 353        if (initialized)   N/A 354        {   N/A 355                return   N/A 356        }   N/A 357        initialized = true   N/A 358    N/A 359        // position fixup for sp_a3_01, in case player has fallen outside map   N/A 360    N/A 361        if (GetMapName == "sp_a3_01")   N/A 362        {   N/A 363                printl( "--- FIXING PLAYER POSITION FOR sp_a3_01" )   N/A 364    N/A 365                local destination_name = "knockout-teleport" // targetname of the destination entity   N/A 366    N/A 367                local player_ent = null   N/A 368    N/A 369                local destination_ent = null   N/A 370    N/A 371                // find the player   N/A 372                player_ent = Entities.FindByClassname( player_ent, "player" )     N/A 373    N/A 374                if ( player_ent == null  )   N/A 375                 {   N/A 376                        printl("*** Cannot find player. Aborting!")  N/A 377                        return;   N/A 378                }   N/A 379    N/A 380                // find the destination entity   N/A 381                destination_ent = Entities.FindByName( destination_ent, destination_name )     N/A 382    N/A 383                if ( destination_ent == null  )   N/A 384                {   N/A 385                        printl("*** Cannot find destination entity " + destination_name + ". Aborting!")  N/A 386                        return;   N/A 387                }   N/A 388    N/A 389                // move the player to the destination   N/A 390                player.SetOrigin( destination_ent.GetOrigin )         N/A 391        }   N/A 392    N/A 393        DumpMapList   N/A 394    N/A 395        try   N/A 396        {   N/A 397                TryDLC1InstalledOrCatch   N/A 398    N/A 399                local portalGunCommand = false   N/A 400                local portalGunSecondCommand = false   N/A 401                local portalGunPotatoCommand = false   N/A 402                local foundMap = false   N/A 403    N/A 404                foreach (index, map in MapPlayOrder)   N/A 405                {   N/A 406                        if (MapPlayOrder[index] == FIRST_MAP_WITH_GUN)   N/A 407                        {   N/A 408                                portalGunCommand = true   N/A 409                        }                  N/A 410                        else if (MapPlayOrder[index] == FIRST_MAP_WITH_UPGRADE_GUN)   N/A 411                        {   N/A 412                                portalGunSecondCommand = true   N/A 413                        }   N/A 414                        else if (MapPlayOrder[index] == FIRST_MAP_WITH_POTATO_GUN)   N/A 415                        {   N/A 416                                portalGunPotatoCommand = true   N/A 417                        }   N/A 418    N/A 419                        if (GetMapName == MapPlayOrder[index])   N/A 420                        {   N/A 421                                break   N/A 422                        }   N/A 423                }   N/A 424    N/A 425                TryDisplayChapterTitle   N/A 426    N/A 427                if (portalGunCommand && GetMapName != "sp_a2_intro" && GetMapName != "sp_a3_01" )   N/A 428                {   N/A 429                        printl( "=======================Trying to GivePlayerPortalgun" )   N/A 430                        GivePlayerPortalgun   N/A 431                }   N/A 432    N/A 433                if (portalGunSecondCommand )   N/A 434                {   N/A 435                        printl( "=======================Trying to UpgradePlayerPortalgun" )   N/A 436                        UpgradePlayerPortalgun   N/A 437                }   N/A 438    N/A 439                if (portalGunPotatoCommand )   N/A 440                {   N/A 441                        printl( "=======================Trying to UpgradePlayerPotatogun" )   N/A 442                        UpgradePlayerPotatogun   N/A 443                }   N/A 444        }   N/A 445        catch (e)   N/A 446        {   N/A 447                printl( "=======================Giving weapon with DLC1 not installed fall through." )  N/A 448    N/A 449                local portalGunCommand = ""   N/A 450                local portalGunSecondCommand = ""   N/A 451                local foundMap = false   N/A 452    N/A 453                foreach (index, map in MapPlayOrder)   N/A 454                {   N/A 455                        if (MapPlayOrder[index] == FIRST_MAP_WITH_GUN)   N/A 456                        {   N/A 457                                portalGunCommand = "give_portalgun"   N/A 458                        }                  N/A 459                        else if (MapPlayOrder[index] == FIRST_MAP_WITH_UPGRADE_GUN)   N/A 460                        {   N/A 461                                portalGunSecondCommand = "upgrade_portalgun"   N/A 462                        }   N/A 463                        else if (MapPlayOrder[index] == FIRST_MAP_WITH_POTATO_GUN)   N/A 464                        {   N/A 465                                portalGunSecondCommand = "upgrade_potatogun"   N/A 466                        }   N/A 467    N/A 468                        if (GetMapName == MapPlayOrder[index])   N/A 469                        {   N/A 470                                break   N/A 471                        }   N/A 472                }   N/A 473    N/A 474                TryDisplayChapterTitle   N/A 475    N/A 476                if (portalGunCommand != "" && GetMapName != "sp_a2_intro" && GetMapName != "sp_a3_01" )   N/A 477                {   N/A 478                        printl( "=======================Trying to run " + portalGunCommand )   N/A 479                        EntFire( "command", "Command", portalGunCommand, 0.0 )   N/A 480                        EntFire( "@command", "Command", portalGunCommand, 0.0 )   N/A 481                }   N/A 482    N/A 483                if (portalGunSecondCommand != "")   N/A 484                {   N/A 485                        printl( "=======================Trying to run " + portalGunSecondCommand )   N/A 486                        EntFire( "command", "Command", portalGunSecondCommand, 0.1 )   N/A 487                        EntFire( "@command", "Command", portalGunSecondCommand, 0.1 )   N/A 488                }   N/A 489        }   N/A 490 }   N/A 491    N/A 492 //   N/A 493 // TransitionFromMap   N/A 494 //   N/A 495 function DumpMapList   N/A 496 {   N/A 497        if(DBG)   N/A 498        {   N/A 499                local mapcount = 0   N/A 500    N/A 501                printl("================DUMPING MAP PLAY ORDER")   N/A 502    N/A 503                foreach( index, map in MapPlayOrder )   N/A 504                {   N/A 505                        // weed out our transitions   N/A 506                        if( MapPlayOrder[index].find("@") == null )   N/A 507                        {   N/A 508                                if( GetMapName == MapPlayOrder[index] )   N/A 509                                {   N/A 510                                        printl( mapcount + " " + MapPlayOrder[index] + " <--- You Are Here" )   N/A 511                                }   N/A 512                                else   N/A 513                                {   N/A 514                                        printl( mapcount + " " + MapPlayOrder[index] )   N/A 515                                }   N/A 516                                mapcount++   N/A 517                        }   N/A 518    N/A 519                }   N/A 520                printl( mapcount + " maps total." )  N/A 521    N/A 522                printl("================END DUMP")   N/A 523        }   N/A 524 }   N/A 525    N/A 526    N/A 527    N/A 528 //   N/A 529 // RealTransitionFromMap   N/A 530 //   N/A 531 function RealTransitionFromMap   N/A 532 {   N/A 533        local next_map = null   N/A 534        foreach( index, map in MapPlayOrder )   N/A 535        {   N/A 536                if( GetMapName == MapPlayOrder[index] )   N/A 537                {   N/A 538                        // make good   N/A 539                        local skipIndex = index   N/A 540                        for(local i=0;i<2;i+=1)   N/A 541                        {   N/A 542                                if( skipIndex + 1 < MapPlayOrder.len )   N/A 543                                {   N/A 544                                        if( MapPlayOrder[skipIndex + 1].find("@") != null )   N/A 545                                        {   N/A 546                                                skipIndex++   N/A 547                                        }   N/A 548                                        else   N/A 549                                        {   N/A 550                                                break   N/A 551                                        }   N/A 552                                }   N/A 553                        }                  N/A 554    N/A 555                        if( ( skipIndex + 1 < MapPlayOrder.len ) &&   N/A 556                            ( GetMapName != LAST_PLAYTEST_MAP  )    )   N/A 557                        {   N/A 558                                next_map = MapPlayOrder[ skipIndex + 1 ]   N/A 559                                if(DBG) printl( "Map " + GetMapName + " connects to " + next_map )   N/A 560    N/A 561                                if ( Entities.FindByName( null, "@changelevel" ) == null )   N/A 562                                {   N/A 563                                        if(DBG) printl( "('@changelevel' entity missing, using 'map' command instead)" )   N/A 564                                        SendToConsole( "map " + next_map );   N/A 565                                }   N/A 566                                else   N/A 567                                {   N/A 568                                        EntFire( "@changelevel", "Changelevel", next_map, 0.0 )                          N/A 569                                }   N/A 570                        }   N/A 571                }   N/A 572        }   N/A 573    N/A 574        if ( next_map == null )   N/A 575        {   N/A 576                if(DBG) printl( "Map " + GetMapName + " is the last map" )   N/A 577                EntFire( "end_of_playtest_text", "display", 0 )   N/A 578                EntFire( "@end_of_playtest_text", "display", 0 )   N/A 579    N/A 580                // If we are in the map loop and at the end of the list, start over at the beginning   N/A 581                if ( LoopSinglePlayerMaps )   N/A 582                {   N/A 583                        printl( "MAPLOOP: No more maps, restarting loop." )  N/A 584                        next_map = MapPlayOrder[0]   N/A 585                        if ( Entities.FindByName( null, "@changelevel" ) == null )   N/A 586                        {   N/A 587                                SendToConsole( "map " + next_map );   N/A 588                        }   N/A 589                        else   N/A 590                        {   N/A 591                                EntFire( "@changelevel", "Changelevel", next_map, 0.0 )                          N/A 592                        }   N/A 593                }   N/A 594        }   N/A 595    N/A 596        printl( "" )   N/A 597 }   N/A 598    N/A 599    N/A 600 //   N/A 601 // TransitionFromMap   N/A 602 //   N/A 603 function TransitionFromMap   N/A 604 {   N/A 605        try   N/A 606        {   N/A 607                TryDLC1InstalledOrCatch   N/A 608    N/A 609                // hack hack: display portal stat UI before level transition   N/A 610                EntFire( "portal_stats_controller", "OnLevelEnd", 5.0, 0 );   N/A 611        }   N/A 612        catch (e)   N/A 613        {   N/A 614                printl( "=======================Transitioning map with DLC1 not installed fall through." )  N/A 615                RealTransitionFromMap   N/A 616        }   N/A 617 }   N/A 618    N/A 619 //   N/A 620 // MakeBatFile - dumps the map list in a formatted way, for easy recompilin'   N/A 621 //   N/A 622 function MakeBatFile   N/A 623 {   N/A 624                local mapcount = 0   N/A 625    N/A 626                printl("================DUMPING maps formatted for batch file")   N/A 627    N/A 628                foreach( index, map in MapPlayOrder )   N/A 629                {   N/A 630                        printl( "call build " + MapPlayOrder[index] )          N/A 631                }   N/A 632    N/A 633                foreach( index, map in MapPlayOrder )   N/A 634                {   N/A 635                        printl( "call p2_buildcubemaps " + MapPlayOrder[index] )          N/A 636                }   N/A 637 }   N/A 638    N/A 639 // this lets the elevator know that we are ready to transition. N/A 640 function TransitionReady  N/A 641 {   N/A 642        ::TransitionReady <- 1          N/A 643 }   0 644  + true   1 645  + true   2 646  + true