Spawning without Portal gun [Fixed]

Avatar
pac0master
25 Posts
Posted Sep 02, 2015
Hey guys. I am encountering a little problem which become very annoying.

Is there a way to start a map and spawn without a portal gun? I tried to Strip the gun on spawn but it is not very efficient and sometime we have to either move or wait a fraction of second before the gun is stripped. That's quite annoying.

Sure. I can change the name of the map but the point is to keep with the standard: sp_a1, etc.
Thanks for your time.

Advertisement
Registered users don't see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Sep 02, 2015
Replied 2 hours later
Hey. Well, if I remember correctly, yours was a mod, right? there's a script that controls what kind of portalgun is given to the player according to the map's name: "portal2/scripts/transitions/sp_transition_list.nut". Check out this part of code inside it:

DumpMapList()

   local portalGunCommand = ""
   local portalGunSecondCommand = ""
   local foundMap = false
   
   foreach (index, map in MapPlayOrder)
   {
      if (MapPlayOrder[index] == FIRST_MAP_WITH_GUN)
      {
         portalGunCommand = "give_portalgun"
      }      
      else if (MapPlayOrder[index] == FIRST_MAP_WITH_UPGRADE_GUN)
      {
         portalGunSecondCommand = "upgrade_portalgun"
      }
      else if (MapPlayOrder[index] == FIRST_MAP_WITH_POTATO_GUN)
      {
         portalGunSecondCommand = "upgrade_potatogun"
      }
      
      if (GetMapName() == MapPlayOrder[index])
      {
         break
      }
   }

   TryDisplayChapterTitle()
   
   if (portalGunCommand != "" && GetMapName() != "sp_a2_intro" && GetMapName() != "sp_a3_01" )
   {
      printl( "=======================Trying to run " + portalGunCommand )
      EntFire( "command", "Command", portalGunCommand, 0.0 )
      EntFire( "@command", "Command", portalGunCommand, 0.0 )
   }

   if (portalGunSecondCommand != "")
   {
      printl( "=======================Trying to run " + portalGunSecondCommand )
      EntFire( "command", "Command", portalGunSecondCommand, 0.1 )
      EntFire( "@command", "Command", portalGunSecondCommand, 0.1 )
   }
   
}

// --------------------------------------------------------
// TransitionFromMap
// --------------------------------------------------------
function DumpMapList()
{
   if(DBG)
   {
      local mapcount = 0
      
      printl("================DUMPING MAP PLAY ORDER")
      
      foreach( index, map in MapPlayOrder )
      {
         // weed out our transitions
         if( MapPlayOrder[index].find("@") == null )
         {
            if( GetMapName() == MapPlayOrder[index] )
            {
               printl( mapcount + " " + MapPlayOrder[index] + " <--- You Are Here" )
            }
            else
            {
               printl( mapcount + " " + MapPlayOrder[index] )
            }
            mapcount++
         }
         
      }
      printl( mapcount + " maps total." )
      
      printl("================END DUMP")
   }
}

You could try to alter the script if you know Vscripting (Squirrel) in order to make it give the right portalgun (or none at all) based in your maps names...

Avatar
pac0master
25 Posts
Posted Sep 03, 2015
Replied 23 hours later
Oh thanks. Let me check it out. Ill give you a feedback during the week.
Avatar
pac0master
25 Posts
Posted Sep 03, 2015
Replied 9 hours later
Right. I am not really sure how it works.
I might need help on that.

(also yeah, I work on a mod called : ABYSS )

Avatar
TreasureGhost
31 Posts
Posted Sep 05, 2015
Replied 1 day later
Or just remove sp_ from your map and you are done.
in compiling you'll need it, but for now, remove it.
Advertisement
Registered users don't see ads! Register now!
Avatar
pac0master
25 Posts
Posted Sep 05, 2015
Replied 2 hours later
I think I found a way to fix it. I don't have the problem anymore.
Case closed