Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions src/vbsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,23 @@ def set_player_portalgun(vmf: VMF, info: corridor.Info) -> None:
)
pgun_script['Template01'] = '__pgun_template'
pgun_script['spawnflags'] = 2

else:
# In coop we have not need to actually spawn portalguns.
# In coop we have not need to actually spawn portalguns.
pgun_script['classname'] = 'logic_script'
# Make sure @portalman knows when players spawn
vmf.create_ent(
classname='comp_relay',
targetname='@on_player_spawn_2',
origin=ent_pos,
OnTrigger="@portalgunCallScriptFunctionon_oran_spawn0-1"
)
vmf.create_ent(
classname='comp_relay',
targetname='@on_player_spawn_3',
origin=ent_pos,
OnTrigger="@portalgunCallScriptFunctionon_blue_spawn0-1"
)

# For Absolute Fizzler or otherwise, this fizzles portals on a
# player remotely.
Expand All @@ -528,6 +542,7 @@ def set_player_portalgun(vmf: VMF, info: corridor.Info) -> None:
mat=consts.Tools.TRIGGER,
).solid)


# For removing portalguns from players.
trig_stripper = vmf.create_ent(
targetname='__pgun_weapon_strip',
Expand Down Expand Up @@ -598,19 +613,19 @@ def set_player_portalgun(vmf: VMF, info: corridor.Info) -> None:
'_mark_held_cube()',
))

if info.is_sp:
logic_auto.add_out(Output(
'OnMapSpawn',
'@portalgun',
'RunScriptCode',
'init({}, {}, {})'.format(
'true' if blue_portal else 'false',
'true' if oran_portal else 'false',
'true' if has_btn_onoff else 'false',
),
delay=0.1,
only_once=True,
))
#Init @portalgun
logic_auto.add_out(Output(
'OnMapSpawn',
'@portalgun',
'RunScriptCode',
'init({}, {}, {})'.format(
'true' if blue_portal else 'false',
'true' if oran_portal else 'false',
'true' if has_btn_onoff else 'false',
),
delay=0.1,
only_once=True,
))

# Shuts down various parts when you've reached the exit.
import precomp.conditions.instances
Expand Down