weapon_portalgun
Jump to navigation
Jump to search
Code classes:
CWeaponPortalgun
CBasePortalCombatWeapon
CWeaponPortalBase
CBaseCombatWeapon
(weapons)CBaseAnimating
(models)CBaseEntity
(all ents)
weapon_portalgun
is a point entity present in both Portal games. It's a portal gun.
Note: In Portal 2, players will spawn already holding a portal gun on all maps with the sp_
prefix (including custom ones). This can be avoided in four ways:
- Remove the prefix.
- Use a
logic_auto
to killfailsafe_transition_script
at the start of the map. (This entity is added automatically by the game.) - Use a
trigger_weapon_strip
. - If you're making a mod, copy
common\Portal 2\portal2\scripts\vscripts\transitions\sp_transition_list.nut
toscripts\vscripts\transitions
inside your mod folder and modify it for your mod.
Note: A weapon_portalgun
firing on its own will not target info_placement_helper
s (even ones with Force Placement (force_placement)
enabled).
Keyvalues[edit | edit source]
- Can Fire Portal 1
(CanFirePortal1)
<choices>
- Lets this gun fire blue/purple/red portals.
- Can Fire Portal 2
(CanFirePortal2)
<choices>
- Lets this gun fire orange/cyan/yellow portals.
- Starting Team
(StartingTeamNum)
<choices>
(only available in)
- Sets the Portal pair ID
(LinkageGroupID)
of theprop_portal
s the gun fires. Any number can be used if entered manually.- 0: Single Player
- 1: ATLAS (Not in FGD)
- 2: P-Body
- 3:
Blue- Not used.
Show Potatos(ShowingPotatos)
<boolean>
(only available in)
- Supposed to show potato glados on the portal gun, but doesn't work. Instead, use the AddPotatosToPortalgun input from
logic_playerproxy
or the commandupgrade_potatogun
.
Inputs[edit | edit source]
- ChargePortal1
- Does the charging effect for blue portals.
- ChargePortal2
- Does the charging effect for orange portals.
- FirePortal1
- Makes the gun fire portal 1 where it's pointed, even when held by a player.
- FirePortal2
- Makes the gun fire portal 2 where it's pointed, even when held by a player.
- FirePortalDirection1
<angle>
- Makes the gun fire portal 1 in the specified angle.
- FirePortalDirection2
<angle>
- Makes the gun fire portal 2 in the specified angle.
Outputs[edit | edit source]
- OnFiredPortal1
- Fires when portal 1 is shot. Fires even if not successfully placed.
- OnFiredPortal2
- Fires when portal 2 is shot. Fires even if not successfully placed.