You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description = "Reimplements the unused Turret VO found within Portal 1/2's files.\n\nA total of 12 additional voicelines now have the ability to play.\n\nVersion 1.00."
4
+
description = "Reimplements the unused Turret VO found within Portal's files.\n\nAlso adds logic to restore lines designed to play if Turrets are blocked by a Hard Light Bridge.\n\nOverall, a total of 16 additional voicelines have the ability to play.\n\nVersion 1.1.0"
// store turret handles to prevent constant searching, one slight downfall of this is if turrets are spawned after ScriptInit, but this rarely happens in maps
// check if there is LOS between turret's center and player center (ignoring bridge)
103
+
local traceForPlayer =TraceHull(
104
+
turretPos,
105
+
playerPos,
106
+
TURRET_TRACE_BOUNDS_MIN,
107
+
TURRET_TRACE_BOUNDS_MAX,
108
+
TURRET_TRACE_MASK,
109
+
traceBridge.GetEntity(),
110
+
TURRET_TRACE_COLLISION_GROUP
111
+
)
112
+
113
+
if(traceForPlayer.DidHitNonWorldEntity()) {
114
+
if(traceForPlayer.GetEntity() == player) { // can play blocked voice lines
115
+
// check if player is behind bridge from turret's POV
116
+
local traceForPlayerBridge =TraceHull(
117
+
turretPos,
118
+
playerPos,
119
+
TURRET_TRACE_BOUNDS_MIN,
120
+
TURRET_TRACE_BOUNDS_MAX,
121
+
TURRET_TRACE_MASK,
122
+
turret,
123
+
TURRET_TRACE_COLLISION_GROUP
124
+
)
125
+
126
+
if(traceForPlayerBridge.DidHitNonWorldEntity()) {
127
+
if(traceForPlayerBridge.GetEntity().GetClassname() =="projected_wall_entity"&&RandomInt(1,TURRET_SOUNDSCRIPT_PLAYCHANCE) ==1) { // 1 in TURRET_SOUNDSCRIPT_PLAYCHANCE chance of playing (when permitted)
0 commit comments