Hi everyone.
I have a rather unusual problem in GMod where, at a specific point in my script, (predictable, too) GMod will suddenly freeze up.
This part of my script is supposed to go from nothing, gradually up to a nearly full bloom/full motion blur, then once that is achieved, it should then fade to black. It seems like right at that point where it crosses over between the two, gmod freezes. Also, when I move my cursor out of gmod, the cursor will lock up for about half a second for every 5 seconds. (If that helps.)
Anyhow, here's the trouble function:
[code]
local function RenderTranq()
local CT = CurTime()
if EffScale then
if EffScale > CT and donept1 == false then
local Left = -(EffScale - CT) + 11
if Left > 10 then Left = 10 end
DrawBloom(0,
Left * 0.1,
9,
9,
1,
1,
1,
1,
1)
DrawMotionBlur( 1 - Left * 0.09,
1,
Left * 0.005 )
elseif EffScale <= CT then --Supposedly freezes here
donept1 = true
EffScale = CT + 5 --We'll run the darken part for 5 seconds.
local countdown = EffScale - CT
print("Contrast: "..countdown)
while countdown > 0 do
local colormod = {}
colormod["$pp_colour_contrast"] = countdown
DrawColorModify(colormod)
--Below I multiply countdown by 2.5 of itself. Essentially, at the beginning, it should startout at 10.
DrawBloom(0,
countdown * (countdown/2.5),
9,
9,
1,
1,
1,
1,
1)
end
EffScale = nil
hook.Remove("RenderScreenspaceEffects", "RenderTranq")
end
end
end
[/code]
During the first part of the if, Left will gradually increase, until it gets rounded off at 10. When I had the print function in that area, 10 would be printed several times over, [B]then[/B] gmod would freeze. During that count, CT should be catching up to EffScale. Once that is achieved, it should flip the boolean, (disabling the first part of the if statement, so on the next frame, it doesn't try running the first part again) and continue on with its work on the elseif part. However, I [I]think[/I] it never actually gets to that point.
If anyone could help, that would be great.
Sorry, you need to Log In to post a reply to this thread.