Spawning without Portal gun [Fixed]
Quote from pac0master on September 2, 2015, 2:50 amHey 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.
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.
Quote from josepezdj on September 2, 2015, 5:10 amHey. 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:
- Code: Select all
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...
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:
- Code: Select all
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...
Quote from pac0master on September 3, 2015, 4:17 amOh thanks. Let me check it out. Ill give you a feedback during the week.
Oh thanks. Let me check it out. Ill give you a feedback during the week.
Quote from pac0master on September 3, 2015, 1:24 pmRight. I am not really sure how it works.
I might need help on that.(also yeah, I work on a mod called : ABYSS )
Right. I am not really sure how it works.
I might need help on that.
(also yeah, I work on a mod called : ABYSS )
Quote from TreasureGhost on September 5, 2015, 1:13 pmOr just remove sp_ from your map and you are done.
in compiling you'll need it, but for now, remove it.
Or just remove sp_ from your map and you are done.
in compiling you'll need it, but for now, remove it.
Quote from pac0master on September 5, 2015, 3:36 pmI think I found a way to fix it. I don't have the problem anymore.
Case closed
I think I found a way to fix it. I don't have the problem anymore.
Case closed