Is there a command to demote the portal gun? [solved]

Avatar
Goldenknighttim
182 Posts
Posted Sep 02, 2013
In coop, when a player dies, he respawns with an upgraded portal gun.(When the pti scripts are used.) I want the player to keep the gun, but not be able to use portals after they die in coop. I know there is a command to upgrade the portal gun, so It makes sence that there would be one to downgrade the portal gun. But I have not seen the command. Does anyone know if there is a command to demote the portal gun, and if there is, what is it. If there isn't, is there another way do what I'm trying to do?
Advertisement
Registered users don’t see ads! Register now!
Avatar
GLaDOS CUBE
163 Posts
Posted Sep 02, 2013
Replied 1 minutes later
I would try to use trigger_weapon_strip
Hope that helps.
Avatar
Goldenknighttim
182 Posts
Posted Sep 02, 2013
Replied 9 minutes later
I don't want to strip the weapon because I want the portal gun to stay for asthetics. I just don't want it to be usable. Atm,I'm looking into stripping the weapon, then upgrading it a moment after. I'm running into some problems, but still troubleshooting that idea.
Avatar
Goldenknighttim
182 Posts
Posted Sep 02, 2013
Replied 2 minutes later
Whats making this complicated is that I'm trying to do this while modding my pti.
Avatar
TeamSpen210
608 Posts
Posted Sep 02, 2013
Replied 17 minutes later
You might be able to strip the portal gun from the player then teleport a weapon_portalgun set to not fire either portal to the player. I don't know how the gun will behave if you give a player one of those, you might want to test it first.
Avatar
Goldenknighttim
182 Posts
Posted Sep 02, 2013
Replied 5 minutes later
Then I would be limited in the amount of times the player could die before it would start getting buggy.
Avatar
FelixGriffin
2,680 Posts
Posted Sep 02, 2013
Replied 12 minutes later

TeamSpen210 wrote:
You might be able to strip the portal gun from the player then teleport a weapon_portalgun set to not fire either portal to the player. I don't know how the gun will behave if you give a player one of those, you might want to test it first.

Exactly as you'd expect. It's a viewmodel without a weapon effect. If you put one in a template you can use an entitymaker to ForceSpawnAtEntityOrigin red or blue.

Avatar
Goldenknighttim
182 Posts
Posted Sep 02, 2013
Replied 14 minutes later
I've been doing some more troubleshooting. I tried to edit the coop door entrance, and I put a trigger in the droppers that would strip the weapon, and a moment later, run the command: upgrade_portalgun.
The weapon is stripped, but the portalgun doesn't upgrade. Thats when I decided to test the command manually, and I found that the command doesn't work in coop. Ill look into trying teamspen's and Felix griffin's idea.
Avatar
ChickenMobile
2,460 Posts
Posted Sep 02, 2013
Replied 32 minutes later
Are you using a point_playercommand to execute the commands (upgrade_portalgun)? Because I know for sure that it does work in Coop.

As for giving a one portal portalgun the gun could be stripped and then equipped by a player_equip.

I do remember making an example for this however (but I cannot find it) so you can see how I did this with the linked portals map I made with LPfreaky90. FreakyChicken's Portals of Doom and Friendship prt1
You're welcome to decompile it and look what I did here to give them one portalguns. - the entities you need are somewhere in the first puzzle room.

Avatar
FelixGriffin
2,680 Posts
Posted Sep 02, 2013
Replied 1 hour later

ChickenMobile wrote:
Are you using a point_playercommand to execute the commands (upgrade_portalgun)? Because I know for sure that it does work in Coop.

As for giving a one portal portalgun the gun could be stripped and then equipped by a player_equip.

I do remember making an example for this however (but I cannot find it) so you can see how I did this with the linked portals map I made with LPfreaky90. FreakyChicken's Portals of Doom and Friendship prt1
You're welcome to decompile it and look what I did here to give them one portalguns. - the entities you need are somewhere in the first puzzle room.

Do you mean point_clientcommand or point_servercommand? There is no point_playercommand that I know of.

Avatar
Goldenknighttim
182 Posts
Posted Sep 02, 2013
Replied 1 hour later
I used a point_clientcommand. I'm not looking to force the player to only have 1 portal, I'm trying to force the player to not have any portals, while still having the gun. I tried what Felix Griffen said, and that worked pretty well, except for the fact that in coop with the normal pti scripts, portal guns respawn as a 1-portal gun, even if the original was a no-portal gun. To fix the problem of the player landing on an autospawned 1-portal gun, I hid a pit behind a playerclip and a non-solid brush in the coop entrance door. This works for a bit, but after the player has died enough times, the 1-portal guns will pile up aventually be hit by the player. Is there any way to get rid of portal guns that are lying around? I tried putting a fizzler in the pit, and checked every flag except the ones that started with 'only', and I also unchecked the flag that acounts for the mass of an object.
Avatar
Goldenknighttim
182 Posts
Posted Sep 02, 2013
Replied 6 minutes later
If there isn't a way, I guess I could make a larger room under the entrance door, and have a linked portal door allow the 1-portal guns to fall into that. However, I would prefer to avoid that, because it would likely limit my chambers by removing available space. And if I get this mod to work, I'll also likely want to allow others to use it, and there would be no warning if part of the chamber crossed into this 'dumping room'.
Avatar
TeamSpen210
608 Posts
Posted Sep 02, 2013
Replied 39 minutes later
You can just teleport or spawn the guns right on the player as mentioned before. Trigger_weapon_strips have an option to destroy the weapon as well.
Avatar
Goldenknighttim
182 Posts
Posted Sep 03, 2013
Replied 14 hours later
Thanks, I've been messing around with the trigger_weapon_strips and they don't remove weapons that are lying around. They only seem to destroy weapons that are being used by the player. I need a way to get rid of the many that are respawning in the pit below the player. Is there any other way to destroy portal guns?
Avatar
Gemarakup
1,183 Posts
Posted Sep 03, 2013
Replied 32 minutes later
Killing them?
Avatar
josepezdj
2,386 Posts
Posted Sep 03, 2013
Replied 15 minutes later

Goldenknighttim wrote:
I've been doing some more troubleshooting. I tried to edit the coop door entrance, and I put a trigger in the droppers that would strip the weapon, and a moment later, run the command: upgrade_portalgun.

You can't upgrade something that doesn't exist, don't you think? :wink: You can only fire the command upgrade_portalgun IF the player already has a portalgun, but if you stripped it, there is none.

As said above, you'll need to give the player a portalgun after he has been respawned and his weapon has been stripped, with either "CanFirePortal1" or "2" set to "0". This can be done by making a little room all textured with the nodraw texture outside your map (or at any hidden place inside your map where you know the player won't reach ever). Inside put the entities:

  • weapon_portalgun with no fires at all.
  • point_template, set the portalgun name as the template 1
  • env_entity_maker, and set the name of the point_template as the "Point_template To Spawn"

Now add a trigger_multiple right below the trigger_weapon_strip that you have under the info_coop_spawns and as Felix suggested you only need to use the output ForceSpawnAtEntityOrigin... like so:

Under the Blue player dropper:

- OnTrigger > [env_entity_maker name] > ForceSpawnAtEntityOrigin > !blue

Under the Orange player dropper:

- OnTrigger > [env_entity_maker name] > ForceSpawnAtEntityOrigin > !red

This should work.

Avatar
Goldenknighttim
182 Posts
Posted Sep 03, 2013
Replied 3 hours later
Yea, getting rid of the auto-respawning portal guns in the pit. I called it "killing" thim because the option I had just tried was using the trigger_weapon_strip with the class info for "kill weapon" set to yes.
Avatar
FelixGriffin
2,680 Posts
Posted Sep 03, 2013
Replied 13 minutes later
Why not just use a trigger_multiple > OnStartTouch > !activator > Kill? Or even simpler, a trigger_remove?
Avatar
Goldenknighttim
182 Posts
Posted Sep 03, 2013
Replied 2 minutes later

josepezdj wrote:
As said above, you'll need to give the player a portalgun after he has been respawned and his weapon has been stripped, with either "CanFirePortal1" or "2" set to "0". This can be done by making a little room all textured with the nodraw texture outside your map (or at any hidden place inside your map where you know the player won't reach ever). Inside put the entities:

  • weapon_portalgun with no fires at all.
  • point_template, set the portalgun name as the template 1
  • env_entity_maker, and set the name of the point_template as the "Point_template To Spawn"

Now add a trigger_multiple right below the trigger_weapon_strip that you have under the info_coop_spawns and as Felix suggested you only need to use the output ForceSpawnAtEntityOrigin... like so:

Under the Blue player dropper:

- OnTrigger > [env_entity_maker name] > ForceSpawnAtEntityOrigin > !blue

Under the Orange player dropper:

- OnTrigger > [env_entity_maker name] > ForceSpawnAtEntityOrigin > !red

This should work.

What I have set up already is very similar to what you are suggesting. The problem is that the portal guns that are spawning on the player are respawning, and forming a pile of portal guns that, for some reason, have 1 portal active. If they pile up, which happens if the player dies enough, the player will be given a portal gun that allows 1 of the portals to be shot. In a regular map made with hammer, this wouldn't be an issue, but I am trying to mod my pti, which for some reason causes portal guns to respawn, and they don't respawn with the original's settings. They have a default setting that I have already discribed. If I can find a way to stop them from respawning, or a way to destroy the ones that have respawned, then I will have my answer. Thanks for the help so far, I feel like I'm very close.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Goldenknighttim
182 Posts
Posted Sep 03, 2013
Replied 2 minutes later

FelixGriffin wrote:
Why not just use a trigger_multiple > OnStartTouch > !activator > Kill? Or even simpler, a trigger_remove?

Thanks, Ill try those now and let you know if any of them work.