Skip to content

Commit

Permalink
#2811: Add ability to enable a player trigger on track platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Apr 15, 2024
1 parent d10fcc1 commit e58486c
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 127 deletions.
11 changes: 10 additions & 1 deletion packages/valve/geometry/items/track_plat/editoritems.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@
"DefaultValue" "1"
"Index" "6"
}
"AutoDrop"
{
"DefaultValue" "0"
"Index" "7"
}
}
"Exporting"
{
Expand Down Expand Up @@ -232,7 +237,11 @@
{
"BEE2"
{
"Force" "Input"
"Type" "AND"
"SpawnFire" "always"
"invertVar" "$start_active"
"Enable_Cmd" "platform,TurnOn,,0.00,-1"
"Disable_Cmd" "platform,TurnOff,,0.00,-1"
}
}
"Offset" "64 64 64"
Expand Down
51 changes: 20 additions & 31 deletions packages/valve/geometry/items/track_plat/vbsp_config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,31 @@
"instance" "<ITEM_RAIL_PLATFORM>"
"Condition"
{
"instance" "<ITEM_RAIL_PLATFORM:track_platform_oscillate>"
"instance" "<ITEM_RAIL_PLATFORM:track_platform>"
"Result"
{
"ChangeIOType"
{
"Type" "AND"
"SpawnFire" "always"
"invertVar" "$start_active"
"Enable_Cmd" "move_rl,Trigger,,0.00,-1"
"Disable_Cmd" "move_rl,FireUser1,,0.00,-1"
}
// Never starts active.
"SetInstVar" "$start_active 0"
}
}
"Condition"
{
"instance" "<ITEM_RAIL_PLATFORM:track_platform>"
"instance" "<ITEM_RAIL_PLATFORM:track_platforms>"
// If autodrop is set, player presence is required.
"InstVar" "$disable_autodrop == 1"
"Result"
{
"ChangeIOType"
// This adds an item with a virtual input to the platform,
// giving us exactly the behaviour we want.
"AttachInputOverlay"
{
"Type" "AND"
"invertVar" "0"
"Enable_Cmd" "track_lift_movelinear,FireUser2,,0.00,-1"
"Disable_Cmd" "track_lift_movelinear,FireUser1,,0.00,-1"
"File" "instances/BEE2/clean/items/track/trigger.vmf"
"name_suffix" "player"
"input_conf"
{
"Out_Activate" "instance:trigger;OnStartTouch"
"Out_Deactivate" "instance:trigger;OnEndTouchAll"
}
}
}
}
Expand Down Expand Up @@ -167,43 +168,31 @@
"instance" "<ITEM_RAIL_PLATFORM:track_top>"
"Result"
{
"TemplateBrush"
{
"ID" "BEE2_TRACK_PLAT_TOP"
}
"TemplateBrush" "BEE2_TRACK_PLAT_TOP"
}
}
"Condition"
{
"instance" "<ITEM_RAIL_PLATFORM:track_bottom>"
"Result"
{
"TemplateBrush"
{
"ID" "BEE2_TRACK_PLAT_BOTTOM"
}
"TemplateBrush" "BEE2_TRACK_PLAT_BOTTOM"
}
}
"Condition"
{
"instance" "<ITEM_RAIL_PLATFORM:track_middle>"
"Result"
{
"TemplateBrush"
{
"ID" "BEE2_TRACK_PLAT_MIDDLE"
}
"TemplateBrush" "BEE2_TRACK_PLAT_MIDDLE"
}
}
"Condition"
{
"instance" "<ITEM_RAIL_PLATFORM:track_single>"
"Result"
{
"TemplateBrush"
{
"ID" "BEE2_TRACK_PLAT_SINGLE"
}
"TemplateBrush" "BEE2_TRACK_PLAT_SINGLE"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
versioninfo
{
"editorversion" "400"
"editorbuild" "8419"
"mapversion" "125"
"editorbuild" "9672"
"mapversion" "127"
"formatversion" "100"
"prefab" "0"
}
Expand All @@ -20,7 +20,7 @@ viewsettings
world
{
"id" "1"
"mapversion" "125"
"mapversion" "127"
"classname" "worldspawn"
"detailmaterial" "detail/detailsprites"
"detailvbsp" "detail.vbsp"
Expand All @@ -29,14 +29,44 @@ world
"skyname" "sky_black_nofog"
}
entity
{
"id" "2035"
"classname" "comp_relay"
"ctrl_type" "0"
"ctrl_value" "1"
"delay" "0.0"
"targetname" "platform"
connections
{
"OnTurnedOn" "cube_enable_motion_triggerDisable0.01-1"
"OnTurnedOn" "track_lift_movelinearSetPosition10-1"
"OnTurnedOn" "cube_enable_motion_triggerEnable0-1"
"OnTurnedOff" "cube_enable_motion_triggerDisable0.01-1"
"OnTurnedOff" "track_lift_movelinearSetPosition00-1"
"OnTurnedOff" "cube_enable_motion_triggerEnable0-1"
}
"origin" "48 0 -16"
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"comments" "Either the trigger or inputs control this."
"logicalpos" "[0 1500]"
}
}
entity
{
"id" "2021"
"classname" "comp_kv_setter"
"angles" "-90 0 0"
"conv_ang" "0"
"ctrl_value" "1"
"invert" "0"
"kv_name" "model"
"kv_value_global" "$model"
"kv_value_mode" "legacy"
"kv_value_pos" "48 0 16"
"mode" "kv"
"rotate" "0"
"target" "track_lift_model"
Expand Down Expand Up @@ -172,6 +202,7 @@ entity
{
"id" "2"
"classname" "func_movelinear"
"angles" "0 0 0"
"blockdamage" "0"
"disablereceiveshadows" "0"
"movedir" "$travel_direction"
Expand All @@ -188,15 +219,6 @@ entity
"startsound" "World.PlatformStart"
"stopsound" "World.PlatformStop"
"targetname" "track_lift_movelinear"
connections
{
"OnUser2" "cube_enable_motion_triggerDisable0.01-1"
"OnUser2" "cube_enable_motion_triggerEnable0-1"
"OnUser2" "track_lift_movelinearSetPosition10-1"
"OnUser1" "cube_enable_motion_triggerDisable0.01-1"
"OnUser1" "cube_enable_motion_triggerEnable0-1"
"OnUser1" "track_lift_movelinearSetPosition00-1"
}
solid
{
"id" "1176"
Expand Down
Loading

0 comments on commit e58486c

Please sign in to comment.