[QUOTE=AnonTakesOver;47300567]Just saying, but you shouldn't ever use static numbers when dealing with drawing on client.
Always use variables, such as ScrH() - ScrH() * 0.05[/QUOTE]
Agreed, except for when you're working with images/textures.
[QUOTE=Mista Tea;47299297]I posted this in the Next Update thread but didn't receive any responses.
Basically since the dev branch was made live, my servers have [B]stopped automatically restarting when they crash[/B]. The typical message about writing out to a minidump is displayed but there is no longer a '[I]SRCDS.exe has stopped working[/I]' popup dialog box.
Serverdoc isn't picking up on the fact that SRCDS has crashed, so the server will just hang there until I check on it hours later to manually restart it.
I'd just like to know if anyone else is experiencing this issue or not. It's happening to my 2 sandbox servers, both of which run entirely different systems.
[IMG]http://i.imgur.com/d3o7GQu.png[/IMG][/QUOTE]
Try my solution [url]http://facepunch.com/showthread.php?t=1418230[/url]
would like to know if it's possible to enable the Hunger mode only when a cook is connected.
How can i do that? (darkrp)
Is it possible to use CreateMaterial then use that material on an Entity? I'm trying to do it but when it set try and to ent:SetMaterial("mat_name") it does nothing (Not even pink and black).
Is it possible to prevent a physobj from getting any velocity on one axis, preventing movement along that axis?
[QUOTE=bobbleheadbob;47298347][url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index1c1f.html[/url]
[url]http://wiki.garrysmod.com/page/Global/SoundDuration[/url]
[lua]
timer.Create("Loopsound",0,SoundDuration(soundname),function() cSound:Play() end)
[/lua][/QUOTE]
My sound stops and plays every tick now. How do I fix it? Here's my script
[CODE]function ENT:Think()
if self.thing != nil then
timer.Create("Loopsound",0,SoundDuration("asd.wav"),function() self.Sounds.asd:Stop() self.Sounds.asd:Play() end)
end
end
[/CODE]
If I put it inside a function which activates only once, the sound plays only once and never loops.
How to get the velocity of a physics object?
[QUOTE=Maurdekye;47302783]How to get the velocity of a physics object?[/QUOTE]
Did you even attempt searching before you asked?
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/PhysObj/GetVelocity]PhysObj:GetVelocity[/url]
Is there any way to get/search for VGUI panels by name?
i waited 8 hours yet nobody helped me
EDIT: to all those people who rated my post dumb: how would you like it if you asked for help, waited 8 hours, nobody helps you and when you ask for help again, people rate your post dumb?
EDIT #2: yay, 20 hours of waiting and all i get is 10 "dumb" ratings from random people, thanks for all your help!
Is there a hook for when a convar is changed?
[QUOTE=Maurdekye;47304068]Is there a hook for when a convar is changed?[/QUOTE]
Just add a call back with a function that uses hook.call
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/cvars/AddChangeCallback]cvars.AddChangeCallback[/url]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/hook/Call]hook.Call[/url]
Can you do a trace to determine if a bodygroup has been hit?
(Not a hitbox or hitgroup)
[QUOTE=Revenge282;47304542]Can you do a trace to determine if a bodygroup has been hit?
(Not a hitbox or hitgroup)[/QUOTE]
You cannot. The only things that the trace hits are the hit boxes. ( Which are grouped by HitGroups )
Do physobj's work clientside at all? In my testing they don't, but it could have been the latest update to break them; I'm not sure whether I should wait for it to be fixed or rethink my code.
If they don't work clientside, they we should update the wiki and change all physics object functions from shared to server. I'd be happy to do that if necessary.
[QUOTE=Neat-Nit;47304978]Do physobj's work clientside at all? In my testing they don't, but it could have been the latest update to break them; I'm not sure whether I should wait for it to be fixed or rethink my code.
If they don't work clientside, they we should update the wiki and change all physics object functions from shared to server. I'd be happy to do that if necessary.[/QUOTE]
Realm on the wiki is defined by whether function exists on client or server, not by whether it actually does anything on client or sever.
As for your question, yes, they do work clientside if you initialize them clientside, but the functions are largely pointless clientside.
[QUOTE=wauterboi;47300445][code]-- Derive from drive_base (see lua/drive/drive_base.lua
DEFINE_BASECLASS( "drive_base" )
drive.Register( "drive_ball",
{
--
-- Calculates the view when driving the entity
--
CalcView = function( self, view )
view.origin = Vector( 0, 0, 0 )
view.angles = Angles( 0, 0, 0 )
view.drawhud = true
end,
--
-- Called before each move. You should use your entity and cmd to
-- fill mv with information you need for your move.
--
StartMove = function( self, mv, cmd )
end,
--
-- Runs the actual move. On the client when there's
-- prediction errors this can be run multiple times.
-- You should try to only change mv.
--
Move = function( self, mv )
end,
--
-- The move is finished. Use mv to set the new positions
-- on your entities/players.
--
FinishMove = function( self, mv )
end,
}, "drive_base" )[/code]
I can't seem to modify anything about the CalcView, regardless if the thirdperson thing is in there or not. It actually also doesn't work if I test drive_base or the drive_example on the wiki[/QUOTE]
Should I just make my own CalcView function or something?
[QUOTE=G4MB!T;47300886]Is it possible to use CreateMaterial then use that material on an Entity? I'm trying to do it but when it set try and to ent:SetMaterial("mat_name") it does nothing (Not even pink and black).[/QUOTE]
Bump.
How would I go about rotating the camera on an axis around a vector?
[code]
Cannot update control point 4 for effect 'microplane_fuel_leak'.
[/code]
when using:
[code]
ParticleEffectAttach( "microplane_fuel_leak", PATTACH_POINT_FOLLOW, self, v.Index )
[/code]
where v.Index is the bone index. My fault or problem with the .pcf? The effect shows up and animates properly but it spams the above error and lags the game to oblivion.
I want to edit the way the Physics Gun works (not with the existing commands, but the actual file and how the weapon handles).
Anyone know if this is possible/where can I find it?
[QUOTE=VIoxtar;47308771]I want to edit the way the Physics Gun works (not with the existing commands, but the actual file and how the weapon handles).
Anyone know if this is possible/where can I find it?[/QUOTE]
The physics gun isn't a scripted weapon - it's done entirely in C. You can't really touch it apart from the existing console commands/hooks.
The only real option if you want to do some major modification is to replicate the whole thing in Lua. I think it is possible to override the existing one by making a SWEP with the same name.
[QUOTE=Drakehawke;47309026]The physics gun isn't a scripted weapon - it's done entirely in C. You can't really touch it apart from the existing console commands/hooks.
The only real option if you want to do some major modification is to replicate the whole thing in Lua. I think it is possible to override the existing one by making a SWEP with the same name.[/QUOTE]
Shit. That's what I thought. Whatever it is I wanted to do just became trickier.
Thanks.
[QUOTE=VIoxtar;47309097]Shit. That's what I thought. Whatever it is I wanted to do just became trickier.
Thanks.[/QUOTE]
Well, what do you want to achieve? Maybe there is another way.
Is there anyway to make a player not die once their health hits 0?
[QUOTE=bran92don;47310575]Is there anyway to make a player not die once their health hits 0?[/QUOTE]
You can return [i]true[/i] in [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/EntityTakeDamage]GM/EntityTakeDamage[/url] if the damage is greater than or equal to the entity's health, and this will block the damage event. Note this is called for all entities, so you'll have to check for a player.
[QUOTE=pennerlord;47310550]Well, what do you want to achieve? Maybe there is another way.[/QUOTE]
I want to drastically limit the Physgun, so instead of grabbing the prop with full control over it, it will act as a sort of constraint, dragging the prop from the specific grabbing point. Like a ballsocket or rope constraint, if you get what I mean. I also want to limit its distance.
Any idea on how I would replicate the beam effects? The Physgun beam actually curves.. and does other fancy stuff. Draw beam is extremely limited in that regard.
I'm a little confused, I've been trying to scale text based on resolution size - but I can't work it out. I know how to scale other elements, so the rest of my HUD scales, but not the text.
I know surface.GetTextSize() can be used to return the width and height of the text, but as far as I can see that doesn't solve my problem. Thanks in advance
i.e [url]http://cloud-4.steamusercontent.com/ugc/540769214235976629/5B2B18D7F20558205C023B3C89D29670057E439E/[/url]
[QUOTE=Roag15;47311920]I'm a little confused, I've been trying to scale text based on resolution size - but I can't work it out. I know how to scale other elements, so the rest of my HUD scales, but not the text.
I know surface.GetTextSize() can be used to return the width and height of the text, but as far as I can see that doesn't solve my problem. Thanks in advance
i.e [url]http://cloud-4.steamusercontent.com/ugc/540769214235976629/5B2B18D7F20558205C023B3C89D29670057E439E/[/url][/QUOTE]
If you want to make text smaller, you have to create a new font and set its size smaller; then use the new font. In my testing it's also possible to just overwrite the old font by giving the new font the same name.
Just make sure not to call CreateFont inside a repeating hook (such as every frame), as it will quickly cause the game to crash.
[QUOTE=Neat-Nit;47312035]If you want to make text smaller, you have to create a new font and set its size smaller; then use the new font. In my testing it's also possible to just overwrite the old font by giving the new font the same name.
Just make sure not to call CreateFont inside a repeating hook (such as every frame), as it will quickly cause the game to crash.[/QUOTE]
I understand how to create a font, this isn't the problem, but thanks anyway. I meant I need the font to stay fitting in the HUD regardless of the client's resolution, because I'm also scaling the background. The HUD looks fine on my resolution (1920,1080) and the background and HUD bars scale just fine when I change resolution, however the text does not.
Sorry, you need to Log In to post a reply to this thread.