• What do you need help with? V3
    6,419 replies, posted
Select HD, and use fullscreen, and watch the bar thingie that holds my name.
[QUOTE=Persious;39358131]Select HD, and use fullscreen, and watch the bar thingie that holds my name.[/QUOTE] It's not moving.. What are you on?
[QUOTE=Kogitsune;39352543]You're creating the physics on the client and server. You only need to do it on the server.[/QUOTE] Pretty sure its all serversided, ill check back here to tell you if you're right or not
[QUOTE=Kogitsune;39352543]You're creating the physics on the client and server. You only need to do it on the server.[/QUOTE] I thought it was always a case of you SHOULD create it both on the server and client for clientside prediction.
I talked to jetboom and he said something about how it's a terrible idea to try and parent PhysObjects. What i'm trying to do is set up a printer system with attatchments that can be changed out and stuff, each new item is it's own entity that is parented to the base printer entity. Recently i've been thinking that i should have the printer itself handle all the stats for all of that and throw out the extra entities. What do you guys think?
[QUOTE=Matt-;39358198]It's not moving.. What are you on?[/QUOTE] I don't think you know what I mean, or you might be a bit blind. Look at the video again. Keep looking at the last letter in my name.
[QUOTE=Persious;39359256]I don't think you know what I mean, or you might be a bit blind. Look at the video again. Keep looking at the last letter in my name.[/QUOTE] I see it. Looks like some sort of decimal issue. Try rounding whatever you're using to set the width.
[QUOTE=Persious;39359256]I don't think you know what I mean, or you might be a bit blind. Look at the video again. Keep looking at the last letter in my name.[/QUOTE] You know you don't have to be rude? Maybe he really didn't see the problem.
The error. [CODE] [[B]ERROR[/B]] gamemodes/wintersurvival/gamemode/buildings.lua:34: attempt to index field 'pldat' (a nil value) [B]1[/B]. unknown - gamemodes/wintersurvival/gamemode/buildings.lua:34 [B]2[/B]. unknown - lua/includes/modules/concommand.lua:69 [/CODE] The code. buildings.lua [CODE] buildings.lua [B]30[/B]: function GM.BuildAng(pl,cmd,args) [B]31[/B]: local self = gmod.GetGamemode() [B]32[/B]: local uid = pl:UniqueID() [B]33[/B]: if tonumber(args[1]) then [B]34[/B]: self.pldat[uid].rotation = Angle(0,math.Round(math.NormalizeAngle(tonumber(args[1]))),0) [B]35[/B]: end [B]36[/B]: end [/CODE] concommand.lua [CODE] [B]64[/B]:function Run( player, command, arguments, args ) [B]65[/B]: [B]66[/B]: local LowerCommand = string.lower( command ) [B]67[/B]: [B]68[/B]: if ( CommandList[ LowerCommand ] != nil ) then [B]69[/B]: CommandList[ LowerCommand ]( player, command, arguments, args ) [B]70[/B]: return true [B]71[/B]: end [B]72[/B]: [B]73[/B]: if ( player:IsValid() ) then [B]74[/B]: player:ChatPrint( "Unknown Command: '" .. command .. "'\n" ) [B]75[/B]: end return false; end[/CODE] What should I do? The error occurs when I scroll with the mouse-wheel on Winter Survival. I appreciate it.
[QUOTE=R@Rdeathmatch;39359393]You know you don't have to be rude? Maybe he really didn't see the problem.[/QUOTE] Do you even think I was being rude? I was stating that he maybe was blind, not that it was aimed as a insult or anything. Are you seriously coming back here to post useless shit again? [editline]25th January 2013[/editline] [QUOTE=_Undefined;39359317]I see it. Looks like some sort of decimal issue. Try rounding whatever you're using to set the width.[/QUOTE] Tried to round everything within the width, didn't change anything.
[QUOTE=R@Rdeathmatch;39359393]You know you don't have to be rude? Maybe he really didn't see the problem.[/QUOTE] Oh I see it now, I was looking at the name tag above the player. Yeah it'll help if you post the code you're using to draw the bar, Persious.
[QUOTE=Matt-;39359430]Oh I see it now, I was looking at the name tag above the player. Yeah it'll help if you post the code you're using to draw the bar, Persious.[/QUOTE] [lua] local name = LocalPlayer():Name() local namelength = surface.GetTextSize(name) draw.RoundedBox( 0, 5, ScrH() - 119, namelength + 5, 20, NewHUD.Colors["Gray"] ) draw.RoundedBox( 0, 5, ScrH() - 107, namelength + 5, 8, NewHUD.Colors["Dark Gray"] ) [/lua]
You need to surface.SetFont( "font" ) before calling surface.GetTextSize( text ) otherwise you'll get the size of random fonts that are in the rendering call.
[QUOTE=Matt-;39359714]You need to surface.SetFont( "font" ) before calling surface.GetTextSize( text ) otherwise you'll get the size of random fonts that are in the rendering call.[/QUOTE] Oh damn. Thank you! Learned something new at least. [editline]26th January 2013[/editline] Another question, how the hell can I set a focus on a DTextBox? This will sound a bit weird, but I've got a textbox on a HUD [lua] if !DermaAdded then local textbox = vgui.Create("DTextEntry") textbox:SetText("Something useless") textbox:SetSize(200, 20) textbox:SetPos(ScrW() - 415, (ScrH() - sizey) + 6 ) textbox.OnEnter = function(self) RunConsoleCommand("say", "@" .. self:GetValue()) end DermaAdded = true end [/lua] I just can't get it working.
[QUOTE=Matt-;39356834]For a quick and easy solution, a HTML panel will work, and you'll get a lot more styling easily than using standard vgui.[/QUOTE] Thanks, i'm not sure why i wanted to use standard vgui so badly, HTML is way better, easier to add and edit entries and of course style.
Sorry if I'm asking for something that's been asked (and answered?) already. Do you know any tutorial on how to make Garry's Mod 13 NPC's? I've searched through the whole google sites, all I found were tut's for Garry's Mod 10 or things about SWEP's not working and stuff. I've checked all wiki sites and the sites on this forum page, and found nothing for my use, only the one of "How to convert your old Garry's Mod scripts to Garry's Mod 13" which I had headaches from as I'm not experienced in scripting. Thank you in advance! Best Regards
[QUOTE=Archemyde;39358919]I talked to jetboom and he said something about how it's a terrible idea to try and parent PhysObjects. What i'm trying to do is set up a printer system with attatchments that can be changed out and stuff, each new item is it's own entity that is parented to the base printer entity. Recently i've been thinking that i should have the printer itself handle all the stats for all of that and throw out the extra entities. What do you guys think?[/QUOTE] Since nobody else answered, I hate multiple entities that are connected. Like the money printer, cooler, collector system? It's super annoying because each entity moves the other one. It takes half a minute after you drop it for it to stop fidgeting around. And even if it doesn't, when you gravgun it and move it around it is just ugly. It'd be a much better idea to just have the attachments handled within the one entity.
Seeing as nobody replied to my last post, how would i go about recreating this? [video=youtube;GOF2VWnVNiE]http://www.youtube.com/watch?v=GOF2VWnVNiE[/video]
[QUOTE=Aardman55;39360352]Sorry if I'm asking for something that's been asked (and answered?) already. Do you know any tutorial on how to make Garry's Mod 13 NPC's? I've searched through the whole google sites, all I found were tut's for Garry's Mod 10 or things about SWEP's not working and stuff. I've checked all wiki sites and the sites on this forum page, and found nothing for my use, only the one of "How to convert your old Garry's Mod scripts to Garry's Mod 13" which I had headaches from as I'm not experienced in scripting. Thank you in advance! Best Regards[/QUOTE] Yea I asked too, twice. I guess most people don't know how to make SNPC'S. You could always just use the default AI and change the models of npc's to replicate making your own if you wanted. I saw it somewhere a while ago in some npc pack.
[QUOTE=Shifty Pete;39360598]Seeing as nobody replied to my last post, how would i go about recreating this?[/QUOTE] dude not cool [QUOTE=Splambob;39353379]Here's an odd problem; I'm making a SWEP which fires a cannon round from the owner's shoot position and eye angles. This works but when a player spawns the SWEP and another player picks it up, the cannon rounds come from the player who spawned it, rather than the player who's shooting. It seems the SWEP thinks that its owner is the spawner and while it's technically correct, it's not the behaviour I'm looking for. :v: My question is, how do I get the [i]holder[/i] of the SWEP rather than the owner? I'm using self.Owner right now. [b]Edit; @above You could start by making a scripted entity with the lightcycle model, and then you can use the think hook to execute applyforce and applytorque functions on it according to its owner's keypresses. You can use a calcview hook on the owner to put their view on the cycle. For more complicated behaviour there's a ton of other entity hooks that can help out. Here's some material to get you started; [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexa944-3.html[/url] [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index9d06.html[/url] [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index1432.html[/url] [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexa5ae.html[/url][/b][/QUOTE] Though to recreate that thing you'd probably want to use SetPos and SetAngles instead of messing with force and torque because they're a lot more accurate and instantaneous.
Is the only way to override the tabs painting on a DPropertySheet to make a custom skin?
-snip-
[lua] hook.Add("DoPlayerDeath", "GPi_Death_TTT_Hook_Display", function(victim, attacker) if attacker:IsPlayer() then victim:PrintMessage(HUD_PRINTTALK, "You've died by a "..attacker:GetRoleString().."'s hands!") end end)[/lua] A kind fellow ([B][URL="http://facepunch.com/member.php?u=219375"]Phoenixf129[/URL])[/B] created this code for me which makes it so that players can see if a Traitor, innocent or detective killed them but I was wondering where I had to put the file? I read somewhere that I just had to throw that file in lua/autorun/server and it should work. Does that script and location seem right to you guys(Sorry i'm a bit inexperienced, but learning slowly) ?
[img]http://puu.sh/1SK8W[/img] [code]timer.Simple(0.01, function() ent:GetPhysicsObject().ApplyForceCenter(push) end)[/code] Will provide anymore info if needed.
[QUOTE=drake90001;39362382][img]http://puu.sh/1SK8W[/img] [code]timer.Simple(0.01, function() ent:GetPhysicsObject().ApplyForceCenter(push) end)[/code] Will provide anymore info if needed.[/QUOTE] what is this weapon for?
[QUOTE=Ozhar;39362436]what is this weapon for?[/QUOTE] Actually, it's part of Mad Cow's Weapon, it's one of the bases. The whole code can be seen here: [url]http://pastebin.com/jxXEDgU4[/url] Line 755.
Change it to ent:GetPhysicsObject():ApplyForceCenter(push)
This is kind of a silly thing. I was trying to spawn a dropship with a troop container. I know it doesnt actually drop anything off or do anything but a dropship looks kind of silly without the container when youre putting it in the background of a screenshot. Anyways I used this bit of console lua code to do it after finding it on the forum somewhere. lua_run dropship = ents.Create("npc_combinedropship") dropship:SetKeyValue("CrateType", 1) dropship:Spawn() The thing is on the map it seems to spawn in a predefined location and turns out on the map i was using it was inside a shed and i couldn't get it out (it was kind of funny, really, because it didn't fit very well and was clipping through the walls) -- and,on any map, if i try to move it away and then turn the AI on it just goes back to where it was before instead of staying put (I know, air nodes). I tried another map and i couldn't find it at all although I heard it. Now Im pretty sure theres a way to make it spawn at where your cursor points, I think its !picker or something but I don't know how or where to put it in, as I don't lua or any code very well. So if someone could help me, thanks.
[QUOTE=The-Spy;39362116][lua] hook.Add("DoPlayerDeath", "GPi_Death_TTT_Hook_Display", function(victim, attacker) if attacker:IsPlayer() then victim:PrintMessage(HUD_PRINTTALK, "You've died by a "..attacker:GetRoleString().."'s hands!") end end)[/lua] A kind fellow ([B][URL="http://facepunch.com/member.php?u=219375"]Phoenixf129[/URL])[/B] created this code for me which makes it so that players can see if a Traitor, innocent or detective killed them but I was wondering where I had to put the file? I read somewhere that I just had to throw that file in lua/autorun/server and it should work. Does that script and location seem right to you guys(Sorry i'm a bit inexperienced, but learning slowly) ?[/QUOTE] You could put it init.lua in terrortown/gamemode/
[QUOTE=fairy;39363081]You could put it init.lua in terrortown/gamemode/[/QUOTE] i though you put this in the lua/autorun/server folder?
Sorry, you need to Log In to post a reply to this thread.