• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=Wob wob wob!;48463559]I based it off the [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=148358389&searchtext=smod+kick"]SMOD kick.[/URL] What it does is play an animation of a foot model kicking and applies force (after a small delay) to whatever is close enough and in the middle of the screen. I have it fire when Primary Attack is pressed.[/QUOTE] So then my suggestion is, wherever the code for your kicking mechanism is located, look for the code where it actually searches for what object to kick, and then right after the line where the kick applies force to the ball, assign the player to the ball If the kick is a SWEP, then use 'self.Owner' to reference the player doing the kicking, so like [code]ball.lastHit = self.Owner[/code] If the kicking is hardcoded into the gamemode and is not a SWEP, then I'm not sure, as I don't know the specifics of your code.
:snip:
Is there any possible way to apply a players velocity to a prop_ragdoll? Using SetVelocity, SetAngleVelocity and AddForce all do nothing. I want the ragdoll to act like the engine ragdoll does from CreateRagdoll
Maybe if you use [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/Entity/GetPhysicsObject"]Entity:GetPhysicsObject[/URL] on the ragdoll, you can get the entity's PhysObj which I know you'll need for [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceOffset"]PhysObj:ApplyForceOffset[/URL] or [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceCenter"]PhysObj:ApplyForceCenter[/URL]
[QUOTE=Wob wob wob!;48466877]Maybe if you use [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/Entity/GetPhysicsObject"]Entity:GetPhysicsObject[/URL] on the ragdoll, you can get the entity's PhysObj which I know you'll need for [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceOffset"]PhysObj:ApplyForceOffset[/URL] or [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceCenter"]PhysObj:ApplyForceCenter[/URL][/QUOTE] I've tried that and it works somewhat but the ragdoll just seems to jump slightly like the ragdoll has massive amounts of friction But I did just do phys:ApplyForceCenter(ply:GetVelocity())
Dynamic fire entity and spawn an entity right in front of the player I want to make some sort of flamethrower, by now everything seems to work fine but I want a fire that, over time, shrinks and does less damage, and also make it spawn right in front of the player. By now I use ply:GetEyeTrace():HitPos and spawn the normal fire entity (env_fire) there, wich works but looks cheap :/ any hints or tips? Thanks in advance, sorry if I wrote something wrong. EDIT: lol [code]--Chair throwing gun, from http://wiki.garrysmod.com/page/Chair_Throwing_Gun (...) -- Set the position to the player's eye position plus 16 units forward. -- Set the angles to the player'e eye angles. Then spawn it. -- ent:SetPos( self.Owner:EyePos() + ( self.Owner:GetAimVector() * 16 ) ) ent:SetAngles( self.Owner:EyeAngles() ) ent:Spawn() [/code] well, that helps for spawning in front of player i guess, but i still need help with the dynamic fire thingy
Is it possible to get the time length of an animation such as ACT_GMOD_TAUNT_MUSCLE for example? I can't use the act command since it is disabled in some gamemodes, it is also written in c+ so the code is private.
[QUOTE=YourStalker;48468590]Is it possible to get the time length of an animation such as ACT_GMOD_TAUNT_MUSCLE for example? I can't use the act command since it is disabled in some gamemodes, it is also written in c+ so the code is private.[/QUOTE] sequenceduration
:snip: Thanks Zerf
[QUOTE=YourStalker;48468905]:snip: Thanks Zerf[/QUOTE] no problem, pal
Why does the autorefresh thing does not work when I change something in darkrpmodification? And when I change something(like config) from a specific addo , then "something is creating script errors" is spamming the console, but when I change the map everything is just fine.
[QUOTE=P4sca1;48470029]Why does the autorefresh thing does not work when I change something in darkrpmodification? And when I change something(like config) from a specific addo , then "something is creating script errors" is spamming the console, but when I change the map everything is just fine.[/QUOTE] Autorefresh isn't magic, it doesn't know how to properly reload certain things. If custom preparations are required before including the file then it will most likely fail. This is an example where it will fail when it tries to reload "included.lua": mian.lua: [code] CFG = {} -- temporary global table include("included.lua") -- do something with CFG here CFG = nil [/code] included.lua: [code] CFG.SomeBullshit = 1 -- On refresh you'll get "ERROR: Attempt to index global 'CFG' (a nil value)" [/code]
[QUOTE=mijyuoon;48470173]Autorefresh isn't magic, it doesn't know how to properly reload certain things. If custom preparations are required before including the file then it will most likely fail. This is an example where it will fail when it tries to reload "included.lua": mian.lua: [code] CFG = {} -- temporary global table include("included.lua") -- do something with CFG here CFG = nil [/code] included.lua: [code] CFG.SomeBullshit = 1 -- On refresh you'll get "ERROR: Attempt to index global 'CFG' (a nil value)" [/code][/QUOTE] Thanks for the info! :)
how do I get the old CS:S handgrenade first person attack animation going? Tried various ACT_ * with grenade in their name but I can't seem to find the right one.
[QUOTE=Shenesis;48470471]ACT_VM_PULLPIN ACT_VM_THROW[/QUOTE] Thanks, works like a charm :D
Every player on my server has just about 15fps. I want to know what could cause this low fps for everyone on my server and how I can remove this. Gamemode is DarkRP. Map is rp_chaos_city [editline]16th August 2015[/editline] The net graph is showing everything in red (entities)
[QUOTE=P4sca1;48470977]Every player on my server has just about 15fps. I want to know what could cause this low fps for everyone on my server and how I can remove this. Gamemode is DarkRP. Map is rp_chaos_city [editline]16th August 2015[/editline] The net graph is showing everything in red (entities)[/QUOTE] What addons do you have
[QUOTE=geferon;48471006]What addons do you have[/QUOTE] !cake AC coffeinventory Some Cars VCMod + ELS Car Dealer FAS Weapons Wire etc...
[QUOTE=P4sca1;48471029]!cake AC coffeinventory Some Cars VCMod + ELS Car Dealer FAS Weapons Wire etc...[/QUOTE] We need ALL addons. Also not just car dealer. Eg: rocketmanias car dealer 2
[QUOTE=geferon;48471035]We need ALL addons. Also not just car dealer. Eg: rocketmanias car dealer 2[/QUOTE] part 1: [url]http://prntscr.com/859jjl[/url] part 2: [url]http://prntscr.com/859jmp[/url] part 3: [url]http://prntscr.com/859jqx[/url] part 4: [url]http://prntscr.com/859jtq[/url]
[QUOTE=P4sca1;48471047]part 1: [url]http://prntscr.com/859jjl[/url] part 2: [url]http://prntscr.com/859jmp[/url] part 3: [url]http://prntscr.com/859jqx[/url] part 4: [url]http://prntscr.com/859jtq[/url][/QUOTE] It may be the shit ton of addons you have or an addon that's rendering thing to much unnecessarily, beacouse my server has that map and everyone has around 120-60 fps (depending on the computer). Try moving out some addons at time and see if the fps goes up.
[QUOTE=geferon;48471067]It may be the shit ton of addons you have or an addon that's rendering thing to much unnecessarily, beacouse my server has that map and everyone has around 120-60 fps (depending on the computer). Try moving out some addons at time and see if the fps goes up.[/QUOTE] Could you give me a list of your addons? This would help me a lot :) [editline]16th August 2015[/editline] maybe FAS Weapons are the problem? Do you have them installed too?
[QUOTE=P4sca1;48471093]Could you give me a list of your addons? This would help me a lot :) [editline]16th August 2015[/editline] maybe FAS Weapons are the problem? Do you have them installed too?[/QUOTE] I'll give you a list when I can get to the pc, then you'll se. Also fas2 is not the problem
So I need to play the last 7-9 seconds of a sound file, was wondering if there is a built in function that will play only a part of a sound file in gmod. If not, is there a manual way to do it e.g. by trimming the file on the fly or some shit. Don't want to burden my users with more downloads of the same files just so i can play only the end part (as i need the rest of the sound file aswell)
Does Player:SetWalkSpeed and Player:SetRunSpeed only work when running them inside a new gamemode? I've been trying to configure them on sandbox and changing their values has no effect
[QUOTE=Splerge;48471432]So I need to play the last 7-9 seconds of a sound file, was wondering if there is a built in function that will play only a part of a sound file in gmod. If not, is there a manual way to do it e.g. by trimming the file on the fly or some shit. Don't want to burden my users with more downloads of the same files just so i can play only the end part (as i need the rest of the sound file aswell)[/QUOTE] Don't know if this is possible, but if you don't want to bother players with downloads you could always use [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/sound/PlayURL"]sound.PlayURL[/URL]
[QUOTE=Sweet Berries;48471992]Does Player:SetWalkSpeed and Player:SetRunSpeed only work when running them inside a new gamemode? I've been trying to configure them on sandbox and changing their values has no effect[/QUOTE] Which hook are you using? The gamemode hooks are ran after the manually added hooks unless you return something non nil from them, could be the gamemode resetting it. You could also run the code the next frame maybe?
[QUOTE=Splerge;48471432]So I need to play the last 7-9 seconds of a sound file, was wondering if there is a built in function that will play only a part of a sound file in gmod. If not, is there a manual way to do it e.g. by trimming the file on the fly or some shit. Don't want to burden my users with more downloads of the same files just so i can play only the end part (as i need the rest of the sound file aswell)[/QUOTE] It's gross, but you can do something like this: [code]sound.PlayFile( path, "noblock", function( chan, err, msg ) if err ~= 0 then ErrorNoHalt( string.format( "Error '%d' playing file %q, %s\n", err, path, msg or "" ) ) else chan:SetTime( SoundDuration( path ) - desired_start ) end end )[/code] You could also do this ( but it would affect every time it is played, not just when you play it ): [code]hook.Add( "EntityEmitSound", "asdf", function( data ) if data.SoundName == path then data.SoundTime = CurTime( ) - ( SoundDuration( path ) - desired_start ) return true end end )[/code]
[QUOTE=P4sca1;48471047]part 1: [url]http://prntscr.com/859jjl[/url] part 2: [url]http://prntscr.com/859jmp[/url] part 3: [url]http://prntscr.com/859jqx[/url] part 4: [url]http://prntscr.com/859jtq[/url][/QUOTE] Dude I wouldn't be surprised if my server lagged with that many addons. Try removing a few you don't need to unclog some fps.
[QUOTE=man with hat;48462352]Why does resource.AddFile never seem to work for me? This is in server/autorun [code]resource.AddFile("materials/example.png")[/code] I join the server, it says it's downloading the file, I get in the server, and it's purple and black checkers, with the image nowhere to be found in my client's files. The file should be downloaded to garrysmod/download/materials/example.png, but it isn't. If I put the file there myself, it shows up in game properly, but if I don't, it's checkered, even though the client says it downloaded the file. I have my settings to allow all downloads from the server. I've restarted my client multiple times.[/QUOTE] Still having trouble with this. Does anybody have a solution?
Sorry, you need to Log In to post a reply to this thread.