[QUOTE=kpjVideo;47932548]Everything I've tried so far hasn't worked out :([/QUOTE]
Then post the code so we can help, it really isnt that hard.
Can someone explain why this code is not causing props to go flying across the map?
[lua]
local velocity = self.Owner:GetAimVector()
velocity = velocity * 999999
[/lua]
[QUOTE=bran92don;47937635]Can someone explain why this code is not causing props to go flying across the map?
local velocity = self.Owner:GetAimVector() velocity = velocity * 999999
[/QUOTE]
It might be too excessive? Did you try a smaller factor? Source has speed limits that get weird, so you might have hit it.
[QUOTE=Revenge282;47937642]It might be too excessive? Did you try a smaller factor? Source has speed limits that get weird, so you might have hit it.[/QUOTE]
I know it works because when I tried it on a wooden chair it worked but any other model didn't.
I thought it might have been the mass so I changed the mass but it still was not working.
How would I be able to achieve a shadow like this?
[img]http://i.imgur.com/dLlqN1l.png[/img]
[QUOTE=Author.;47939249]How would I be able to achieve a shadow like this?
[img]http://i.imgur.com/dLlqN1l.png[/img][/QUOTE]
You could either do it in a HTML panel, or you could create a gwen texture and create a bordered texture where the border is a shadow. I was working on something similar but I got bored of it. Here's a link [url]https://github.com/JamesxX/MUI[/url]
[QUOTE=G4MB!T;47936756]Then post the code so we can help, it really isnt that hard.[/QUOTE]
I'm guessing you didn't read my post on the previous page so I'll go ahead and post it again for you:
[QUOTE=kpjVideo;47907677]This is copy+pasta'd from a thread I made but I figured someone here might know:
Hello, I'm having an issue with an animation for a weapon ported from csgo.
The animation (to inspect the weapon) has around a 6 second delay so I've tried to solve that using this:
[code]
function SWEP:Think()
--Key is just temp for testing ofc
if self.Owner:KeyPressed(IN_JUMP) then
self.Weapon:SendWeaponAnim( ACT_VM_IDLE ) --play anim
self.Owner:GetViewModel():SetPlaybackRate( 7 ) --set the speed high
timer.Simple( 0.4, function() self.Owner:GetViewModel():SetPlaybackRate( 2 ) end ) --set speed back after 2.4 seconds to slow back down skipping the 6 seconds
end
end
[/code]
Hopefully someone will understand what I'm trying to accomplish :P[/QUOTE]
Is there a script that can derender a player or force a different playermodel onto that or all players in a server? I'm speaking specifically client-side because some servers have a ton of custom models that lag the crap out of me and changing them would (probably) help tremendously.
How can i make a player walk to a point?
I am not sure if this has been asked before, but why do clients often have clientside script errors for addons that the server doesn't have?
Just as an example, most recently someone got this error on my Sandbox server:
[code][xxxxx|26|STEAM_0:x:xxxxxxxx] Lua Error:
[GPhone] lua/weapons/weapon_gphone/shared.lua:642: Tried to use a NULL entity!
1. SetNWInt - [C]:-1
2. unknown - lua/weapons/weapon_gphone/shared.lua:642
[/code]
I've never had GPhone on my server, including either GMA or legacy. This happens for a lot of various random public addons that I have never put on my server.
Is there any reason how this occurs? Do client addons get mounted on the client when they join multiplayer even if the server doesn't have the corresponding addon?
-snip just had to change scopelevel = 0 to scopelevel = nil-
[QUOTE=HunterFP;47941448]How can i make a player walk to a point?[/QUOTE]
ask them politely
no but really the first thing that came into my mind is spawn a nextbot or something and attach their camera to it, have it walk there and then just teleport and detach
[QUOTE=HunterFP;47941448]How can i make a player walk to a point?[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/SetupMove]GM/SetupMove[/url] should be what your looking for.
How do you render a VertexLitGeneric texture in the world with out it glitching out and being fullbright?
Like this crap:
[t]https://dl.dropboxusercontent.com/u/34886768/Pictures/Random/gm_construct0035.jpg[/t]
I think I'm about to give up on my gamemode. I'm gonna ask for help one more time, lol.
Making a singleplayer 3D sidescroller. The player will move along the x-axis. At certain points, there are alternate paths/houses that are enter-able on the z-axis. I'm stuck trying to figure out how I would restrict the player movement until the player is lined up with the z-axis paths. I always want the camera to rotate with the player as they're changing from the x-axis to the z-axis.
Is this possible? I have been researching endlessly and have asked a few times, but I've got nothing. FWIW, I'm using CalcView to render my sidescrolling camera and it works great.
Another problem I'm having is I only want to use the keyboard to control the player. I've got the mouse disabled and my sidescrolling movement down. The d key makes the player move forward on the x-axis and the a key makes the player move backwards. However, when I press the a key, I can only walk backwards; the player does not actually turn around. How would I fix this?
tl;dr
Maybe I bit off more than I could chew.
[QUOTE=Obswalq;47943348]I think I'm about to give up on my gamemode. I'm gonna ask for help one more time, lol.
Making a singleplayer 3D sidescroller. The player will move along the x-axis. At certain points, there are alternate paths/houses that are enter-able on the z-axis. I'm stuck trying to figure out how I would restrict the player movement until the player is lined up with the z-axis paths. I always want the camera to rotate with the player as they're changing from the x-axis to the z-axis.
Is this possible? I have been researching endlessly and have asked a few times, but I've got nothing. FWIW, I'm using CalcView to render my sidescrolling camera and it works great.
Another problem I'm having is I only want to use the keyboard to control the player. I've got the mouse disabled and my sidescrolling movement down. The d key makes the player move forward on the x-axis and the a key makes the player move backwards. However, when I press the a key, I can only walk backwards; the player does not actually turn around. How would I fix this?
tl;dr
Maybe I bit off more than I could chew.[/QUOTE]
For making the player turn around when going backwards, try
[URL="http://pastebin.com/mjvV06Ws"]Setting eyeangles.[/URL]
Set the eye angles so they're looking the opposite direction. you'll need a lot of if statements with keys though. But, it's the best method I know.
[editline]12th June 2015[/editline]
There was also a fretta gamemode called "Game Master" or something like that that was a side scroller. Might wanna search up on pastebin or github for the code for that gamemode.
This is from a thread I made, but I figured someone should know the answer here.
So my current method that I'm using to try and mimic the HL2 weapons intensifying recoil the more you fire(which doesn't get the desired effect, but is sort of similar) is this:
[lua]self.Owner:ViewPunch( Angle( math.Rand( self:Clip1() / 8, -self:Clip1() / 8 ), math.Rand( self:Clip1() / 8, -self:Clip1() / 8 ) ,0 ) )[/lua]
But, what I want to do is intensify the viewpunch the longer the player has been firing(basically mimicking how HL2 weapons intensify the viewpunch the longer you've been firing). Yeah, I know the HL2 weapons are coded in C++, but mimicking it in Lua shouldn't be a problem(Fun fact: Supposedly in C++ weapon codes ViewPunch is an available command, and Garry just made viewpunch available for Gmod lua). I want to do this to encourage burst fire to make using the SWEP more challenging to handle. Help, please?
[QUOTE=A Fghtr Pilot;47947663]This is from a thread I made, but I figured someone should know the answer here.
So my current method that I'm using to try and mimic the HL2 weapons intensifying recoil the more you fire(which doesn't get the desired effect, but is sort of similar) is this:
[lua]self.Owner:ViewPunch( Angle( math.Rand( self:Clip1() / 8, -self:Clip1() / 8 ), math.Rand( self:Clip1() / 8, -self:Clip1() / 8 ) ,0 ) )[/lua]
But, what I want to do is intensify the viewpunch the longer the player has been firing(basically mimicking how HL2 weapons intensify the viewpunch the longer you've been firing). Yeah, I know the HL2 weapons are coded in C++, but mimicking it in Lua shouldn't be a problem(Fun fact: Supposedly in C++ weapon codes ViewPunch is an available command, and Garry just made viewpunch available for Gmod lua). I want to do this to encourage burst fire to make using the SWEP more challenging to handle. Help, please?[/QUOTE]
[lua]self.Owner:ViewPunch( self.Owner:GetViewPunchAngles() + Angle( math.Rand( self:Clip1() / 8, -self:Clip1() / 8 ), math.Rand( self:Clip1() / 8, -self:Clip1() / 8 ) ,0 ) )[/lua]
Is there anything out there that would allow you to change the difficulty of doors' locks in DarkRP? Like if there was a metal gate I want to be able to make it harder to picklock than an average wooden door, maybe picklock_time(or whatever it is) * 1.25.
If there isn't any thing out there that does that how hard do you think it would be to make one? More importantly where would I start since I'm pretty new to the Lua language.
[QUOTE=highvoltage;47942480][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/SetupMove]GM/SetupMove[/url] should be what your looking for.
How do you render a VertexLitGeneric texture in the world with out it glitching out and being fullbright?
Like this crap:
[t]https://dl.dropboxusercontent.com/u/34886768/Pictures/Random/gm_construct0035.jpg[/t][/QUOTE]
How are you currently drawing it?
[QUOTE=highvoltage;47942480][IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/GM/SetupMove"]GM/SetupMove[/URL] should be what your looking for.
How do you render a VertexLitGeneric texture in the world with out it glitching out and being fullbright?
Like this crap:
[t]https://dl.dropboxusercontent.com/u/34886768/Pictures/Random/gm_construct0035.jpg[/t][/QUOTE]
That weird glitch (idk about the fullbright part) happens with decals when you try to apply a texture designed for a model. Idk [U]exactly[/U] what it is, but vertex lighting doesn't work on decals. Btw, I notice the little tool model from Hammer that's visible when you place a decal.
You might have more luck with 3D2D.
[editline]14th June 2015[/editline]
I'm tired, so I can't say what I said fits / is true for this situation... I'm sure someone else could better explain / help you out. I tried.
[QUOTE=The Terrorist;47949656]Is there anything out there that would allow you to change the difficulty of doors' locks in DarkRP? Like if there was a metal gate I want to be able to make it harder to picklock than an average wooden door, maybe picklock_time(or whatever it is) * 1.25.[/QUOTE]
Wouldn't it be as simple as pulling the values from a dictionary of multipliers with different models as the keyvalues?
[QUOTE=Kogitsune;47951578]How are you currently drawing it?[/QUOTE]
I'm currently doing it with render.DrawQuadEasy in the entities draw hook because I don't know of any way to remove specific decals.
I'm making a tool to place decals in game and that's what the hammer tool thing is for
Try using a mesh, something like:
[code]local t = Matrix( )
local ang = self:GetAngles( )
t:Translate( self:GetPos( ) )
t:Scale( scale or 1 )
t:Rotate( ang )
render.OverrideDepthEnable( true, true )
self.Mat = self.Mat or Material( self:GetMaterial( ), "VertexLitGeneric smooth" )
cam.PushModelMatrix( t )
render.SetMaterial( self.Mat )
render.SetLightmapMaterial( self.Mat:GetTexture( "$basetexture" ) )
render.ComputeLighting( self:GetPos( ), ang:Forward( ) )
mesh.Begin( MATERIAL_QUADS, 1 )
mesh.Position( upperleft )
mesh.Normal( normal_ul ) -- This should be the normal of the ground under the point
mesh.TexCoord( 0, 0, 0 )
mesh.Color( r, g, b )
mesh.AdvanceVertex( )
mesh.Position( upperright )
mesh.Normal( normal_ur )
mesh.TexCoord( 0, 1, 0 )
mesh.Color( r, g, b )
mesh.AdvanceVertex( )
mesh.Position( lowerright )
mesh.Normal( normal_lr )
mesh.TexCoord( 0, 1, 1 )
mesh.Color( r, g, b )
mesh.AdvanceVertex( )
mesh.Position( lowerleft )
mesh.Normal( normal_ll )
mesh.TexCoord( 0, 0, 1 )
mesh.Color( r, g, b )
mesh.AdvanceVertex( )
mesh.End( )
cam.PopModelMatrix( )
render.OverrideDepthEnable( false, false )[/code]
You might even be able to get away with mesh.QuadEasy:
[code]cam.PushModelMatrix( t )
render.SetMaterial( self.Mat )
render.SetLightmapMaterial( self.Mat:GetTexture( "$basetexture" ) )
render.ComputeLighting( self:GetPos( ), ang:Forward( ) )
mesh.QuadEasy( self:GetPos( ), ang:Forward( ), sizex, sizey )
end[/code]
This untested, but might help.
How can I get vehicle's speed in MPH and KPH?
I have tried
[lua] local mph = entity:GetVelocity():Length() / 23.4657 [/lua] but this brings back numbers that are wrong (proved by using wiremod speedometer)
and
[lua] mph = ent:GetVelocity():Length() / (16 * 5280) [/lua] and this just brings back zero unless the car is going less than 4 MPH.
[QUOTE=OMGOMG132;47959539]How can I get vehicle's speed in MPH and KPH?
I have tried
[lua] local mph = entity:GetVelocity():Length() / 23.4657 [/lua] but this brings back numbers that are wrong (proved by using wiremod speedometer)
and
[lua] mph = ent:GetVelocity():Length() / (16 * 5280) [/lua] and this just brings back zero unless the car is going less than 4 MPH.[/QUOTE]
I realized I was doing drugs when I gave that to you initially. Please replace 16 with ( 4 / 3 ).
[QUOTE=Kogitsune;47959920]I realized I was doing drugs when I gave that to you initially. Please replace 16 with ( 4 / 3 ).[/QUOTE]
Thanks dude
Hey, what would I use to make a non-default-derma button, just like an image or some vgui I could click. ☑ Thanks!
Also, how can I rotate a Dmodelpanel that's already made still- I just need it to be still in a better position. ☑ Thanks!
Anybody know how to make perma entities that save on the map? Thanks in advance.
[QUOTE=Sheeplie;47965271]Hey, what would I use to make a non-default-derma button, just like an image or some vgui I could click.
Also, how can I rotate a Dmodelpanel that's already made still- I just need it to be still in a better position.[/QUOTE]
[b][url=http://wiki.garrysmod.com/page/Category:DImageButton]DImageButton[img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
And do you want to rotate the model in the panel or the whole panel?
Just the model in the panel.
After looking at the lua Wiki, DModelPanel:SetLookAng seems to be it.
Sorry, you need to Log In to post a reply to this thread.