1. Post #321
    Gold Member
    LilRobot's Avatar
    January 2009
    1,803 Posts
    A real explosion or just the explosion effect?
    a real one, the effect i can make myself.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #322
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,789 Posts
    You'd want to do something like:

    Code:
    for k, v in pairs( ents.FindInSphere( hitpos, radius ) ) do
      info = DamageInfo( )
        info:SetDamageType( DMG_BLAST | DMG_DISSOLVE )
        info:SetDamage( 15 )
        info:SetAttacker( pl )
        info:SetInflictor( pl:GetActiveWeapon( ) )
        info:SetDamagePos( hitpos )
        info:SetDamageForce( ( v:GetPos( ) - hitpos ):GetNormal( ) * force )
      v:TakeDamageInfo( info )
    end
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #323
    pennerlord's Avatar
    February 2011
    503 Posts
    Another way:

    local explosion = ents.Create("env_explosion")
    explosion:SetPos(pos)
    explosion:SetKeyValue("iMagnitude", 100) -- damage
    explosion:SetKeyValue("iRadiusOverride", 250) -- radius
    explosion:Spawn()
    explosion:Fire("explode", "", 0)
    
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  4. Post #324
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,789 Posts
    That doesn't dissolve stuff.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  5. Post #325
    Gold Member
    LilRobot's Avatar
    January 2009
    1,803 Posts
    as for an explosion effect, i'm taking a wild guess that this modifier should work it
    local effectsplode = EffectData()
    	effectsplode:SetOrigin(tr.HitPos)
    	effectsplode:SetStart(tr.HitPos())
    	effectsplode:SetEntity(self)
    	util.Effect("UNKNOWN", effectdata)
    

    "UNKNOWN" is there because i'm not sure of the explosion effects. do they use particle systems?


    the only thing i really need right now though is a fix for my holdtype
    i'm pretty sure i entered it in right..

    SWEP.HoldType			= "SMG";
    
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #326
    Trans genders are gays with mental dis orders
    Dennab
    January 2012
    3,881 Posts
    Can't get any derma elements to scroll along with my scrollbar.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  7. Post #327
    PROUD BRONY 4LYFE
    Drakehawke's Avatar
    February 2009
    3,312 Posts
    Can't get any derma elements to scroll along with my scrollbar.
    Post code?
    Reply With Quote Edit / Delete Windows Vista United Kingdom Show Events

  8. Post #328
    Gold Member
    Rory's Avatar
    February 2005
    236 Posts
    I need an LUA script that will make names different colors. I'd like each level of admin etc to have their name in a separate color.

    This is for the sandbox game mode.
    Reply With Quote Edit / Delete Windows 7 Show Events

  9. Post #329
    Trans genders are gays with mental dis orders
    Dennab
    January 2012
    3,881 Posts
    Whats up with silkicons in the gmod13 update


    Reply With Quote Edit / Delete Windows 7 Canada Show Events Dumb Dumb x 1 (list)

  10. Post #330
    Gold Member
    ralle105's Avatar
    October 2005
    4,638 Posts
    I need an LUA script that will make names different colors. I'd like each level of admin etc to have their name in a separate color.

    This is for the sandbox game mode.
    This isn't a request thread, go the to the requests section.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 1 (list)

  11. Post #331
    pennerlord's Avatar
    February 2011
    503 Posts
    as for an explosion effect, i'm taking a wild guess that this modifier should work it
    local effectsplode = EffectData()
    	effectsplode:SetOrigin(tr.HitPos)
    	effectsplode:SetStart(tr.HitPos())
    	effectsplode:SetEntity(self)
    	util.Effect("UNKNOWN", effectdata)
    

    "UNKNOWN" is there because i'm not sure of the explosion effects. do they use particle systems
    util.Effect("Explosion", effectdata)
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  12. Post #332
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,110 Posts
    Whats up with silkicons in the gmod13 update


    They got renamed to .png ones.
    Reply With Quote Edit / Delete Windows 7 Spain Show Events

  13. Post #333
    Trans genders are gays with mental dis orders
    Dennab
    January 2012
    3,881 Posts
    They got renamed to .png ones.
    This is what I am using


    PropertySheet:AddSheet( "Intro", SheetItemIntro, "gui/silkicons/heart.png", false, false, "Information about the store!" )

    Should this not be correct?
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  14. Post #334
    pennerlord's Avatar
    February 2011
    503 Posts
    This is what I am using





    Should this not be correct?
    "root\garrysmodbeta\materials\icon16\heart.png "
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  15. Post #335
    Trans genders are gays with mental dis orders
    Dennab
    January 2012
    3,881 Posts
    "root\garrysmodbeta\materials\icon16\heart.png "
    Thank you.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Friendly Friendly x 1 (list)

  16. Post #336
    WHY WHEN WHY
    Krizzu's Avatar
    June 2011
    174 Posts
    Any snippet to get ID of player who is firing with specifically weapon?
    Reply With Quote Edit / Delete Windows 7 Poland Show Events

  17. Post #337
    ASK ME ABOUT MY SAM 6420 FETISH
    ArmageddonScr's Avatar
    July 2011
    691 Posts
    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.

    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)
    
    What's the proper way to do this?
    Reply With Quote Edit / Delete Windows XP United States Show Events

  18. Post #338
    jfoley.co.uk
    fishcake's Avatar
    November 2006
    72 Posts
    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?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  19. Post #339
    Gold Member
    ralle105's Avatar
    October 2005
    4,638 Posts
    util.PlayerTrace(LocalPlayer(),gui.ScreenToVector(gui.MousePos())).HitPos
    
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  20. Post #340
    jfoley.co.uk
    fishcake's Avatar
    November 2006
    72 Posts
    Wouldn't that only work client side? I need the server to know where that position would be so I can create an entity.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  21. Post #341
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,535 Posts
    objPl:GetEyeTrace( ).HitPos ?

    well that would only work if you make the player's eyes follow the mouse, never mind
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  22. Post #342
    jfoley.co.uk
    fishcake's Avatar
    November 2006
    72 Posts
    I had tried that but yea, the server only gets the position from the centre of the screen, rather than the mouse.
    Reply With Quote Edit / Delete United Kingdom Show Events

  23. Post #343
    Gold Member
    ralle105's Avatar
    October 2005
    4,638 Posts
    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.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  24. Post #344
    jfoley.co.uk
    fishcake's Avatar
    November 2006
    72 Posts
    Alrighty, well, I guess I should ask this too.

    What would be the best way to send data to the server from a client?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  25. Post #345
    PROUD BRONY 4LYFE
    Drakehawke's Avatar
    February 2009
    3,312 Posts
    Alrighty, well, I guess I should ask this too.

    What would be the best way to send data to the server from a client?
    http://maurits.tv/data/garrysmod/wik...=User_Messages

    http://maurits.tv/data/garrysmod/wik...le=ConCommands
    Reply With Quote Edit / Delete Windows Vista United Kingdom Show Events Disagree Disagree x 1 (list)

  26. Post #346
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,535 Posts
    he meant client -> server, he just worded it weird
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  27. Post #347
    jfoley.co.uk
    fishcake's Avatar
    November 2006
    72 Posts
    Sweet, I shall take a look at doing it with concommands this evening. Thanks for your help guys.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  28. Post #348
    LITTLE PREB FAGGOT
    ollie's Avatar
    January 2012
    890 Posts
    Sweet, I shall take a look at doing it with concommands this evening. Thanks for your help guys.
    Instead of using console commands you should use datastream.
    http://maurits.tv/data/garrysmod/wik...tle=Datastream
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Disagree Disagree x 10Dumb Dumb x 1 (list)

  29. Post #349
    jfoley.co.uk
    fishcake's Avatar
    November 2006
    72 Posts
    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?
    Reply With Quote Edit / Delete United Kingdom Show Events

  30. Post #350
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,535 Posts
    Instead of using console commands you should use datastream.
    http://maurits.tv/data/garrysmod/wik...tle=Datastream
    no offense, do you know what you're talking about
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  31. Post #351
    LITTLE PREB FAGGOT
    ollie's Avatar
    January 2012
    890 Posts
    no offense, do you know what you're talking about
    I would like to see you transfer lets say.. a table with consolecommands.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Dumb Dumb x 4 (list)

  32. Post #352
    Gold Member
    ralle105's Avatar
    October 2005
    4,638 Posts
    He isn't sending a table. You should never send a table.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  33. Post #353
    LITTLE PREB FAGGOT
    ollie's Avatar
    January 2012
    890 Posts
    He isn't sending a table. You should never send a table.
    What would be the best way to transfer a table from client to server?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  34. Post #354
    pennerlord's Avatar
    February 2011
    503 Posts
    I would like to see you transfer lets say.. a table with consolecommands.
    Table -> Glon encode -> concommand -> Glon decode -> Table
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  35. Post #355
    LITTLE PREB FAGGOT
    ollie's Avatar
    January 2012
    890 Posts
    -snip-
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  36. Post #356
    Gold Member
    ralle105's Avatar
    October 2005
    4,638 Posts
    Table -> Glon encode -> concommand -> Glon decode -> Table
    That's exactly whata datastream does.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 1 (list)

  37. Post #357
    LITTLE PREB FAGGOT
    ollie's Avatar
    January 2012
    890 Posts
    That's exactly whata datastream does.
    So why do everyone think that datastream is shit?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  38. Post #358
    Gold Member
    ralle105's Avatar
    October 2005
    4,638 Posts
    What would be the best way to transfer a table from client to server?
    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?

    Edited:

    So why do everyone think that datastream is shit?
    Because sending a table, with datastream or without, creates a (potentially) large amount of unnecessary data being sent.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 2 (list)

  39. Post #359
    BoInker's Avatar
    June 2007
    38 Posts
    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:

    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;
    

    In shared.lua under SWEP:Think(). But of course this didn't work and I suck. Any ideas?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  40. Post #360
    ASK ME ABOUT MY SAM 6420 FETISH
    ArmageddonScr's Avatar
    July 2011
    691 Posts
    The DynamicLight function is clientside only and afaik some swep functions don't get called clientside on singleplayer.
    Reply With Quote Edit / Delete Windows XP United States Show Events