• What do you need help with V4
    639 replies, posted
  • Avatar of pennerlord
  • [QUOTE=LilRobot;35387605]as for an explosion effect, i'm taking a wild guess that this modifier should work it [lua] local effectsplode = EffectData() effectsplode:SetOrigin(tr.HitPos) effectsplode:SetStart(tr.HitPos()) effectsplode:SetEntity(self) util.Effect("UNKNOWN", effectdata) [/lua] "UNKNOWN" is there because i'm not sure of the explosion effects. do they use particle systems[/QUOTE] [lua]util.Effect("Explosion", effectdata)[/lua]
  • Avatar of Gran PC
  • [QUOTE=Johnny Guitar;35395043]Whats up with silkicons in the gmod13 update [IMG]http://cloud.steampowered.com/ugc/595840894529618366/D6A978BC34009C4CEC2565476901052B1DD74BFF/[/IMG][/QUOTE] They got renamed to .png ones.
  • Avatar of Johnny Guitar
  • [QUOTE=Gran PC;35395778]They got renamed to .png ones.[/QUOTE] This is what I am using [QUOTE]PropertySheet:AddSheet( "Intro", SheetItemIntro, "gui/silkicons/heart.png", false, false, "Information about the store!" )[/QUOTE] Should this not be correct?
  • Avatar of pennerlord
  • [QUOTE=Johnny Guitar;35396440]This is what I am using Should this not be correct?[/QUOTE] "root\garrysmodbeta\materials\icon16\heart.png"
  • Avatar of Krizzu
  • Any snippet to get ID of player who is firing with specifically weapon?
  • Avatar of ArmageddonScr
  • I'm trying to get an entity to aim at a direction, but instead of it being instant it turn at a set rate What I have works fine except at a certain angle the entity does a full rotation in the other direction. [lua] if IsValid(mdl) then mdl:Remove() end mdl=ents.Create("prop_physics") mdl:SetModel("models/props_combine/headcrabcannister01a.mdl") mdl:SetAngles(Angle(0,180,0)) timer.Create("wdf",0.0000001,0,function() local owner=player.GetByID(1) if !IsValid(mdl) then return end if !IsValid(owner) then return end local ang=mdl:GetAngles() local targetangle=owner:EyeAngles() local speed=250*FrameTime() ang.y=math.Approach(ang.y,targetangle.y,speed) ang.p=math.Approach(ang.p,targetangle.p,speed) ang.r=0 mdl:SetAngles(ang) end) [/lua] What's the proper way to do this? [img]http://dl.dropbox.com/u/44439392/Other/hl2%202012-04-02%2022-58-56-625.gif[/img]
  • Avatar of fishcake
  • I'm not sure if this is the best place to ask this, but I'll give it a go anyway. I have a hook on the context menu mouse click, and I'm trying to get the point in the world where the mouse is being clicked as a map coordinate on the server. Does anyone know if this is possible and how I might go about doing it?
  • Avatar of ralle105
  • [lua] util.PlayerTrace(LocalPlayer(),gui.ScreenToVector(gui.MousePos())).HitPos [/lua]
  • Avatar of fishcake
  • Wouldn't that only work client side? I need the server to know where that position would be so I can create an entity.
  • Avatar of lorde banana
  • objPl:GetEyeTrace( ).HitPos ? well that would only work if you make the player's eyes follow the mouse, never mind
  • Avatar of fishcake
  • I had tried that but yea, the server only gets the position from the centre of the screen, rather than the mouse.
  • Avatar of ralle105
  • The server doesn't know the mouse position so you might as well do what I posted and then send the result to the server.
  • Avatar of fishcake
  • Alrighty, well, I guess I should ask this too. What would be the best way to send data to the server from a client?
  • Avatar of Drakehawke
  • [QUOTE=fishcake;35410185]Alrighty, well, I guess I should ask this too. What would be the best way to send data to the server from a client?[/QUOTE] [del][url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexd325.html?title=User_Messages[/url][/del] [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index43df.html?title=ConCommands[/url]
  • Avatar of lorde banana
  • [QUOTE=Drakehawke;35410217][url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexd325.html?title=User_Messages[/url][/QUOTE] he meant client -> server, he just worded it weird
  • Avatar of fishcake
  • [QUOTE=Drakehawke;35410217][del][url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexd325.html?title=User_Messages[/url][/del] [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index43df.html?title=ConCommands[/url][/QUOTE] Sweet, I shall take a look at doing it with concommands this evening. Thanks for your help guys.
  • Avatar of ollie
  • [QUOTE=fishcake;35410404]Sweet, I shall take a look at doing it with concommands this evening. Thanks for your help guys.[/QUOTE] Instead of using console commands you should use datastream. [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index6e5f.html?title=Datastream[/url]
  • Avatar of fishcake
  • Isn't that being removed in the Garry's Mod 13 update? I'd rather use code that will be usable when that update goes live, unless concommand stuff is changing too?
  • Avatar of lorde banana
  • [QUOTE=ollie;35411567]Instead of using console commands you should use datastream. [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index6e5f.html?title=Datastream[/url][/QUOTE] no offense, do you know what you're talking about
  • Avatar of ollie
  • [QUOTE=Banana Lord.;35411824]no offense, do you know what you're talking about[/QUOTE] I would like to see you transfer lets say.. a table with consolecommands.
  • Avatar of ollie
  • [QUOTE=ralle105;35411947]He isn't sending a table. You should never send a table.[/QUOTE] What would be the best way to transfer a table from client to server?
  • Avatar of pennerlord
  • [QUOTE=ollie;35411905]I would like to see you transfer lets say.. a table with consolecommands.[/QUOTE] Table -> Glon encode -> concommand -> Glon decode -> Table :eng101:
  • Avatar of ralle105
  • [QUOTE=pennerlord;35412204]Table -> Glon encode -> concommand -> Glon decode -> Table :eng101:[/QUOTE] That's exactly whata datastream does.
  • Avatar of ollie
  • [QUOTE=ralle105;35412443]That's exactly whata datastream does.[/QUOTE] So why do everyone think that datastream is shit?
  • Avatar of ralle105
  • [QUOTE=ollie;35412002]What would be the best way to transfer a table from client to server?[/QUOTE] My point is that if you know what you're doing you should never have to send a table. But you don't really know what you're doing, do you? [editline]3rd April 2012[/editline] [QUOTE=ollie;35412470]So why do everyone think that datastream is shit?[/QUOTE] Because sending a table, with datastream or without, creates a (potentially) large amount of unnecessary data being sent.
  • Avatar of BoInker
  • Hey dudes, I'm trying to make a SWEP flashlight but I'm hung up on trying to figure out how to actually draw the light. Is it possible to draw a clientside light who's position is an attachment on a viewmodel? I'm pretty sure it's possible, but I can't find the right hooks to use. The method I've tried is: [lua] local dynamicLight = DynamicLight if (dynamicLight) then dynamicLight.Brightness = 3; dynamicLight.DieTime = CurTime() + 0.1; dynamicLight.Decay = 384; dynamicLight.Size = 384; dynamicLight.Pos = self.Owner:GetAimVector(); -- replace me w/ model attachment stuff dynamicLight.r = 255; dynamicLight.g = 255; dynamicLight.b = 255; [/lua] In shared.lua under SWEP:Think(). But of course this didn't work and I suck. Any ideas?
  • Avatar of ArmageddonScr
  • The DynamicLight function is clientside only and afaik some swep functions don't get called clientside on singleplayer.