[QUOTE=TwoYearLurker;47253715][code]yourentity:GetPhysicsObject():SetMass(250)[/code]
The gravity gun can't lift anything with a mass higher than 250, so just set it to that number or less.
I checked, though, and the model you're using doesn't actually have a bottom since it was never supposed to move, so if players are going to be picking it up and stuff you might want to use something else.[/QUOTE]
Thank you very much =)
I was planning on using a 3d2d rectangle to cover the hole in the bottom of the model.
[QUOTE=MeepDarknessM;47256056]quotes[/QUOTE]
[QUOTE=G4MB!T;47253212]What I really need is the angle that the brush is at which is weird to do I know.[/QUOTE]
The best way I can describe the behaviour I want is to say that I want brush doors to behave the same was as model doors. I know this cannot happen automatically since brushes have no orientation.
I cannot align a 3D2D UI to all brush doors because doors that spawn at 90 degrees have the UI going through them. I guess I'm sort of answering my own question by saying it cant be done :(
Edit: Damn you Evocity. An alternate way I could do this is to have a 3D2D UI for model doors and just a 2D UI for brush doors but thats so gross I wish I didnt think of it.
[QUOTE=G4MB!T;47259522]The best way I can describe the behaviour I want is to say that I want brush doors to behave the same was as model doors. I know this cannot happen automatically since brushes have no orientation.
I cannot align a 3D2D UI to all brush doors because doors that spawn at 90 degrees have the UI going through them. I guess I'm sort of answering my own question by saying it cant be done :(
Edit: Damn you Evocity. An alternate way I could do this is to have a 3D2D UI for model doors and just a 2D UI for brush doors but thats so gross I wish I didnt think of it.[/QUOTE]
Can you replace the brush doors with model doors? And what Evocity are you running?
I am on v33x and I haven't an issue with anything on my properties with door text.
I agree, which one are you running. I've had no trouble aligning anything to any of the doors in evocity v33x, or v2p. That also includes replacing brush elevators with Lua controlled elevators.
There's always a way. Brushes, however, may be at rotation 0 0 0 so you may need to have an alternative offset method for them.
How does one hide the yellow sound icon above someone's head when they start using voice chat? I thought I'd seen it on here before but can't find it.
[QUOTE=Revenge282;47259714]Can you replace the brush doors with model doors? And what Evocity are you running?
I am on v33x and I haven't an issue with anything on my properties with door text.[/QUOTE]
I am using v4b1. If I stick to a 2D UI (i.e Drawing the door name in HUDPaint with drawn.SimpleText or something), it works fine for ALL doors, model and brush. But as soon as I want to use a 3D UI in PostDrawTranslucentRenderables, I get alignment problems. I'll get some screenshots.
[B]Edit: Pictures[/B]
[t]http://cloud-4.steamusercontent.com/ugc/44246453282321772/B6B71F2AE2B86455BE71B2E3AC36DD2A51F75954/[/t]
[t]http://cloud-4.steamusercontent.com/ugc/44246453282322291/7538A38D571899AF1AAC85E2F48AB1B3A7527BCA/[/t]
As you can probably see, the "Skyscraper" text is nicely aligned, but the "Clothes Store" is at 90 degrees. The doors are 90 degrees to each other in the map and I cant make the text rotate to each one using 3D2D. If I use a 2D UI it works fine.
Halp pls!
[QUOTE=isjason;47236071]Im trying to make a simple counter for the amount of games a player has on TTT.. But every time the map resets, it recreates their record instead of adding to the previously added record.
[CODE]
hook.Add("TTTBeginRound", "GMGC.TTTBeginRound", function()
for k, ply in pairs(player.GetAll()) do
if ply:GetObserverMode() == OBS_MODE_NONE and ply:SteamID() != "BOT" then
local UID = ply:UniqueID()
if not GMGC.Counter[UID] then
local Data = {}
Data.Games = 1
Data.DisplayCount = false
GMGC.Counter[UID] = Data
else
GMGC.Counter[UID].Games = GMGC.Counter[UID].Games + 1
end
end
GMGC.SaveLog()
end
end)
[/CODE]
I've checked out the text file I save the data in and I see the unique ID appear more than once..[/QUOTE]
Code for GMGC.SaveLog?
How to properly clear a vgui DFrame? If I clear it with Panel:Clear() and then draw the new stuff on it, gmod gives me an error:
[code][ERROR] lua/vgui/dframe.lua:256: Tried to use invalid object (type Panel) (Object was NULL or not of the right type)
1. SetPos - [C]:-1
2. unknown - lua/vgui/dframe.lua:256
[/code]
[lua]panel:Remove()[/lua]
Then just create a new one.
I'd recommend keeping track of the data you have. Managing a list is cheaper than clearing and re-creating it each time something changes.
If you want something to make developing vgui "easier" take a look at this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_utilities/concommand_clearvgui.lua[/url]
Add it to your addons, client-side. It'll let you remove any existing vgui panels...
[QUOTE=G4MB!T;47261509]I am using v4b1. If I stick to a 2D UI (i.e Drawing the door name in HUDPaint with drawn.SimpleText or something), it works fine for ALL doors, model and brush. But as soon as I want to use a 3D UI in PostDrawTranslucentRenderables, I get alignment problems. I'll get some screenshots.
[B]Edit: Pictures[/B]
[t]http://cloud-4.steamusercontent.com/ugc/44246453282321772/B6B71F2AE2B86455BE71B2E3AC36DD2A51F75954/[/t]
[t]http://cloud-4.steamusercontent.com/ugc/44246453282322291/7538A38D571899AF1AAC85E2F48AB1B3A7527BCA/[/t]
As you can probably see, the "Skyscraper" text is nicely aligned, but the "Clothes Store" is at 90 degrees. The doors are 90 degrees to each other in the map and I cant make the text rotate to each one using 3D2D. If I use a 2D UI it works fine.[/QUOTE]
As a last resort, if you can't get it working the way you want, you could always just manually save a flag for the relevant labels that they should be rotated 90 degrees, and of course make the 3D2D rendering part accommodate.
[QUOTE=Neat-Nit;47266110]As a last resort, if you can't get it working the way you want, you could always just manually save a flag for the relevant labels that they should be rotated 90 degrees, and of course make the 3D2D rendering part accommodate.[/QUOTE]
As much as I appreciate the help, I'd really rather not do that especially because A: There are a lot of brush doors and B: If I change map I have to go through and redo all of the labels again.
I had a thought though, can I get the angle knowing the mins, maxs and center? I suck at math and I'm even worse at vector math, so basically if I can calculate some sort of pseudo angle or something so that I can fix the rotation for brush doors that might solve the problem.
[QUOTE=G4MB!T;47266158]As much as I appreciate the help, I'd really rather not do that especially because A: There are a lot of brush doors and B: If I change map I have to go through and redo all of the labels again.[/QUOTE]
Don't you have to do that anyway? How do you attach the correct label to each door for each map?
Anyway to increase the maximum length of a messaged typed into the default chat? I wanted to avoid making a whole new GUI for a custom chat, but I'll do it if the default has its max character length hard-coded.
[QUOTE=Neat-Nit;47266273]Don't you have to do that anyway? How do you attach the correct label to each door for each map?[/QUOTE]
Its done automatically?
[QUOTE=G4MB!T;47261509]I am using v4b1. If I stick to a 2D UI (i.e Drawing the door name in HUDPaint with drawn.SimpleText or something), it works fine for ALL doors, model and brush. But as soon as I want to use a 3D UI in PostDrawTranslucentRenderables, I get alignment problems. I'll get some screenshots.
[B]Edit: Pictures[/B]
[t]http://cloud-4.steamusercontent.com/ugc/44246453282321772/B6B71F2AE2B86455BE71B2E3AC36DD2A51F75954/[/t]
[t]http://cloud-4.steamusercontent.com/ugc/44246453282322291/7538A38D571899AF1AAC85E2F48AB1B3A7527BCA/[/t]
As you can probably see, the "Skyscraper" text is nicely aligned, but the "Clothes Store" is at 90 degrees. The doors are 90 degrees to each other in the map and I cant make the text rotate to each one using 3D2D. If I use a 2D UI it works fine.[/QUOTE]
[vid]http://puu.sh/go8Uq/642f3a2e70.webm[/vid]
[QUOTE=G4MB!T;47266345]Its done automatically?[/QUOTE]Well, here depletes my limited-to-nonexistent knowledge of how this kind of thing works. Best of luck! :suicide:
[QUOTE=Revenge282;47266381][vid]http://puu.sh/go8Uq/642f3a2e70.webm[/vid][/QUOTE]
If you go to the skyscraper doors or any doors that are naturally 90 degrees to those and it works I'll beg you for the solution D:
[QUOTE=zerf;47239258]
- Trying to get a chair to work -
[/QUOTE]
[t]http://i.imgur.com/asY6eYX.png[/t]
HAHAHA I JUST HAVE TO SET ATTACHMENTS ON THE MODEL HAHAHAHA
[editline]hfea[/editline]
[t]http://i.imgur.com/hQA00EE.jpg[/t]
A [del]step[/del] sit in the [del]right[/del] wrong direction
[editline]yaaaay[/editline]
[t]http://i.imgur.com/20CpVmk.jpg[/t]
Hurrah
So with the HUD I'm making I don't why but I'm having a brain fart on how to have it size for different resolutions.
[QUOTE=insanezanes;47267131]So with the HUD I'm making I don't why but I'm having a brain fart on how to have it size for different resolutions.[/QUOTE]
Use multiplication or division in conjunction with these functions.
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/ScrW]Global.ScrW[/url]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/ScrH]Global.ScrH[/url]
So I have that down how about like setting the position to be at the same place on the screen on every screen. Also what about setting the text to move where shape is.
How could I perfectly reflect a vector off a plane? _\/_
Where hypothetically there is a face rotated at 45 degrees, and a vector comes in at 55 degrees, the vector would reflect off of it at a 35 degree angle I think. If a vector came in at 90 degrees and hit the 45 degree face it would reflect to 0 degrees. I need to calculate this all in 3D and I'd prefer not to have the need to convert everything to angles then back to vectors.
[QUOTE=insanezanes;47267131]So with the HUD I'm making I don't why but I'm having a brain fart on how to have it size for different resolutions.[/QUOTE]
Here you go:
[url=https://dl.dropboxusercontent.com/u/26074909/tutoring/hud/proper_hud_creation.lua.html]Proper Hud Creation[/url] ( Shows which functions to check, how to hide / display other elements, etc )...
[url=https://dl.dropboxusercontent.com/u/26074909/tutoring/hud/understanding_hardcoding_of_screensizes.lua.html]Scaling HUD Elements[/url] - Shows how to hard-code positions / sizes and how to add a modifier to make the HUD Scale properly.
And an example:
[url=https://dl.dropboxusercontent.com/u/26074909/tutoring/hud/basic_healthbar.lua.html]Example Health-Bar[/url] - Shows 2 examples, one without scaling modifiers, and one with.
Remove .html to view / copy .lua...
Is there a way to create a sound object, and then check what its current playing volume is at? Not what volume it was set to play at when creating the object - but how loud it is relatively, similar to VoiceVolume()
What is wrong with this recoil code? Seems to be extremely broken, to the point that the player's pitch can actually go way beyond where it should. How can I clamp this?
[code]
local tmprecoilang2 = Angle(math.Rand(self.Primary.KickDown,self.Primary.KickUp) * recoil, math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal) * recoil, 0)
local eyes = self.Owner:EyeAngles()
eyes:RotateAroundAxis(eyes:Right(), tmprecoilang2.p)
eyes:Normalize()
eyes:RotateAroundAxis(eyes:Up(), tmprecoilang2.y)
eyes:Normalize()
self.Owner:SetEyeAngles(eyes)
[/code]
[QUOTE=WalkingZombie;47267190]How could I perfectly reflect a vector off a plane? _\/_
Where hypothetically there is a face rotated at 45 degrees, and a vector comes in at 55 degrees, the vector would reflect off of it at a 35 degree angle I think. If a vector came in at 90 degrees and hit the 45 degree face it would reflect to 0 degrees. I need to calculate this all in 3D and I'd prefer not to have the need to convert everything to angles then back to vectors.[/QUOTE]
I'll draw this out and give you the answer.
[editline]google[/editline]
Google came up with this:
R=V−2N(V⋅N)
R = reflected vector
V = Input Vector
N = Plane Normal
So
[lua]
function math.VectorReflect(vec,norm)
local ref = vec - 2 * norm * vec:Dot(norm)
return ref
end
[/lua]
Sorry, you need to Log In to post a reply to this thread.