• What do you need help with? V3
    6,419 replies, posted
[QUOTE=infinitywrai;39208664]How does this function work? I don't understand what the last 4 parameters do: [url]http://wiki.garrysmod.com/page/Libraries/surface/DrawTexturedRectUV[/url] What is U and V?[/QUOTE] U and V refer to texture coordinates. 0,0 is the bottom left corner of the texture, 1,0 is the bottom right, 1,1 is the top right and 0,1 is the top left.
Can anyone tell me how to fix this: [img_thumb]https://dl.dropbox.com/u/4764969/cloudattachment.PNG[/img_thumb] The cloud moves when my aim pos changes, which makes no sense because I've attached it to the players pos + Vector(0,0,75)
[QUOTE=Netheous;39209117]Can anyone tell me how to fix this: [img_thumb]https://dl.dropbox.com/u/4764969/cloudattachment.PNG[/img_thumb] The cloud moves when my aim pos changes, which makes no sense because I've attached it to the players pos + Vector(0,0,75)[/QUOTE] It's a clientside bug. Other players see it fine.
-snip- fixed
☺
[QUOTE=vexx21322;39209156]It's a clientside bug. Other players see it fine.[/QUOTE] But it's not placed by client, I do it serverside :O [lua] function Eff(ply) if not IsValid(ply) then return end if ply:IsSuperAdmin() then local effect = ents.Create("info_particle_system") effect:SetPos(ply:GetPos()+Vector(0,0,75)) effect:SetParent(ply) effect:SetKeyValue("effect_name", "unusual_storm") effect:SetKeyValue("start_active", "1") effect:Spawn() effect:Activate() end end hook.Add("PlayerSpawn", "Eff", Eff)[/lua]
[QUOTE=Netheous;39209250]But it's not placed by client, I do it serverside :O [lua] function Eff(ply) if not IsValid(ply) then return end if ply:IsSuperAdmin() then local effect = ents.Create("info_particle_system") effect:SetPos(ply:GetPos()+Vector(0,0,75)) effect:SetParent(ply) effect:SetKeyValue("effect_name", "unusual_storm") effect:SetKeyValue("start_active", "1") effect:Spawn() effect:Activate() end end hook.Add("PlayerSpawn", "Eff", Eff)[/lua][/QUOTE] I meant clientside as in you viewing it on yourself. If you view it on another player, it's fine.
[QUOTE=vexx21322;39209286]I meant clientside as in you viewing it on yourself. If you view it on another player, it's fine.[/QUOTE] Oh, so I should attach it to a bot or something to test out ? Roger that, I'll tell you how it was @Edit: Yep, it's fine now
How exactly does PhysicsFromMesh work? I have my 8 points for each of the vert, and the tables for each of the triangles for each face (2 triangles per face), but where do I go from there?
In a derma menu, how can I have text in the text box, telling what people should write (like a [url=http://i919.photobucket.com/albums/ad39/shawpnendu/MyBlog/watermark_textbox.jpg]js watermark[/url].)
Use this: [code]TextEntry:SetText( "Your default text" )[/code] Full code : [code]local TextEntry = vgui.Create( "DTextEntry", DPanel ) TextEntry:SetPos( x, y ) TextEntry:SetText( "This is a test" ) TextEntry:SetTall( 20 ) TextEntry:SetWide( 350 )[/code] TextEntry = TextBox
[QUOTE=Feihc;39211038]How exactly does PhysicsFromMesh work? I have my 8 points for each of the vert, and the tables for each of the triangles for each face (2 triangles per face), but where do I go from there?[/QUOTE] AFAIK the table it takes is exactly the same structure as the one [url=http://wiki.garrysmod.com/page/Classes/IMesh/BuildFromTriangles]this function[/url] takes.
[img]http://pictat.com/i/2013/1/14/27228eh.jpg[/img] I made a new lua file and tried to include it but my console tells me the file can't be found. The file cl_extra.lua is in the same directory as cl_hints which is being included fine. Any help would be appreciated. (excuse the l33t paint skills)
[QUOTE=Bilsta1000;39214862][IMG]http://pictat.com/i/2013/1/14/27228eh.jpg[/IMG] I made a new lua file and tried to include it but my console tells me the file can't be found. The file cl_extra.lua is in the same directory as cl_hints which is being included fine. Any help would be appreciated. (excuse the l33t paint skills)[/QUOTE] You need to AddCSLuaFile it on the server too.
Ah, I see. Thanks a bunch.
Ban all DarkRP discussions from this forum? [img]http://www.facepunch.com/fp/ratings/tick.png[/img] or [img]http://www.facepunch.com/fp/ratings/cross.png[/img]
[QUOTE=garry;39215754]Ban all DarkRP discussions from this forum? [img]http://www.facepunch.com/fp/ratings/tick.png[/img] or [img]http://www.facepunch.com/fp/ratings/cross.png[/img][/QUOTE] Depends, if it's 100% darkrp ban I'd prefer not, I'm sure there are some legitimate vaguely darkrp related questions. Also, does anyone know if there's a way to hook when an event is fired on any entity? Like when the "Unlock" event is fired on a door.
[QUOTE=Ylsid;39217493] Also, does anyone know if there's a way to hook when an event is fired on any entity? Like when the "Unlock" event is fired on a door.[/QUOTE] I VAGUELY remember there being some way to do this from a while back, but it seemed super hacky. I know garry just added [quote=Garrysmod.com]Added Entity:AddCallback( name, function ) This adds a callback to a specific event. The only available event right now is “OnAngleChange” - which is called when the entity’s angle changes. This is a new system I’ll be using from now on - so that instead of needlessly calling empty functions from entities all of the time - they’ll only get called when the entity has requested it. This also has the benefit of working on non-lua created entities.[/quote] But like the description says, only has the one function right now. Hopefully there will be a way to hook into inputs/outputs on entities as well later.
-snip misread-
Hello, I have a prop which when it touches another entity it explodes and starts them on fire. Issue is, it only starts the prop it touches on fire. With ignite, looking at the old wiki it says it takes 2 parameters, time and radius. With the new wiki it doesnt specify if radius is a valid parameter but from testing I'm thinking its been removed? Even if i give the radius 100000 it only ignites 1 prop on fire but in reality every prop around it should be on fire. Anyone know a way to do fire spread with gmod13? [CODE]function ENT:PhysicsCollide( data, physobj) local original = physobj:GetEntity( ) local ent = data.HitEntity local phys = ent:GetPhysicsObject() local inflictor = original local attacker = original local position = original:GetPos() local radius = 400 local damage = 10 if !ent:IsWorld() && !ent:IsPlayer() then if CurTime() > original.ActivationTime then ent:Ignite(16,0) timer.Simple(15, function() if IsValid(ent) then ent:Extinguish() end end) original:Ignite(15,0) original:Fire( "Explode", "", 0 ) util.BlastDamage(inflictor, attacker, position, radius, damage) original:Fire( "Kill", "", .1 ) end end end[/CODE]
[QUOTE=Ylsid;39217493]Also, does anyone know if there's a way to hook when an event is fired on any entity? Like when the "Unlock" event is fired on a door.[/QUOTE] Currently, SENTS have ENT:AcceptInput which does exactly that, but it wouldn't work on any given entity.
[QUOTE=tissue902;39219968]stuff[/QUOTE] try: [lua] local Ignited = {} for k,v in pairs( ents.FindInSphere(self:GetPos(), radius) ) do if IsValid(v) then v:Ignite() Ignited[#Ignited + 1] = v end end timer.Simple( 10, function() for i=1, #Ignited do local v = Ignited[i] v:Extinguish() end end) [/lua] untested [editline]14th January 2013[/editline] just looked up Ignite() on the wiki, this one should work better.
thanks man that worked.
I'm having trouble creating an SNPC. I have the files in mygamemode/enitities/entities/my_spnc. I try to create it with ents.Create but it gives me an "unknown entity type" Is the snpc stuff on the old wiki outdated maybe?
How do I make my SNPC move? I've tried everything. NavSetGoal, schedules, etc..
Well what i exactly need help with is a good tutorial for learning how to code lua in the love2d engine the community isnt very alive and the little amount of tuts really arnt helping me understand the language
[QUOTE=More Ragtime;39220678]Well what i exactly need help with is a good tutorial for learning how to code lua in the love2d engine the community isnt very alive and the little amount of tuts really arnt helping me understand the language[/QUOTE] nothing special about "love2d" lua, it's just as unspecial as "garrysmod" lua. go through the lua PIL and google what you need help with, look at existing projects and bam, you're a lua master.
[QUOTE=tissue902;39219968]Hello, I have a prop which when it touches another entity it explodes and starts them on fire. Issue is, it only starts the prop it touches on fire. With ignite, looking at the old wiki it says it takes 2 parameters, time and radius. With the new wiki it doesnt specify if radius is a valid parameter but from testing I'm thinking its been removed? Even if i give the radius 100000 it only ignites 1 prop on fire but in reality every prop around it should be on fire. Anyone know a way to do fire spread with gmod13? [CODE]function ENT:PhysicsCollide( data, physobj) local original = physobj:GetEntity( ) local ent = data.HitEntity local phys = ent:GetPhysicsObject() local inflictor = original local attacker = original local position = original:GetPos() local radius = 400 local damage = 10 if !ent:IsWorld() && !ent:IsPlayer() then if CurTime() > original.ActivationTime then ent:Ignite(16,0) timer.Simple(15, function() if IsValid(ent) then ent:Extinguish() end end) original:Ignite(15,0) original:Fire( "Explode", "", 0 ) util.BlastDamage(inflictor, attacker, position, radius, damage) original:Fire( "Kill", "", .1 ) end end end[/CODE][/QUOTE] [lua] function ENT:PhysicsCollide( data, physobj) local original = physobj:GetEntity( ) local ent = data.HitEntity local phys = ent:GetPhysicsObject() local inflictor = original local attacker = original local position = original:GetPos() local radius = 400 local damage = 10 if !ent:IsWorld() && !ent:IsPlayer() then if CurTime() > original.ActivationTime then for _,v in pairs(ents.FindInSphere(self:GetPos(), 200)) do v:Ignite(16,0) timer.Simple(15, function() if IsValid(v) then v:Extinguish() end end) end original:Ignite(15,0) original:Fire( "Explode", "", 0 ) util.BlastDamage(inflictor, attacker, position, radius, damage) original:Fire( "Kill", "", .1 ) end end end [/lua]
[QUOTE=sonyfuzion;39220594]How do I make my SNPC move? I've tried everything. NavSetGoal, schedules, etc..[/QUOTE] After looking through the forums for your problem and mine the conclusion I've reached is that garry broke something with snpcs that hasn't been fixed yet. Anyone have an idea?
[QUOTE=Sean C;39221030]After looking through the forums for your problem and mine the conclusion I've reached is that garry broke something with snpcs that hasn't been fixed yet. Anyone have an idea?[/QUOTE] yes snpc are broken at this moment
Sorry, you need to Log In to post a reply to this thread.