[QUOTE=MPan1;52780911]Doesn't that mean OBB is always going to be better and more accurate for every map?[/QUOTE]
9/10 times, yes. Accurate isn't the right term, but OBB is usually what you would want.
[QUOTE=Revenge282;52780912]9/10 times, yes. Accurate isn't the right term, but OBB is usually what you would want.[/QUOTE]
[URL="https://github.com/Facepunch/garrysmod/search?utf8=%E2%9C%93&q=SOLID_OBB"]Why doesn't Garry's Mod ever use it though?[/URL]
[editline]15th October 2017[/editline]
[URL="https://github.com/Facepunch/garrysmod/search?utf8=✓&q=SOLID_BBOX"]It uses SOLID_BBOX way more[/URL]
[QUOTE=MPan1;52780911]Doesn't that mean OBB is always going to be better and more accurate for every map?[/QUOTE]
I think it's just that in some cases you want grid-aligned and rotationless physics. Player physics are grid-aligned for example. It also makes physics less expensive but that's usually not something you need to worry about.
[editline]15th October 2017[/editline]
[QUOTE=MPan1;52780917][URL="https://github.com/Facepunch/garrysmod/search?utf8=%E2%9C%93&q=SOLID_OBB"]Why doesn't Garry's Mod ever use it though?[/URL]
[editline]15th October 2017[/editline]
[URL="https://github.com/Facepunch/garrysmod/search?utf8=✓&q=SOLID_BBOX"]It uses SOLID_BBOX way more[/URL][/QUOTE]
Because it uses VPHYSICS for model-based physics. There just aren't any ents that need to act like boxes but don't have the models of boxes.
OBB is noticeably more expensive for complex physics. BBOX is way better for physics like rolling since it just has to manage the collision model and keep the bounds aligned to the world.
Hey, Im trying to draw a progress bar above an entity. The problem is tho that it gets drawn on all "poop" entities when I want it to draw only at the entity you're looking at is there any simple fix for this ?
[CODE] cam.Start3D2D(pos + offsets, ang, 0.13)
if tr.Entity.PrintName == "Poop" and input.IsKeyDown(KEY_E) then
progress = Lerp(FrameTime() * 1, progress, 100)
surface.SetDrawColor(255, 255, 255, 250)
surface.DrawOutlinedRect(-51, -101, 102, 32)
draw.RoundedBox(0, -50, -100, 100, 30, Color(0, 0, 0, 250))
draw.RoundedBox(0, -50, -100, progress, 30, Color(139, 69, 19, 250))
if progress > 97 then
net.Start("zPoopRemoveEntity")
net.WriteEntity(LocalPlayer():GetEyeTrace().Entity)
net.SendToServer()
end
else
progress = 0
end
cam.End3D2D()[/CODE]
[QUOTE=Shendow;52782032]Also when is the best moment to call [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/game/MountGMA]game.MountGMA[/url]?
I call it multiple times (with 2 seconds between) on the client InitPostEntity but it seems to generate some crashes. Some of the GMA's are moderately big (60~ MB) so I thought maybe loading too much at once may crash the client but delaying doesn't particularly help.[/QUOTE]
I would say Initialize -- I personally haven't experienced any crashes with doing them all there without delay.
[QUOTE=code_gs;52779842]Copy it, I guess.[/QUOTE]
Sorry for long reply dumb question what file i put it it?
[QUOTE=RasmusG5;52784271]Sorry for long reply dumb question what file i put it it?[/QUOTE]
Just implement the functions into the entity you need it in.
Is there any way to detect and stop crossbow bolts from getting lodged in a SENT?
Is there a way to find from what addon a file is loaded (lua, model, meterial, maps ....) in the virtual filesystem ?
[QUOTE=MPan1;52787805]Is there any way to detect and stop crossbow bolts from getting lodged in a SENT?[/QUOTE]
You could do some real hacky stuff like remove the bolt when it's too close to the SENT.
[editline]17th October 2017[/editline]
[QUOTE=guigui;52788659]Is there a way to find from what addon a file is loaded (lua, model, meterial, maps ....) in the virtual filesystem ?[/QUOTE]
You can do a file.Find for the file; not sure if there's a more accurate way.
[QUOTE=guigui;52788659]Is there a way to find from what addon a file is loaded (lua, model, meterial, maps ....) in the virtual filesystem ?[/QUOTE]
Use the "whereis" console command, e.g.
[quote]
] whereis lua/pac3/editor/client/translations/turkish.lua
'PAC3' - c:\program files (x86)\steam\steamapps\common\garrysmod\garrysmod\addons\pac3_104691717.gma
[/quote]
-snip- nvm I'm dumb
Not really a problem but more of a question. I am running Facepunch Cinema and Mezzokoko came up with the idea of having posters in the lobby of the cinema so we can always remember the movies we have watched in the past.
So i had the idea of making a entity that would let admins load up a jpg/png onto something like a frame like a poster so others can see what we have watched earlier.
Now i know Java and C# but I am clueless when it comes to LUA or the gmod library, is it worth it for me to learn LUA just for that small addon or should i just make a job out of it for gmodstore?
Learning Lua is always worth it. The more people know it the better.
[QUOTE=darth-veger;52792193]Not really a problem but more of a question. I am running Facepunch Cinema and Mezzokoko came up with the idea of having posters in the lobby of the cinema so we can always remember the movies we have watched in the past.
So i had the idea of making a entity that would let admins load up a jpg/png onto something like a frame like a poster so others can see what we have watched earlier.
Now i know Java and C# but I am clueless when it comes to LUA or the gmod library, is it worth it for me to learn LUA just for that small addon or should i just make a job out of it for gmodstore?[/QUOTE]
Btw, Lua is NOT an acronym. It does not stand for anything.
[QUOTE=MelonShooter;52792434]Btw, Lua is NOT an acronym. It does not stand for anything.[/QUOTE]
Love me some of that L.U.A.
Somehow this will crash my pc whenever I try to execute it
[CODE]while caller.inbed == true and caller:Health() <= 100 do
caller:SetHealth(caller:Health() + 0.1)
end[/CODE]
[QUOTE=MGFear;52792754]Somehow this will crash my pc whenever I try to execute it
[CODE]while caller.inbed == true and caller:Health() <= 100 do
caller:SetHealth(caller:Health() + 0.1)
end[/CODE][/QUOTE]
Doesn't Entity:SetHealth() only take integer values, or am I dumb? It might floor off
[QUOTE=IceGT_;52792834]Doesn't Entity:SetHealth() only take integer values, or am I dumb? It might floor off[/QUOTE]
yep you were right, also, how can I make the HP be added slower?
[QUOTE=MGFear;52792888]yep you were right, also, how can I make the HP be added slower?[/QUOTE]
Depends how you're adding it. If you're using a Think hook you could use CurTime.
[QUOTE=txike;52792906]Depends how you're adding it. If you're using a Think hook you could use CurTime.[/QUOTE]
I have it in my entity use function,
[CODE]while caller.inbed == true and caller:Health() < 100 do
timer.Simple(3, function() caller:SetHealth(caller:Health() + 1) end)
end[/CODE]
tried this but this crashed my game then
[QUOTE=MGFear;52792913]I have it in my entity use function,
[CODE]while caller.inbed == true and caller:Health() < 100 do
timer.Simple(3, function() caller:SetHealth(caller:Health() + 1) end)
end[/CODE]
tried this but this crashed my game then[/QUOTE]
It's crashing your game because your while loop is going to continue forever. Because the while loop is on the same thread as the one that executes the timers, they'll never execute. You should probably use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/timer/Create]timer.Create[/url] and no while loop for this.
[QUOTE=bigdogmat;52793214]It's crashing your game because your while loop is going to continue forever. Because the while loop is on the same thread as the one that executes the timers, they'll never execute. You should probably use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/timer/Create]timer.Create[/url] and no while loop for this.[/QUOTE]
But the while loop perfectly meets the requirements for what i want to do, what else should I use then?
[QUOTE=MGFear;52793361]But the while loop perfectly meets the requirements for what i want to do, what else should I use then?[/QUOTE]
The while loop only works if what you want to do can be done in a single execution. As I said use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/timer/Create]timer.Create[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/timer/Simple]timer.Simple[/url].
I guess I'd use the latter, e.g.
[code]
local function addHealth()
if not caller:IsValid() then return end
if caller:Health() < 100 then
caller:SetHealth(caller:Health() + 1)
timer.Simple(3, addHealth)
end
end
addHealth()
[/code]
This would add 1 to your health immediately, then continue adding 1 every 3 seconds until you're at 100.
-snip- Didn't notice the second page
[QUOTE=MGFear;52793361]But the while loop perfectly meets the requirements for what i want to do, what else should I use then?[/QUOTE]
[lua]
while (ply:Health() < 100) do
ply:SetHealth(ply:Health() + 1)
end
[/lua]
That won't crash the game, but that's not what you want to do
Also, you should use GetMaxHealth instead of hard-coding 100.
In DListView, a scrollbar appears when your list goes taller than the frame/panel it is in. I've managed to hide it from appearing, but now I am having a problem with the right side going wider as if the scrollbar is still appearing and hiding. So I am wondering, is there a a way to make the scrollbar permanently appear or is there a way to disable the scrollbar (I know DListView:DisableScrollbar() is a thing) and keep scrolling with the mouse wheel?
If you need anymore information like screenshots or the piece of code for DListView, then just say.
[QUOTE=FireWolf2525;52795776]In DListView, a scrollbar appears when your list goes taller than the frame/panel it is in. I've managed to hide it from appearing, but now I am having a problem with the right side going wider as if the scrollbar is still appearing and hiding. So I am wondering, is there a a way to make the scrollbar permanently appear or is there a way to disable the scrollbar (I know DListView:DisableScrollbar() is a thing) and keep scrolling with the mouse wheel?
If you need anymore information like screenshots or the piece of code for DListView, then just say.[/QUOTE]
My guess is you have to do it manually, storing the position of each element and moving them up yourself whenever you detect mouse wheel input WHILE the person is on the panel.
Sorry, you need to Log In to post a reply to this thread.