[QUOTE=Neat-Nit;49953568]People complain about EVERY change, dammit. That's just a fact of life.[/QUOTE]
Well they also caused a lot of crashes at first too so there's that.
So when is vehicle crazy physics getting fixed. I can't drive a car without someone punting it and it disappearing
[QUOTE=LUModder;49955329]So when is vehicle crazy physics getting fixed. I can't drive a car without someone punting it and it disappearing[/QUOTE]
What's output in to the server's console when that happens?
Could someone fix EntityFireBullets?
[QUOTE=DavidRalphsky;49956003][lua]
hook.Add("EntityFireBullets","FireBulletsTest",function(ply,tbl)
print(tbl.Damage)
end)
[/lua]
Prints 0 in console. PrintTable-ing tbl gives something similar to
[lua]
AmmoType = Pistol
Attacker = [NULL Entity]
Damage = 0
Dir = 0.073956 -0.901247 -0.426948
Distance = 56755.83984375
Force = 1
HullSize = 0
Num = 1
Spread = 0.008730 0.008730 0.008730
Src = -314.517700 -1836.989746 -12192.468750
Tracer = 2
[/lua]
Why is this?[/QUOTE]
It seems to be only returning the right damage if a SWEP dealt the damage
[QUOTE=Giraffen93;49952913]confirmed with a bunch of other people; mounting a gma with car models in it on already error spawned cars crashes the client 100% of the time
i guess this was brought up earlier though?[/QUOTE]
I have already reported this times ago, it may also happen with playermodels sometimes.
Err, is [url=http://wiki.garrysmod.com/page/Global/EyePos]Global.EyePos[/url] broken?
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
Each one was run after I moved. This was on gm_black_v2, so I ran "map gm_construct" and proceeded to run the same command.... and it gave me the same result. the same vector as before, even though an entirely different map has been loaded and everything should have been reset.
Quit, switch back to live (I was on dev before), open sandbox on gm_construct and:
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
(again all run when I was somewhere else physically)
Errr I'm not sure why I'm even posting this here. I should go to garrysmod-issues.
[QUOTE=Neat-Nit;49957704]Err, is [url=http://wiki.garrysmod.com/page/Global/EyePos]Global.EyePos[/url] broken?
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
] lua_run_cl print(EyePos())
-168.668472 -159.448578 498.378235
Each one was run after I moved. This was on gm_black_v2, so I ran "map gm_construct" and proceeded to run the same command.... and it gave me the same result. the same vector as before, even though an entirely different map has been loaded and everything should have been reset.
Quit, switch back to live (I was on dev before), open sandbox on gm_construct and:
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
] lua_run_cl print(EyePos())
0.000000 0.000000 0.000000
(again all run when I was somewhere else physically)
Errr I'm not sure why I'm even posting this here. I should go to garrysmod-issues.[/QUOTE]
Works here, vanilla Dev branch.
[code]] lua_run_cl print(EyePos())
845.221313 551.926086 -79.968750
] lua_run_cl print(EyePos())
511.613342 92.342567 -85.184128
] lua_run_cl print(EyePos())
258.032898 49.622017 -52.993706
[/code]
Keep in mind the function returns the [b]camera[/b] position of the local player, i.e. where the view is, not like eye position on the player model or something, that's what Player.GetShootPos() is for.
It seems to be random whether this works or not.
[quote]] bind - "lua_run_cl print('Global:', EyePos(), '\nPlayer:', LocalPlayer():EyePos(),'\n')"
Global: -210.724777 189.202148 42.346184
Player: -676.209351 2868.194092 634.131836
Global: -210.724777 189.202148 42.346184
Player: -1580.482300 2907.824219 877.810913
Global: -210.724777 189.202148 42.346184
Player: -1580.560791 1969.136475 777.315063
Global: -210.724777 189.202148 42.346184
Player: -1626.667847 1120.655151 698.666138
Global: -210.724777 189.202148 42.346184
Player: -2154.263184 713.762329 794.792603
Global: -210.724777 189.202148 42.346184
Player: -3220.048584 1316.403076 1141.527588
Global: -2915.331543 -1445.267944 304.031250
Player: -2912.157471 -1446.003174 304.031250
Global: -2774.506836 -1457.243896 304.031250
Player: -2767.644043 -1454.626709 304.031250
Global: -2609.291504 -1360.545532 304.031250
Player: -2602.569580 -1356.096191 304.031250
Global: -2313.371826 -1519.530273 304.031250
Player: -2310.363525 -1520.096802 304.031250
Global: -2190.972656 -1505.093018 304.031250
Player: -2188.111084 -1503.271851 304.031250
Global: -2130.507813 -1471.020630 304.031250
Player: -2130.507813 -1471.020630 304.031250
Global: -2305.258789 -1479.570801 770.614197
Player: -2305.258789 -1479.570801 770.614197
Global: -2361.988770 -320.043030 770.614197
Player: -2362.432617 -310.968506 770.614197
Global: -2388.450928 220.895187 770.614197
Player: -2388.450928 220.895187 770.614197
Global: -1552.434692 125.938637 521.525085
Player: 1026.306641 -1361.365601 1612.748291
Global: -1552.434692 125.938637 521.525085
Player: 1026.306641 -1361.365601 1499.280762
Global: -1552.434692 125.938637 521.525085
Player: 1051.585327 -1376.469971 1360.031250[/quote]
Noclip seems to affect it, but not deterministically.
Edit: and yes, I would have mentioned if I was viewing it in anything other than regular normal first-person
Edit: I'm still looking for a reliable way to reproduce it before putting it on garrysmod-issues, if anyone can at least confirm that it's not just me, that would be great...
[QUOTE=Neat-Nit;49957819]It seems to be random whether this works or not.
Noclip seems to affect it, but not deterministically.
Edit: and yes, I would have mentioned if I was viewing it in anything other than regular normal first-person
Edit: I'm still looking for a reliable way to reproduce it before putting it on garrysmod-issues, if anyone can at least confirm that it's not just me, that would be great...[/QUOTE]
I had some funny stuff going on the other day. Spawn a prop and run it again.
[QUOTE=Willox;49958006]I had some funny stuff going on the other day. Spawn a prop and run it again.[/QUOTE]
Spawning a prop does cause EyePos to update ONCE, but it gets stuck immediately after.
My current method of printing it is:
[code]bind - "lua_run_cl chat.AddText('Global: ', tostring(EyePos()), '\nPlayer: ', tostring(LocalPlayer():EyePos()),'\n')"[/code]
Actually, I'm going to record a video of it... brb.
Note, that I've only tested this in Singleplayer, so it may be singleplayer-only. The function seems to be sparsely used in vanilla gmod, but is a factor in [url=https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/entities/entities/base_gmodentity.lua#L20]determining whether to draw tooltips[/url] on sandbox entities. Really annoying when it doesn't get drawn.
Edit: [video]https://youtu.be/CoPzV2AMooU[/video]
[QUOTE=Noi;49958158]It's better to hook into CalcView and just save eyepos from here.[/QUOTE]
I'm not trying to use it myself, it breaks vanilla gmod code. [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/entities/entities/base_gmodentity.lua#L20[/url]
[QUOTE=Noi;49958505]hmm, that's why you sometimes cant see it[/QUOTE]
Exactly. Looking for the source of that issue is what caused me to discover it.
[QUOTE=Neat-Nit;49957819]
Edit: I'm still looking for a reliable way to reproduce it before putting it on garrysmod-issues, if anyone can at least confirm that it's not just me, that would be great...[/QUOTE]
Start with disabling all addons. ALL of them. Then start adding 1 by 1 until the issue happens.
I am pretty sure something that fucks with rendering of the view is causing it for you ( Like rendering additional views? Rendertargets? )
[QUOTE=Robotboy655;49958889]Start with disabling all addons. ALL of them. Then start adding 1 by 1 until the issue happens.
I am pretty sure something that fucks with rendering of the view is causing it for you ( Like rendering additional views? Rendertargets? )[/QUOTE]
I'm still getting it with a fully vanilla gmod:
[lua]lua_run_cl print(EyePos())
0.000000 0.000000 0.000000[/lua]
Spawning something then fixes it:
[lua]lua_run_cl print(EyePos())
13399.613281 1062.790405 2367.308105[/lua]
[QUOTE=Robotboy655;49958889]Start with disabling all addons. ALL of them. Then start adding 1 by 1 until the issue happens.
I am pretty sure something that fucks with rendering of the view is causing it for you ( Like rendering additional views? Rendertargets? )[/QUOTE]
I disabled all my workshop addons, and as far as I know, I don't have any plaintext addons/edits that do anything of the sort. However, I will still do a clean install and see what happens. (Edit: seems I won't need to do that since it was confirmed in the above post)
In the mean time, I just recorded a more thorough video. I recommend you watch it at 2x speed if youtube gives you the option, it'll save time and will get the point across:
[video]https://youtu.be/Id4hcxmEVXE[/video]
I don't think EyePos is going to ever work unless you've got it being called constantly in the correct render hook and not in any other render hooks. Maybe some code that was calling it was taken out in a recent update.
The way I see it there are 2 options:
1. Fix it.
2. Deprecate it and replace all vanilla code that uses it with something else that actually works.
If 1 is impossible (or not worth the trouble, your call), then 2 is the only other option.
As far as I can tell, it is only supposed to be used in rendering hooks. Deprecating it retarded idea, it is used by ALL 3D2D code ( as it should ).
[QUOTE=Robotboy655;49959547]As far as I can tell, it is only supposed to be used in rendering hooks. Deprecating it retarded idea, it is used by ALL 3D2D code ( as it should ).[/QUOTE]
3. Warn not to use it outside of rendering hooks and still replace the vanilla code that uses it incorrectly?
(following information may be useless)
In my testing, calling EyePos() in any hook [url=http://wiki.garrysmod.com/page/Render_Order]between GM:PreDrawOpaqueRenderables and GM:HUDDrawScoreBoard[/url] will give the function a good value.
Calling EyePos() in [url=http://wiki.garrysmod.com/page/GM/PostDraw2DSkyBox]GM:PostDraw2DSkyBox[/url] will give it either a value, but not necessarily the right one, depending on the angle you're looking.
A retarded hack to make garry's code work would be: [lua]hook.Add("PostDrawEffects", "EyePosFixHack", function() EyePos() end)[/lua]
But I know you can't be proud to release it this way.
What's the conceptual difference between EyePos() and LocalPlayer():EyePos() anyway?
I always thought that EyePos() was basically this:
[lua]
function EyePos() return LocalPlayer():EyePos() end
[/lua]
[QUOTE=FPtje;49959844]What's the conceptual difference between EyePos() and LocalPlayer():EyePos() anyway?
I always thought that EyePos() was basically this:
[lua]
function EyePos() return LocalPlayer():EyePos() end
[/lua][/QUOTE]
EyePos() clientside returns where the player is actually viewing from after their view is modified by CalcView.
[QUOTE=FPtje;49959844]What's the conceptual difference between EyePos() and LocalPlayer():EyePos() anyway?
I always thought that EyePos() was basically this:
[lua]
function EyePos() return LocalPlayer():EyePos() end
[/lua][/QUOTE]
There's a few calculations that go towards the actual origin of the scene that won't go on your player's eyepos. I can't think of them all, but they include the little headbob when you take fall damage and the smoothing when you're walking up a staircase/ledge.
LocalPlayer():EyePos() is basically what the server and other players get to see.
That, and I'm pretty sure if you're viewing through a camera, EyePos() will return the camera's position rather than the player's head position.
Could we get the option to load certain .nav files instead of those by the name of the map? In our gamemode we want to mess with the navigation meshes with placed props and stuff, but we don't want that to permanently break the navmesh for any other gamemode. Could we get that as an argument for like navmesh.Load and navmesh.Save?
[lua]navmesh.Save(game.GetMap().."_edited.nav")
navmesh.Load(game.GetMap().."_edited.nav")[/lua]
Of course not a widely used feature, but it should be fairly simple to add right?
#clientside entity getmodel function even when error.mdl 2016
Because I don't think there's a better place to ask this:
Is it expected behavior for Panel:OnKeyCodePressed and input.WasKeyPressed to not trigger when I press escape and open the GMod menu?
The only way I can get a menu to close when I press it is using a Think hook and input.IsKeyDown, which isn't ideal.
Try using PlayerBindPress for cancelselect or whatever the ESC is bound to by default.
PlayerBindPress doesn't seem to be being triggered by either opening console or opening the game menu.
[QUOTE=Neat-Nit;49960075]That, and I'm pretty sure if you're viewing through a camera, EyePos() will return the camera's position rather than the player's head position.[/QUOTE]
Specifically, whatever [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetViewEntity]Player:SetViewEntity[/url] is set to.
Can plugin_load be added back in? I've heard there was an exploit that could be performed with it, but why not just restrict it with Lua as opposed to just removing it entirely? I also know that C++ modules exist, but there are some plugins that were made for other games that haven't been remade in the module format (so there's no way to currently load them), and I'm sure some would prefer to be able to just make plugins instead.
Sorry, you need to Log In to post a reply to this thread.