Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b1fc86e
rest-assured-works-for-now
littlebabyman Sep 12, 2025
e66e3fa
Merge branch 'main' of https://github.com/StyledStrike/gmod-glide
littlebabyman Sep 12, 2025
07d1231
particle
littlebabyman Sep 12, 2025
971b502
skidmark
littlebabyman Sep 13, 2025
fc2f857
Update skid_marks.lua
littlebabyman Sep 13, 2025
24d012b
use the
littlebabyman Sep 13, 2025
512edfd
Merge remote-tracking branch 'upstream/main'
littlebabyman Sep 18, 2025
b58c0d4
formatting and cleanup
littlebabyman Sep 19, 2025
afe5058
more changes
littlebabyman Sep 25, 2025
cf196ae
Merge remote-tracking branch 'upstream/main' into particle-rework
littlebabyman Sep 25, 2025
b09e0b1
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Sep 30, 2025
38fb506
one missed check
littlebabyman Sep 30, 2025
9e71b7c
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Sep 30, 2025
ebd7738
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Oct 1, 2025
3c76d6d
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Oct 2, 2025
58fb077
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Oct 5, 2025
e04eb59
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Oct 17, 2025
6223e81
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Oct 18, 2025
5c25029
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Oct 18, 2025
5202d3a
Update skid_marks.lua
littlebabyman Oct 25, 2025
7310175
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 2, 2025
6bb48f5
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 4, 2025
d8b8444
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 5, 2025
376ff15
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 9, 2025
c3d4c49
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 11, 2025
17666e7
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 11, 2025
675e684
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 12, 2025
1499ec7
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 13, 2025
901dc83
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 14, 2025
fc8cf0f
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 17, 2025
9869d3e
Merge remote-tracking branch 'upstream/main' into effects-editing
littlebabyman Nov 29, 2025
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
14 changes: 10 additions & 4 deletions lua/effects/glide_tire_roll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ function EFFECT:Init( data )
local velocity = data:GetStart()
local matId = data:GetSurfaceProp()
local scale = Clamp( data:GetScale(), 0.1, 10 )
local vehicle = data:GetEntity()

local emitter = ParticleEmitter( origin, false )
if not IsValid( emitter ) then return end

if surfaceFX[matId] then
self:DoSurface( emitter, origin, velocity, scale, surfaceFX[matId] )
local up = vehicle:GetUp()
self:DoSurface( emitter, origin, velocity, scale, up, surfaceFX[matId] )
else
self:DoSmoke( emitter, origin, velocity, scale, data:GetEntity() )
self:DoSmoke( emitter, origin, velocity, scale, vehicle )
end

emitter:Finish()
Expand All @@ -34,9 +36,12 @@ local Config = Glide.Config
local debrisGravity = Vector( 0, 0, 0 )
local debrisVelocity = Vector( 0, 0, 0 )

function EFFECT:DoSurface( emitter, origin, velocity, scale, fx )
function EFFECT:DoSurface( emitter, origin, velocity, scale, up, fx )
local p
local lifetime = fx.lifetime * ( Config.reduceTireParticles and 0.4 or 1 )
local col = render.GetSurfaceColor( origin + up, origin - up )
if col.x >= 255 then return end
col = col * 255

for _ = 1, 5 do
p = emitter:Add( fx.mat, origin )
Expand All @@ -59,7 +64,8 @@ function EFFECT:DoSurface( emitter, origin, velocity, scale, fx )
p:SetAirResistance( fx.resistance or 50 )
p:SetGravity( debrisGravity )
p:SetVelocity( debrisVelocity )
p:SetLighting( true )
p:SetColor( col.x, col.y, col.z )
p:SetLighting( false )
p:SetCollide( true )
end
end
Expand Down
14 changes: 10 additions & 4 deletions lua/effects/glide_tire_slip_forward.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ function EFFECT:Init( data )
local matId = data:GetSurfaceProp()
local scale = Clamp( data:GetScale(), 0.1, 15 )
local normal = data:GetNormal()
local vehicle = data:GetEntity()

local emitter = ParticleEmitter( origin, false )
if not IsValid( emitter ) then return end

if surfaceFX[matId] then
self:DoSurface( emitter, origin, scale, normal, surfaceFX[matId] )
local up = vehicle:GetUp()
self:DoSurface( emitter, origin, scale, normal, up, surfaceFX[matId] )
else
self:DoSmoke( emitter, origin, scale, normal, data:GetEntity() )
self:DoSmoke( emitter, origin, scale, normal, vehicle )
end

emitter:Finish()
Expand All @@ -34,9 +36,12 @@ local Config = Glide.Config
local debrisGravity = Vector( 0, 0, 0 )
local debrisVelocity = Vector( 0, 0, 0 )

function EFFECT:DoSurface( emitter, origin, scale, normal, fx )
function EFFECT:DoSurface( emitter, origin, scale, normal, up, fx )
local p
local lifetime = fx.lifetime * ( Config.reduceTireParticles and 0.4 or 1 )
local col = render.GetSurfaceColor( origin + up, origin - up )
if col.x >= 255 then return end
col = col * 255

for _ = 1, 5 do
p = emitter:Add( fx.mat, origin )
Expand All @@ -59,7 +64,8 @@ function EFFECT:DoSurface( emitter, origin, scale, normal, fx )
p:SetAirResistance( 50 )
p:SetGravity( debrisGravity )
p:SetVelocity( debrisVelocity * scale * RandomFloat( 0.3, 1.0 ) )
p:SetLighting( true )
p:SetColor( col.x, col.y, col.z )
p:SetLighting( false )
p:SetCollide( true )
end
end
Expand Down
2 changes: 1 addition & 1 deletion lua/glide/client/ranged_feature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function RangedFeature:Think()
end

if self.isActive then
if dist > self.deactivateDist or isDormant or not passedTest then
if ( dist > self.deactivateDist and not ent.isLocalPlayerInVehicle ) or isDormant or not passedTest then
self:Deactivate()
end

Expand Down
19 changes: 14 additions & 5 deletions lua/glide/client/skid_marks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,34 @@ function SkidHandler:AddPiece( lastQuadId, pos, forward, normal, width, strength

local right = normal:Cross( forward )
local lastQuad = quads[lastQuadId]
local color = render.GetSurfaceColor( pos, ray.HitPos - normal ):ToColor()

quads[i] = {
pos + right * width, -- [1] 1st vertex
pos - right * width, -- [2] 2nd vertex
lastQuad and lastQuad[2] or pos, -- [3] 3rd vertex
lastQuad and lastQuad[1] or pos, -- [4] 4th vertex
55 + 200 * strength, -- [5] Alpha
ColorAlpha( color, 55 + 200 * strength ), -- [5] Color + Alpha
RealTime() + Config.skidmarkTimeLimit -- [6] Lifetime
}

if #quads <= 1 then return i end

if lastQuad then
lastQuad[5]:Lerp( color, 0.5 )
end

local ind = (i) % #quads
local alpha = quads[ind+1][5]
alpha.a = alpha.a * 0.9

return i
end

local Min = math.min
local SetMaterial = render.SetMaterial
local DrawQuad = render.DrawQuad

local color = Color( 255, 255, 255 )

function SkidHandler:Draw( t )
SetMaterial( self.material )

Expand All @@ -79,8 +88,8 @@ function SkidHandler:Draw( t )
timeLeft = q[6] - t

if timeLeft > 0 then
color.a = q[5] * Min( timeLeft * 0.5, 1 )
DrawQuad( q[1], q[2], q[3], q[4], color )
q[5].a = q[5].a * Min( timeLeft * 0.5, 1 )
DrawQuad( q[1], q[2], q[3], q[4], q[5] )
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion materials/glide/effects/tire_particles/dirt.vmt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"$vertexcolor" "1"
"$vertexalpha" "1"
"$translucent" "1"
"$color" "[ 0.5 0.4 0.2 ]"
"$color" "[ 1.0 1.0 1.0 ]"
}
2 changes: 1 addition & 1 deletion materials/glide/effects/tire_particles/grass_debris.vmt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"$vertexcolor" "1"
"$vertexalpha" "1"
"$translucent" "1"
"$color" "[ 2.0 3.0 1.0 ]"
"$color" "[ 1.0 1.0 1.0 ]"
}
2 changes: 1 addition & 1 deletion materials/glide/effects/tire_particles/sand.vmt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"$vertexcolor" "1"
"$vertexalpha" "1"
"$translucent" "1"
"$color" "[ 2.3 1.8 1.4 ]"
"$color" "[ 1.0 1.0 1.0 ]"
}
2 changes: 1 addition & 1 deletion materials/glide/effects/tire_particles/snow.vmt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"$basetexture" "particle/particle_composite"
"$vertexcolor" "1"
"$vertexalpha" "1"
"$color" "[ 15.0 15.0 15.0 ]"
"$color" "[ 1.0 1.0 1.0 ]"
}
Binary file removed materials/glide/skidmarks/roll_dirt.vtf
Binary file not shown.
Binary file added materials/glide/skidmarks/roll_dirt2.vtf
Binary file not shown.