• What do you need help with? V3
    6,419 replies, posted
Hey guys, I'm working with Derma and some of the time when I screw up I get an unhelpful error within a Derma extension file. Example; [code]vgui.Create: Error when calling 'DCreateHoloMenu_Holopad':Init ([lua\includes\extensions\panel.lua:141] attempt to index local 'pnl' (a nil value)) [/code]How may I get a multi-level stack trace like the one in GM13 beta, so I can see what part of my code is causing the failure in the Derma file? Thanks in anticipation.
I'm getting this error through my toybox SWEP "[!toybox_186932:942] attempt to call method 'Penetrate' (a nil value)" , (it's been blue). I haven't been able to reproduce this myself however. I pasted the code here because it is rather long: [url]http://pastebin.com/4cjkHTSa[/url]
I can't remember, is there a way to credit an entity's owner with kills made with ent:Ignite()?
Anyone know of any documentation/guide on how to go about making custom animations? Is it possible to make an animation that applies to every player model, or would you have to edit it into each individual model & force clients to download the updated ones?
Anyone know how i can have the old gmod 10 screen on my gmod 12?
what is the most up to date method of sending data from server to client (and client to server as well i guess)? when i was into GLua it was umsgs but i remember garry added something like a "data" library that you're supposed to use instead. i'm trying to make a gamemode that will be up to date with Gmod13 but the wiki is apparently nonexistent (great idea btw) so i'm not sure whats up
[QUOTE=Kopimi;36956897]what is the most up to date method of sending data from server to client (and client to server as well i guess)? when i was into GLua it was umsgs but i remember garry added something like a "data" library that you're supposed to use instead. i'm trying to make a gamemode that will be up to date with Gmod13 but the wiki is apparently nonexistent (great idea btw) so i'm not sure whats up[/QUOTE] GM13 introduces the net library. Articles here: [url]http://wiki.garrysmod.com/page/net[/url] and [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index1b73.html[/url]
[QUOTE=Splambob;36947601]Hey guys, I'm working with Derma and some of the time when I screw up I get an unhelpful error within a Derma extension file. Example; [code]vgui.Create: Error when calling 'DCreateHoloMenu_Holopad':Init ([lua\includes\extensions\panel.lua:141] attempt to index local 'pnl' (a nil value)) [/code]How may I get a multi-level stack trace like the one in GM13 beta, so I can see what part of my code is causing the failure in the Derma file? Thanks in anticipation.[/QUOTE] [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4277.html]Debug.Trace [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] [QUOTE=randomscript;36952546]I can't remember, is there a way to credit an entity's owner with kills made with ent:Ignite()?[/QUOTE] Pretty sure there isn't, you'll have to manually [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexba9a.html]Entity.TakeDamageInfo [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] them in a timer. [QUOTE=Moka;36954935]Anyone know how i can have the old gmod 10 screen on my gmod 12?[/QUOTE] You'll have to explain more, that doesn't make sense.
[QUOTE=Lexic;36957042][b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4277.html]Debug.Trace [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Pretty sure there isn't, you'll have to manually [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexba9a.html]Entity.TakeDamageInfo [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] them in a timer. You'll have to explain more, that doesn't make sense.[/QUOTE] maybe he means the background image of the loading screen, iirc wasn't it some guy in a blue suit with a cone near by?
[QUOTE=_nonSENSE;36956982]GM13 introduces the net library. Articles here: [url]http://wiki.garrysmod.com/page/net[/url] and [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index1b73.html[/url][/QUOTE] awesome thanks also how are clientside entities created in gm13? i read that ents.create was removed in update 10 but never saw a solution. i'm trying to create a "ghost prop" sort of like a preview for players to be able to place objects on walls and stuff.
[QUOTE=Kopimi;36957927]awesome thanks also how are clientside entities created in gm13? i read that ents.create was removed in update 10 but never saw a solution. i'm trying to create a "ghost prop" sort of like a preview for players to be able to place objects on walls and stuff.[/QUOTE] ents.CreateClientProp("model")
[QUOTE=Ice Tea;36895140] Stuff [/QUOTE] I might be wrong when saying this but I think textures like that need to be an "UnlitGeneric" for preventing that type of texture glitch. So you might want to make a blank vtf and vmt with that setting so that doesn't happen any longer. Also a question of my own I'm trying to create this endurance system where the player receives lower damage depending on their skill but every formula I try returns a number that just simply won't work. I'm probably horribly wrong with what I'm doing but then again I'm really bad with math... [lua] hook.Add("EntityTakeDamage","Attr Endure",function(vic,wep,atk,amt,dmg) print(amt - vic:GetSkill("Endurance") * attributes["Endurance"].Scale) dmg:ScaleDamage(amt - vic:GetSkill("Endurance") * attributes["Endurance"].Scale) -- Endurance's scale is 0.2. end) [/lua] Any ideas?
[QUOTE=jrj996;36960453] Any ideas?[/QUOTE] Stop using amt -, then divide the endurance scale by endurance skill, then multiply by 5. An endurance skill of 1, in that case, won't get you any bonus. An endurance scale of 2 though, will get you 0.5?
[QUOTE=skullorz;36960588]Stop using amt -[/QUOTE] That just makes it so that the lower your skill the less damage you take... :v:
[QUOTE=jrj996;36960603]That just makes it so that the lower your skill the less damage you take... :v:[/QUOTE] I realized that and updated the post. My math won't be perfect, so someone could help out. [code]attributes["Endurance"].Scale/vic:GetSkill("Endurance")*5[/code] In my case it's basically dividing 1 by the endurance skill, which is bad.
That works fine because of the ScaleDamage function, but if you're at 100 then you take way too low of damage I think I might know how to fix this though. Thanks for the help :) [b]Scratch that,[/b] can't figure it out :v it's returning wayyy too low of damage. [lua] hook.Add("EntityTakeDamage","Attr Endure",function(vic,wep,atk,amt,dmg) print(math.abs(math.min(attributes["Endurance"].Scale / vic:GetSkill("Endurance")*5,0))) dmg:ScaleDamage(math.abs(math.min(attributes["Endurance"].Scale / vic:GetSkill("Endurance") * 5,0))) end) [/lua] That's my current code. 100 returns 0.01, 1 returns 1 like I want it. Is there any way I can get 100 to return at LEAST 0.1?
I am trying to update the player's aim position because I am messing with the player's view using GM:CalcView. How do I get the player to aim at the center of the screen? [lua]local CAMERA_DISTANCE = 200 local CAMERA_HEIGHT = 80 -- make this number higher to make problem more apparent local CAMERA_MOVE_SPEED = 16 local CAMERA_ROTATE_SPEED = 8 local CAMERA_FOV_SPEED = 0.2 local PLAYER_ROTATE_SPEED = 0.4 hook.Add("CalcView", "test", function(ply, origin, angles, fov) ply.currentView = ply.currentView or {} ply.currentView.origin = ply.currentView.origin or origin ply.currentView.angle = ply.currentView.angle or angles ply.currentView.fov = ply.currentView.fov or fov ply.targetView = ply.targetView or {} ply.targetView.origin = ply.targetView.origin or origin ply.targetView.angle = ply.targetView.angle or angles ply.targetView.fov = 60 local frameTime = FrameTime() ply.currentView.origin = LerpVector(frameTime * CAMERA_MOVE_SPEED, ply.currentView.origin, ply.targetView.origin) ply.currentView.angle = LerpAngle(frameTime * CAMERA_ROTATE_SPEED, ply.currentView.angle, ply.targetView.angle) ply.currentView.fov = Lerp(frameTime * CAMERA_FOV_SPEED, ply.currentView.fov, ply.targetView.fov) ply.targetView.origin = ply:GetPos() + ply.currentView.angle:Forward() * -CAMERA_DISTANCE + Vector(0, 0, CAMERA_HEIGHT) return ply.currentView end) hook.Add("InputMouseApply", "test", function(cmd, x, y, angle) local frameTime = FrameTime() local ply = LocalPlayer() local pitchFactor = GetConVarNumber("m_pitch") local yawFactor = GetConVarNumber("m_yaw") local sensitivity = GetConVarNumber("sensitivity") * frameTime * 30 ply.targetView.angle = Angle((ply.targetView.angle.p + y * pitchFactor * sensitivity), ply.targetView.angle.y - x * yawFactor * sensitivity, 0) end) hook.Add("ShouldDrawLocalPlayer", "test", function() return true end) [/lua]
[QUOTE=Bitl;36684782]I'm trying to make a gamemode for Garry's Mod 13, and when I load a map, I get this: Error loading gamemode: !IsValidGamemode[bitlmatch] How do I fix this? EDIT: Never mind.[/QUOTE] How did u fix it.. I have this also
I need help with several things. 1- How do I set up player classes in Fretta, in a way that will work with Gmod 13 2- Similarly on Fretta, I need a team randomization script. I need it to randomly choose someone to be on a certain team each time the round changes (kinda like how in TTT the traitor is chosen randomly each round, or in Saxton Hale on TF2, the boss is chosen randomly) My gamemode is designed in a way where 1 person is on one team and has certain advantages, while everyone else is on the other team, with their own advantages. Then each round, the "boss" will be randomly chosen to be someone else.) Thanks
super close to finishing something important i have a prop building mechanic that lets you move a prop around using the Entity.GetRight function to decide the direction. sometimes the function returns the correct value, and the prop moves around correctly, but other times it returns 0 and thus no changes to position are made. why would Entity.GetRight randomly start returning 0? after a quick test i've found that when GetRight returns 0, so does GetUp and GetFoward, ie all the entity direction vectors are 0. what's up? (this is all clientside, the entity is a ClientsideModel) [editline]27th July 2012[/editline] [QUOTE=WiZzArD;36961075]I am trying to update the player's aim position because I am messing with the player's view using GM:CalcView. How do I get the player to aim at the center of the screen? [/QUOTE] what do you mean by "aim at the center of the screen"?
So I'm trying to port Siminov's Firearms Source SWEPs to GMod 13 and things would be going smoothly except that GMod 13 won't recognize the base as a SWEP and therefore every single weapon is full of errors. I don't know if it just isn't initializing the base or what. I'm not a scripter so I don't see what's wrong and why it isn't working. [url]http://pastebin.com/zZYfXZby[/url] Any help would be appreciated. [B]Edit:[/B] Found the problem in the cl_init.lua file. Had to fix the file.exists lines.
[B]Fixed[/B]
[QUOTE=jrj996;36960668]That works fine because of the ScaleDamage function, but if you're at 100 then you take way too low of damage I think I might know how to fix this though. Thanks for the help :) [b]Scratch that,[/b] can't figure it out :v it's returning wayyy too low of damage. [lua] hook.Add("EntityTakeDamage","Attr Endure",function(vic,wep,atk,amt,dmg) print(math.abs(math.min(attributes["Endurance"].Scale / vic:GetSkill("Endurance")*5,0))) dmg:ScaleDamage(math.abs(math.min(attributes["Endurance"].Scale / vic:GetSkill("Endurance") * 5,0))) end) [/lua] That's my current code. 100 returns 0.01, 1 returns 1 like I want it. Is there any way I can get 100 to return at LEAST 0.1?[/QUOTE] [code]attributes["Endurance"].Scale / vic:GetSkill("Endurance") * (5*math.Clamp(vic:GetSkill("Endurance")/10,1,10))[/code]
[QUOTE=Kopimi;36966243]what do you mean by "aim at the center of the screen"?[/QUOTE] If you run the code, you will notice that the player does not shoot bullets to the location of the cross-hair that is at the center of the screen. [b]Edit:[/b] I found out my problem. The view angle and the aim angle of the player are synonymous. The wiki I was reading indicated that updating the view did not update the player's aim angle. That is wrong.
-snip
Could someone fix this broken hud for me? [url]http://pastebin.com/kJNtx3yH[/url]
[QUOTE=shadowz67xx;36971524]Could someone fix this broken hud for me? [url]http://pastebin.com/kJNtx3yH[/url][/QUOTE] You know it's like searching wind on the desert ? Give us the console output of error at least
Does anyone know if ApplyForceOffset works? I am trying to make my rockets fall by giving them abit more gravity on their tip, (to make them fall and face direction of falling, i dont know any other way to do this), but physobj.ApplyForceOffset appears to be broken (it will still apply force on center). What i do is phys:ApplyForceOffset(Vector(0,0,-1*512*(delta),Vector(14,0,0)), where phys is physobj and delta is valid change of time.
[QUOTE=ajminifigure;36964471]I need help with several things. 1- How do I set up player classes in Fretta, in a way that will work with Gmod 13 2- Similarly on Fretta, I need a team randomization script. I need it to randomly choose someone to be on a certain team each time the round changes (kinda like how in TTT the traitor is chosen randomly each round, or in Saxton Hale on TF2, the boss is chosen randomly) My gamemode is designed in a way where 1 person is on one team and has certain advantages, while everyone else is on the other team, with their own advantages. Then each round, the "boss" will be randomly chosen to be someone else.) Thanks[/QUOTE] I have no idea on the first one as I haven't really messed with fretta at gmod 13... but for the second, use [b][url=wiki.garrysmod.com/?title=Gamemode.OnRoundStart]Gamemode.OnRoundStart [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] to have the code that selects someone and do whatever else on the start of a round., let me make up a code for example: Note: you need 2 teams, default team is the first one, so everyone starts as the team 1. You can also have only 1 team with 2 classes, depends on how you want it to work. [lua] hook.Add( "OnRoundStart", "PickBoss", function() local boss = table.Random(player.GetAll()) boss:SetTeam(2) for _, v in pairs(player.GetAll()) do v:ChatPrint(boss:Name() .. " is the new boss!") end end) [/lua]
Thanks. but one question. Is that serverside, client side, or shared? and can you give me an example of 1 team 2 classes? thanks.
Sorry, you need to Log In to post a reply to this thread.