Removing coop PortalGun?

Avatar
Darkylight
81 Posts
Posted Jul 04, 2011
Hey People, I'm making a map where the two players start without the portalgun, like in the tutorial from coop. I tried decompiling and searching but I cant make the portalgun dissapear... Any help?
Advertisement
Registered users don’t see ads! Register now!
Avatar
Skotty
671 Posts
Posted Jul 04, 2011
Replied 11 minutes later
Maybe a trigger_weapon_strip will help. Just create one at the player spawn and set "Kill Weapons" to "Yes".
Avatar
Darkylight
81 Posts
Posted Jul 04, 2011
Replied 1 hour later
Yeah but I need to make the trigger actuing with some delay after the portalgun appears. I need to make it like in the original maps, without portalgun.
Avatar
Rubrica
305 Posts
Posted Jul 04, 2011
Replied 11 minutes later
As long as your trigger is set to 'OnMapSpawn' the player probably won't notice they even had a portalgu. To begin with- if your map fades in from black at the start, they definitely won't.
Avatar
Quargos
17 Posts
Posted Jul 05, 2011
Replied 17 hours later
open up the Co-op spawn instance and modify the spawn entitys, there is some sort of property for whether they spawn with a gun or not, can't remember what it is though.
Avatar
Skotty
671 Posts
Posted Jul 05, 2011
Replied 3 hours later

Darkylight wrote:
Yeah but I need to make the trigger actuing with some delay after the portalgun appears. I need to make it like in the original maps, without portalgun.

Just scale the trigger brush over the whole spawn area and leave it activated?

Avatar
Darkylight
81 Posts
Posted Jul 06, 2011
Replied 17 hours later

Skotty wrote:
Darkylight wrote:

Yeah but I need to make the trigger actuing with some delay after the portalgun appears. I need to make it like in the original maps, without portalgun.

Just scale the trigger brush over the whole spawn area and leave it activated?

If I do it, it make not funcional.

Avatar
Skotty
671 Posts
Posted Jul 06, 2011
Replied 49 minutes later
Ha found it. It's so easy.

Create a env_global and copy into the text field "Global State Set" portalgun_nospawn
It's not in the FGD so it won't appear in the choosing-field. Just write it in the text field and it should work - not tested.

I recommend to download my latest improved FGD files to use a lot of Portal 2 features not featured in Hammer. Improved FGD files

Avatar
Darkylight
81 Posts
Posted Jul 06, 2011
Replied 5 hours later

Skotty wrote:
Ha found it. It's so easy.

Create a env_global and copy into the text field "Global State Set" portalgun_nospawn
It's not in the FGD so it won't appear in the choosing-field. Just write it in the text field and it should work - not tested.

I recommend to download my latest improved FGD files to use a lot of Portal 2 features not featured in Hammer. Improved FGD files

First I tried decompiling valve maps but its not funcional. I did it.

Avatar
Skotty
671 Posts
Posted Jul 06, 2011
Replied 1 hour later
Tried it with env_global and it really doen't work. But in the decompiled map I can't see any other posibility to remove the gun at the beginning.
Avatar
ChickenMobile
2,460 Posts
Posted Jul 06, 2011
Replied 7 hours later

Skotty wrote:
Tried it with env_global and it really doen't work. But in the decompiled map I can't see any other posibility to remove the gun at the beginning.

I thought that this would have to be the answer for the gun to not be there on spawn. I'm going to try this myself.

EDIT: In the campaign they have two info_targets called "supress_orange_portalgun_spawn" and "supress_blue_portalgun_spawn". When I put them in, the players spawned without portal guns. I also hid the env_global and it still made them spawn without portal guns. When I hid the info_targets they spawned with guns.
Therefore these info_targets must be the reason why the bots spawn without guns. I'm guessing that there is some sort of code in the game which does this.

To make this work:
- Create an info_target anywhere in your map.- Change the info_target's name value to either "supress_orange_portalgun_spawn" or "supress_blue_portalgun_spawn" depending on what bot you want to not spawn with a gun.- (optional) Create a logic_script which refers to "debug_scripts/mp_coop_transition_list.nut"- Create a logic_auto and "OnMapSpawn" make your logicscript "RunScriptCode" "MapPostLoaded()" (This is so the coop session starts otherwise you will be disconnected.)
Remember to make one for each player if you want both bots not to spawn with a gun.

Advertisement
Registered users don’t see ads! Register now!
Avatar
LuckyRJ
78 Posts
Posted Nov 12, 2012
Replied 1 year later

ChickenMobile wrote:
Skotty wrote:

Tried it with env_global and it really doen't work. But in the decompiled map I can't see any other posibility to remove the gun at the beginning.

I thought that this would have to be the answer for the gun to not be there on spawn. I'm going to try this myself.

EDIT: In the campaign they have two info_targets called "supress_orange_portalgun_spawn" and "supress_blue_portalgun_spawn". When I put them in, the players spawned without portal guns. I also hid the env_global and it still made them spawn without portal guns. When I hid the info_targets they spawned with guns.
Therefore these info_targets must be the reason why the bots spawn without guns. I'm guessing that there is some sort of code in the game which does this.

To make this work:
- Create an info_target anywhere in your map.- Change the info_target's name value to either "supress_orange_portalgun_spawn" or "supress_blue_portalgun_spawn" depending on what bot you want to not spawn with a gun.- (optional) Create a logic_script which refers to "debug_scripts/mp_coop_transition_list.nut"- Create a logic_auto and "OnMapSpawn" make your logicscript "RunScriptCode" "MapPostLoaded()" (This is so the coop session starts otherwise you will be disconnected.)
Remember to make one for each player if you want both bots not to spawn with a gun.

wow

Thanks soo much for this, i finally fixed the issue now with this issue where i wanted both players to spawn without portal guns

the way i did it was this

i added a info target for each player so orange and blue and the way i have my map is you have to find the portal guns, so if the player dies before they find the guns then they will still respawn without the guns.....

so then when they actually pick the portal gun up, i got a output in the portal gun onplayerpickup >>> supress_blue_portalgun_spawn kill, that is the info targets name like u said

so this now kills that info target, awesome awesome, soo happy, because before this i was using the weapon strip trigger and this was not working all the time, sometimes they spawned with the guns and others they didnt

so thanks again for this chickenmobile :smile:

LuckyRJ