[QUOTE=WalkingZombie;47565645]-snip-[/QUOTE]
i think you can feed it a vector relative the player ( get the hand bone ) and toy around with it for a bit. Alternatively, you could make the effect your self and do it the same way i just described.
[QUOTE=robbert^^;47567242]i think you can feed it a vector relative the player ( get the hand bone ) and toy around with it for a bit. Alternatively, you could make the effect your self and do it the same way i just described.[/QUOTE]
I still need to manage thirdperson separately from firstperson, though... how?
Thirdperson / Firstperson do not lineup at all, but I need to have a good attachment for both viewpoints, even for the local player in case they go third person. I'm not using helicopter gun viewmodel / worldmodel, but rather what I've done using Swep Construction Kit, which is the only reason I need to do any of this anyway. My method for getting the bullets to look like they're coming from the muzzle will never be good enough to line it up perfectly.
[editline]21st April 2015[/editline]
Basically, I have no idea how to check if the player is in first person or not, so I ask if anybody can help me out with that?
Is there a way to change the color of a RichText's scrollbar?
What's dumb with that statement?
[editline]21st April 2015[/editline]
Seriously???
[QUOTE=Luni;47572992]Is there a way to change the color of a RichText's scrollbar?[/QUOTE]
[IMG]http://i.imgur.com/1H79hev.png[/IMG]
[lua]
-- Example RichText panel from wiki
local frame = vgui.Create( "DFrame" )
frame:SetSize( 200, 150 )
frame:Center()
frame:MakePopup()
local richtext = vgui.Create( "RichText", frame )
richtext:Dock( FILL )
richtext:InsertColorChange( 192, 192, 192, 255 )
richtext:AppendText( "This \nRichText \nis \n" )
richtext:InsertColorChange( 255, 255, 224, 255 )
richtext:AppendText( "AWESOME\n\n" )
richtext:InsertColorChange( 255, 64, 64, 255 )
richtext:AppendText( "#ServerBrowser_ESRBNotice" )
-- Muh Children
local function GetRichTextScrollBar(richtext)
for k, v in pairs(richtext:GetChildren()) do
if v:GetClassName() == "ScrollBar" then
return v
end
end
end
local function GetScrollBarElements(scrollbar)
local slider, btnup, btndown
for k, v in pairs(scrollbar:GetChildren()) do
if v:GetClassName() == "ScrollBarSlider" then
slider = v
elseif v:GetClassName() == "Button" then
if v:GetName() == "UpButton" then
btnup = v
elseif v:GetName() == "DownButton" then
btndown = v
end
end
end
return slider, btnup, btndown
end
local sbar = GetRichTextScrollBar(richtext)
local slider, btnup, btndown = GetScrollBarElements(sbar)
-- Style as you wish, example:
local function paintwhite(pnl, w, h)
surface.SetDrawColor(color_white)
surface.DrawRect(0, 0, w, h)
end
local function paintblack(pnl, w, h)
surface.SetDrawColor(color_black)
surface.DrawRect(0, 0, w, h)
end
btnup.Paint = paintwhite
btndown.Paint = paintwhite
slider.Paint = paintblack
[/lua]
-snip-
Is there a way to disallow a npc_cscanner from taking photos? I tried e:SetSaveValue("m_fNextPhotographTime", CurTime() + 10) in a think hook, which according to line 52 on [url]https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/hl2/npc_scanner.cpp[/url] should prevent the scanner from ever setting COND_CSCANNER_CAN_PHOTOGRAPH, but it does not seem to work.
How on earth does matproxy.Add work? So you've created the "proxy" but where do you get it to be applied to anything? It doesn't even print things in test code to the console for me.
Seriously now... how can I check if the LocalPlayer() is in firstperson or thirdperson perspective?
[QUOTE=WalkingZombie;47577110]Seriously now... how can I check if the LocalPlayer() is in firstperson or thirdperson perspective?[/QUOTE]
Seeing as the only difference between first and thirdperson is the camdata, I think you could work around by checking if the local player's player model is being drawn.
You think it would be possible to have Inverse Kinematics (Feet adjusting to uneven ground) on Gmod playermodels? Would I have to go into the QC files to do that?
I'm trying to use custom fonts, but the only way that these "Works" it's by just installing these manually
I'm missing something than just resource.AddFile and then CreateFont?
[QUOTE=pilot;47577128]You think it would be possible to have Inverse Kinematics (Feet adjusting to uneven ground) on Gmod playermodels? Would I have to go into the QC files to do that?[/QUOTE]
Wow... I come back to the chat and you post exactly what was just in my mind. The shock is real. I was thinking it would have to be done in a think function or something, but it might be a little bit CPU intensive... a trace down from the frontmost and rearmost part of each foot; that's 2 traces per foot, and then some nice manually written math to figure what angle the foot should be at... of course, if one trace is excessively longer than the other, there would have to be a clamp involved, even inversion to make it so the player's standing on the edge with their toes.
The reason I say two is cus if there was just a center trace for both feet, they would look so weird when a player's on a stairway. It's a questionable manner as far as priority AND performance are concerned... thinking more about it, it would be very interesting if it was written that if one of the player's feet was in the air too long they would fall, among other sensible balance-related causes.
Is this something I can do? Well, it would take me FOREVER if I tried. It'd be a learning experience for me, but I really have no interest in doing it, sorry.
Possible method for rotating the feet: [URL="http://wiki.garrysmod.com/page/Entity/ManipulateBoneAngles"]ENT:ManipulateBoneAngles( BoneID, Ang )[/URL]
[editline]22nd April 2015[/editline]
[URL="http://wiki.garrysmod.com/page/Entity/ManipulateBonePosition"]ENT:ManipulateBonePosition( BoneID, Pos )[/URL] for vertical offset... forgot that
[editline]22nd April 2015[/editline]
I only say this in case anyone actually wanted to write a script to do it... or in case I decide to do it sometime.
Not sure if anyone else has had this issue with DarkRP, but I've been trying to disable selling vehicles for the past hour and can't find the correct hooks and functions, does anyone know how to do this?
[QUOTE=gonzalolog;47577389]I'm trying to use custom fonts, but the only way that these "Works" it's by just installing these manually
I'm missing something than just resource.AddFile and then CreateFont?[/QUOTE]
Folder structure?
[lua]kf_hud/resource/fonts/Typo Grotesk Rounded.otf[/lua]
should i put the font inside garrysmod/resource/fonts?
Is there a known culprit for this?
[video=youtube;KLTctPkBZAU]http://www.youtube.com/watch?v=KLTctPkBZAU&feature=youtu.be[/video]
Honestly this is driving me crazy, the shadows just flicker uncontrollably, and even more so when I'm not recording (for whatever reason when I turned fraps on it seemed to stop or lessen the effect.).
Methinks it might be Atmos?
[QUOTE=gonzalolog;47578129][lua]kf_hud/resource/fonts/Typo Grotesk Rounded.otf[/lua]
should i put the font inside garrysmod/resource/fonts?[/QUOTE]
That looks fine. Since you're not using workshopdl and the fonts work after they're installed, I don't see a flaw.
Maybe verify that the font as viewed in the windows font viewer (see below) has the same name as your CreateFont? Though since it works when installed, I don't understand.
[t]http://i.imgur.com/jCeA2Ue.png[/t]
Would anyone know perhaps how to do vector reflection using two traces? I got sort of close, but it isn't accurate at all.
[thumb]http://images.akamai.steamusercontent.com/ugc/717539123122492236/0FC05DDAD8208698B398540F2263CF4B0FE618B5/[/thumb]
[QUOTE=Llamalord;47580555]Would anyone know perhaps how to do vector reflection using two traces? I got sort of close, but it isn't accurate at all.
[thumb]http://images.akamai.steamusercontent.com/ugc/717539123122492236/0FC05DDAD8208698B398540F2263CF4B0FE618B5/[/thumb][/QUOTE]
edit: disregard that. thought about something else.
[QUOTE=Llamalord;47580555]Would anyone know perhaps how to do vector reflection using two traces? I got sort of close, but it isn't accurate at all.
[thumb]http://images.akamai.steamusercontent.com/ugc/717539123122492236/0FC05DDAD8208698B398540F2263CF4B0FE618B5/[/thumb][/QUOTE]
You want to draw a line between two hit points of two tracers? Or you just want the normal between the two hit positions?
If you want the normal, you can do it like so:
[code]( HitPos1 - HitPos2 ):GetNormalized()[/code]
You may need to swap HitPos1 and HitPos2 around.
[QUOTE=pilot;47577128]You think it would be possible to have Inverse Kinematics (Feet adjusting to uneven ground) on Gmod playermodels? Would I have to go into the QC files to do that?[/QUOTE]
Wasn't there a function that let you enable it?
[QUOTE=Robotboy655;47580791]You want to draw a line between two hit points of two tracers? Or you just want the normal between the two hit positions?
If you want the normal, you can do it like so:
[code]( HitPos1 - HitPos2 ):GetNormalized()[/code]
You may need to swap HitPos1 and HitPos2 around.[/QUOTE]
More like using the angle of the trace from the entity combined with the HitPos of the trace to draw where the next line trace's endpos should be with the start pos being the HitPos of the first trace.
[thumb]http://i.imgur.com/OCcvYMn.jpg[/thumb]
[thumb]http://i.imgur.com/8AzdjeX.jpg[/thumb]
[code]local Trace1Dot = Trace1.HitNormal:DotProduct( Trace1.HitPos )
(TraceTwo's EndPos) local EndPos = (Trace1.HitPos * Trace1Dot)[/code]
This works semi-correctly but only projects and 90 degree angle either up or down.
Sort of like this:
[img]http://www.3dkingdoms.com/weekly/vectors2.gif[/img]
[QUOTE=Llamalord;47584399]More like using the angle of the trace from the entity combined with the HitPos of the trace to draw where the next line trace's endpos should be with the start pos being the HitPos of the first trace.
[thumb]http://i.imgur.com/OCcvYMn.jpg[/thumb]
[thumb]http://i.imgur.com/8AzdjeX.jpg[/thumb]
[code]local Trace1Dot = Trace1.HitNormal:DotProduct( Trace1.HitPos )
(TraceTwo's EndPos) local EndPos = (Trace1.HitPos * Trace1Dot)[/code]
This works semi-correctly but only projects and 90 degree angle either up or down.
Sort of like this:
[img]http://www.3dkingdoms.com/weekly/vectors2.gif[/img][/QUOTE]
[url]https://www.cs.unc.edu/~rademach/xroads-RT/RTarticle.html[/url]
[code]
c1 = -dot_product( N, V )
Rl = V + (2 * N * c1 )[/code]
Where N is the HitNormal, V is the Original trace ( I am assuming direction ) and Rl is the resulting direction.
Hi all. I am trying to spawn a number of NPC's in a small area, but they are instantly dying if they spawn on top of each other. Is there a way to check that a spawn vector will be valid before they actually spawn?
[QUOTE=101kl;47585145]Hi all. I am trying to spawn a number of NPC's in a small area, but they are instantly dying if they spawn on top of each other. Is there a way to check that a spawn vector will be valid before they actually spawn?[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/PointContents]util.PointContents[/url]
Trying to draw a 3D2D bar, but it clips when there is a parented prop in the background or foreground. Not really sure if I can work around this, or I if there is a fix. Any pointers?
[IMG]http://i.imgur.com/Fkmq7mf.jpg[/IMG]
The desk itself is the solid prop. Everything else is parented to that. Here is one of the many props I have parented. They follow the same layout, just different positions:
[lua] local jar = ents.Create('prop_physics')
jar:SetModel('models/props_lab/jar01b.mdl')
jar:SetParent(self)
jar:SetMoveType(MOVETYPE_NONE)
jar:SetAngles(ang + Angle(0,90,0))
jar:SetPos(self:GetPos() + self:GetRight()*48 + self:GetUp()*23 + self:GetForward()*10)[/lua]
Any help is appreciated.
Also, I feel the need to say that; no, the bar is not actually positioned to be behind those props. It's actually in front of all of them.
You can use cam.IgnoreZ(true) to draw the bar over everything, except it will literally draw over everything.
The other option is to manually draw all of the props you are using in the order you want then draw the bar last so its on top of the props but not on top of everything in the game.
Otherwise you might need to resort to stencils or scissor rects or something.
[QUOTE=G4MB!T;47588432]You can use cam.IgnoreZ(true) to draw the bar over everything, except it will literally draw over everything.
The other option is to manually draw all of the props you are using in the order you want then draw the bar last so its on top of the props but not on top of everything in the game.
Otherwise you might need to resort to stencils or scissor rects or something.[/QUOTE]
How can I draw all the props in an order where the bar is last if the bar is drawn clientside while the props are created serverside? Unless I can replicate what I have with the props clientside.
I may just work around it, It's not too big of an issue. Thanks for the reply!
WELL good point. I'm not sure you can handle prop rendering if the entity is server side, but if worse comes to worse you could make your own entity system where you have the position, angle and model networked to the client and use ClientSideModel on the client where you can then control draw order.
Personally, and for practicality, cam.IgnoreZ would probably do what you want but it might have some undesirable side effects (i.e. Rendering through players and brushes).
Sorry, you need to Log In to post a reply to this thread.