Yea but writing out a variable 100 times if they are like isBeamDirected, isLookingAtBeam, getBlindedFromBeam.. can get really annoying.
Yea but writing out a variable 100 times if they are like isBeamDirected, isLookingAtBeam, getBlindedFromBeam.. can get really annoying.
Naming variables like that help you a lot in the long run since it makes your code easier to read.
Tidied that thing up a bit:
Looks even more horrible. The problem is in the coder, but the code works so screw it. I'll go do something more or less productive.local tab = {} tab[ "$pp_colour_addr" ] = 0 tab[ "$pp_colour_addg" ] = 0 tab[ "$pp_colour_addb" ] = 0 tab[ "$pp_colour_brightness" ] = 0 tab[ "$pp_colour_contrast" ] = 1 tab[ "$pp_colour_colour" ] = 1 tab[ "$pp_colour_mulr" ] = 0 tab[ "$pp_colour_mulg" ] = 0 tab[ "$pp_colour_mulb" ] = 0 local function DrawFrac(f) if f==0 then return end tab[ "$pp_colour_brightness" ] = f tab[ "$pp_colour_contrast" ] = 1+f DrawColorModify( tab ) end function CanSee_BeamSource(who,what) local ObjWidth = 42 * 0.5 -- works well for the source too :v: local fov = who:GetFOV() or 90 local Disp = what:GetPos() - who:EyePos() local distance = Disp:Length() local max = math.abs( math.cos( math.acos( distance / math.sqrt( distance * distance + ObjWidth * ObjWidth ) ) + fov * ( math.pi / 180 ) ) ) Disp:Normalize() local val = Disp:Dot( who:EyeAngles():Forward() ) if val > max then return val end return false end function CanSee_Beam(who,what,EyeAngles) local ObjWidth = 42 * 0.5 local fov = 7 local Disp = what - who local distance = Disp:Length() local max = math.abs( math.cos( math.acos( distance / math.sqrt( distance * distance + ObjWidth * ObjWidth ) ) + fov * ( math.pi / 180 ) ) ) Disp:Normalize() local val = Disp:Dot( EyeAngles:Forward() ) val=val>0 and val or -val max=max>0 and max or -max -- the beam is two ways return val-max end local function RenderScreenspaceEffects() for _,e in pairs(ents.FindByClass("tower_beam")) do local fDistanceFar=e:GetPos():Distance(EyePos()) local fDistanceNear=fDistanceFar -- Calculate the far fading fraction fDistanceFar=fDistanceFar-4800 -- stop fading here units fDistanceFar=fDistanceFar<0 and 0 or fDistanceFar fDistanceFar=fDistanceFar*(1/1000) -- falloff fDistanceFar=1-fDistanceFar fDistanceFar=fDistanceFar<0 and 0 or fDistanceFar if fDistanceFar==0 then continue end -- Calculate the near blinding fraction. fDistanceNear=-0.4+fDistanceNear/155 -- start blinding at 155 units and maximum blinding at 155*0.4 fDistanceNear=fDistanceNear>=1 and 1 or fDistanceNear <=0 and 0 or fDistanceNear fDistanceNear=1-fDistanceNear local fPlyLookingAtLight=CanSee_BeamSource(LocalPlayer(),e) -- Can't get blinded by what you can't see. Used in all calculations. if not fPlyLookingAtLight then continue end -- Grab beam's angle local cang=e.cang if not cang then continue end -- We need this angle. -- Calculate if player is in beam fPlayerInBeam=CanSee_Beam(e:GetPos(),EyePos(),cang) local magic=55 -- Blend it all together... fPlayerInBeam=fPlayerInBeam*magic*fPlyLookingAtLight -- Make the beam's "beam" entity fade away local blend=fPlayerInBeam blend=blend<0 and 0 or blend blend=blend+0.7 blend=(1-blend) e.blend=(blend<0 and 0 or blend>1 and 1 or blend)*3 -- ...and clamp fPlayerInBeam=fPlayerInBeam*fDistanceFar fPlayerInBeam=fPlayerInBeam>=1 and 1 or fPlayerInBeam <=0 and 0 or fPlayerInBeam fPlayerInBeam=fPlayerInBeam+fDistanceNear*fPlyLookingAtLight fPlayerInBeam=fPlayerInBeam>=1 and 1 or fPlayerInBeam <=0 and 0 or fPlayerInBeam -- Draw the final fraction blinding DrawFrac(fPlayerInBeam) -- TODO: Take account daynight cycle end -- kill that shit if RealTime()-tLastDraw>1 then hook.Remove("RenderScreenspaceEffects","lighthouse") started=false end end StartHook=function() if not started then hook.Add("RenderScreenspaceEffects","lighthouse",RenderScreenspaceEffects) started=true else tLastDraw=RealTime() end end
Wondering how feasible it would be to send Lua files in string tables - instead of using the dua file. Max size of a data entry is 16,384 bytes - but I could increase that.
It'd have the advantage that when running a .dem file you'll have all the same client lua files as the person that recorded it.
That would be majestic.
I don't think downloading 1500 KiB every time I join a server just to have lua in demos working is worth the tradeoff but who knows. Can't you embed the dua cache in demos somehow and load that or just tell people to upload cache and demo and make the demos load the cache?Code:39b5e2ca05701dc8fbb0e3f1f3811944.dua 1.5M 8.5.2012 3970c31124108ecf278ab13415b1be1b.dua 1.5M 12.5.2012 27360bb82ea68ff9ae193943985f72ca.dua 1.5M 13.5.2012 bc6c7e2416f7a99b23493f0c0c616c77.dua 1.5M 15.5.2012 0236bbe6d832526d780ddfdd1acea280.dua 1.5M 17.5.2012 15dcb9020508261cdc0947e7f349a658.dua 1.5M 17.5.2012 45b60070bbc814d92794f1549e067b8a.dua 1.5M 17.5.2012 506c15d7d36677414a9d35fc9716312e.dua 1.5M 17.5.2012
Yeah it would suck - but just don't join servers with so much Lua going going on.
9MB of clientside lua (unpacked) is too much? :(
I have private clientside scripts. If I were to record a demo with these scripts and publish it. Would people be able to extract the scripts from that demo?
you publish a webm file, not the demo itself, i guess...
Of course rendering it to an actual video file loses the scripts. But that's not what I'm asking. My question is:
Are my installed private scripts in every demo that I record?
What private info would you have in your scripts that can't be shared? You could read passwords etc from a file that wouldn't be shared with the demo.
If you're worrying about your amazing clientside scripts getting stolen then you're as dumb as Conna.
I'd rather download a dua file
What kind of bullshit is that?
Look
All I want to know is whether my clientside scripts are in the demo file and whether they can be extracted.
As an answer to this question, I would expect a boolean answer, optionally with a god damn explanation.
Have an example of an answer that answers my question:
"Yes, because ..."
Have another one to really make my point clear:
"No, because ..."
Yes
Thank you.![]()
Worse experience for 99% of users to benefit less than 1% who actually use demos. Y'know.. Whatever you want Garry.
Having scripts saved in the demo would actually be pretty cool too. You could optionally check for scripts that aren't called for, and exclude those, decreasing the loading times and file size too.
How so?
In general it would be. It's just in my specific case that I have to be careful with what I record. I support this way of handling demo's.
Does anyone know what sets the gm:foldername in the server tags?
I remember helping you and your brother with making SWEPs back in 2009. It's funny to see how you still make SWEPs. You're one of the very few to still make this many SWEPs. I hope, though, that your code is somewhat neater than those ZSwords you made a while ago. It's easier for yourself to read if you indent properly.
I can't complain, though, I've been on DarkRP since 2008.![]()
now i shall wonder how people make that nice view model moving bob in sweps for the eternity
in gm13 what do you use instead of info.txt?
Got bored and recreated Simon!
Cool!
But shouldn't it do the same sequence again if you completed it, but add another onto it?
"This Many Sweps", You make it sound like its all been done before, The media i have shown may be of weapons but i can safely say "Sweps" is something i rarely do now.
Then again, I'm sure your just trying to keep at me for all these years you've wasted.
Anyway, I'll stop derailing now.
zombie escape looks epic.
Wouldn't you also need the server side files for the demos to work properly then?
Raaaaiiiiiinnnnnn.
I think you need to avoid WeatherModv7.
The one time I try to be descriptive by giving just a picture and a word instead of my usual paragraphs of confusion, Snape, once again, says it's not the desired effect. I was aiming towards "I just got rain and actual day/night for my addon".
Yes, I did use WeatherMod as a reference, but no, not a complete copy-pasta of it. No offense to the original coder, but... it's unorganized and my OCD is killing me.
There's too much fat in there, like a table for when it's dark and raining, when it's raining, when it's storming, cloudy, etc. etc. There's a lot of unnecessary tables that are never called, but it did give me a good idea on which direction to head for it.
tl;dr It's not WeatherMod.
Working on effects for deathrun. Nothing special. Following are place holders until I make my own models. I do rather like the medic one though. Excuse the quality as my gpu fan died and I'm awaiting approval from XFX for RMA. Oh and these are placed with a stool so it is easy to place teleporters, cash collection caps, and health.
Ranged combat weeeeeeee
Working on some costumes/new models for my gamemode.
I made the leather jacket model, but since I also made the costume script, I thought you'd might like it as well.
btw I'm getting help on modelling and you can check out my progress over at the models wip/pimpage thread, so that's not the final model.
That's Awesome, It's hard to tell, But is the jacket Ripped and Torn a little? Or is that just model clipping?
Wanted to do a batman cape or something similar.
So I tried to implement some cloth physics.
It works surprisingly well and lags a lot less than I expected.
You can set some parameters for it such as elasticity, air friction and gravity but they are kind of sensitive.
One decimal too much and it will spazz all over the place.![]()