• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=Z0mb1n3;48505310]hnggggg i don't know why I didn't see this, but you're invoking the method version (correct me if my terminology is wrong) and so the first argument ends up being the panel itself, so you're missing an argument. should be [code]presetVoices.OnSelect = function(self, index, value, data)[/code] [editline]20th August 2015[/editline] -snip- Vel, I don't see a function named FireGrenade in that code anywhere. Are you sure that's the full file?[/QUOTE] I fixed that and replaced the "FireMissle" function with "FireGrenade", and I don't get any errors, but nothing happens when I fire. Here's the new code. [url]http://pastebin.com/eTARryzJ[/url] I'm sure I just don't have the right stuff in the function, but i've not been able to find what I need to put in there by looking it up online.
[QUOTE=.Vel;48505421]I fixed that and replaced the "FireMissle" function with "FireGrenade", and I don't get any errors, but nothing happens when I fire. Here's the new code. [url]http://pastebin.com/eTARryzJ[/url] I'm sure I just don't have the right stuff in the function, but i've not been able to find what I need to put in there by looking it up online.[/QUOTE] Well firstly, the argument that FireGrenade takes is a model path. "rpg_missile" is not a model path, it is the name of an entity. Try this as the argument: [code]"models/weapons/w_missile_launch.mdl"[/code]
[QUOTE=Z0mb1n3;48505550]Well firstly, the argument that FireGrenade takes is a model path. "rpg_missile" is not a model path, it is the name of an entity. Try this as the argument: [code]"models/weapons/w_missile_launch.mdl"[/code][/QUOTE] Still doesn't work. I think I may have messed something up in the function itself when editing a few days ago. How would I make it an entity path/spawn an entity?
[QUOTE=.Vel;48505597]Still doesn't work. I think I may have messed something up in the function itself when editing a few days ago. How would I make it an entity path/spawn an entity?[/QUOTE] Found the error. Since you have it in the FireGrenade function as spawning an rpg_missile (find ents.Create), it has no physics object. There's a statement that says [code] local phys = ent:GetPhysicsObject() if ( !IsValid( phys ) ) then ent:Remove() return end[/code] Delete that, and then I recommend where it says ent:SetPos, change it to [code]ent:SetPos( self.Owner:GetShootPos() + self.Owner:GetAimVector()*20 )[/code] Also delete lines 101 to 104, useless now. Oh and the missile will probably blow up if you touch it, so add somewhere around line 100 [code]ent:SetOwner( self.Owner )[/code]
[QUOTE=Z0mb1n3;48505783]Found the error. Since you have it in the FireGrenade function as spawning an rpg_missile (find ents.Create), it has no physics object. There's a statement that says [code] local phys = ent:GetPhysicsObject() if ( !IsValid( phys ) ) then ent:Remove() return end[/code] Delete that, and then I recommend where it says ent:SetPos, change it to [code]ent:SetPos( self.Owner:GetShootPos() + self.Owner:GetAimVector()*20 )[/code] Also delete lines 101 to 104, useless now. Oh and the missile will probably blow up if you touch it, so add somewhere around line 100 [code]ent:SetOwner( self.Owner )[/code][/QUOTE] Still does nothing. Thanks for the help though.
[QUOTE=.Vel;48506080]Still does nothing. Thanks for the help though.[/QUOTE] So you're calling it like this: [code]self:FireGrenade("models/weapons/w_missile_launch.mdl")[/code] And you get no errors? Nothing happens?
[QUOTE=Z0mb1n3;48506122]So you're calling it like this: [code]self:FireGrenade("models/weapons/w_missile_launch.mdl")[/code] And you get no errors? Nothing happens?[/QUOTE] Yeah, nothing happens besides the shootsound being played
How to check if particle emitter is valid? IsValid didn't work for some reason
[QUOTE=Z0mb1n3;48505310]hnggggg i don't know why I didn't see this, but you're invoking the method version (correct me if my terminology is wrong) and so the first argument ends up being the panel itself, so you're missing an argument. should be [code]presetVoices.OnSelect = function(self, index, value, data)[/code][/QUOTE] Putting it in "function" form seemed to have fixed it and I never knew you needed to add self to the OO panel version of things so thanks.
any convenient ways of copying a players pose onto a ragdoll? Tried looping through the bones storing the positions and angles then applying them to the ragdoll but it seems to do jack shit so I'm probably using it wrong :drool: Edit: Have some motivational moving pictures to get an idea of what I'm doing: [media]https://www.youtube.com/watch?v=xdrGyqt8JOc[/media]
-snip-
[QUOTE=wranders;48508399]Where are file in gamemode mounted when the gamemode starts? I'm trying to include a gamemode file in an addon, but I can't get the right file location. The holding the include in the addon is under 'lua/autorun' and the gamemode file is in '[gamemodename]/gamemode'. I know the addon mounts where it says it is, so I've tried [CODE] include("../../gamemodes/[gamemodename]/gamemode/[filetoinclude].lua") -- And have also tried this, thinking that the gamemode files mounted to /lua/. include("../[filetoinclude].lua") [/CODE] but that didn't work.[/QUOTE] You can't really do this because AFAIK only the active gamemode is loaded (so only files from active gamemode can be included) and there's no point in actually doing that.
[QUOTE=Robotboy655;48508403]You can't really do this because AFAIK only the active gamemode is loaded (so only files from active gamemode can be included) and there's no point in actually doing that.[/QUOTE] I'm not creating an actual addon, just trying to test out a little system in the gamemode I'm making, so that if anyone ever decides to make an addon for it, the proper things are cached in the gamemode pre-init. The first include example I gave worked, I just had a space at the beginning of the string. :downs: Glad I found that 3 seconds [I]after[/I] I posted here. Thanks! [B]Edit:[/B] And yeah, I'm having it run only if GAMEMODE_NAME returns my gamemode.
[QUOTE=wranders;48508434]I'm not creating an actual addon, just trying to test out a little system in the gamemode I'm making, so that if anyone ever decides to make an addon for it, the proper things are cached in the gamemode pre-init. The first include example I gave worked, I just had a space at the beginning of the string. :downs: Glad I found that 3 seconds [I]after[/I] I posted here. Thanks! [B]Edit:[/B] And yeah, I'm having it run only if GAMEMODE_NAME returns my gamemode.[/QUOTE] The best way for modding support is using hooks, instead of focing modders to include some files.
Anybody know why this happens? Is this normal with custom models? [thumb]http://i.imgur.com/caz7te4.png[/thumb] These work perfectly fine with png&jpeg on the default citizen models but I am using Enhanced Citizens. If I use a vtf with Enhanced Citizens it works just fine but I planned on using png mainly. I should also note that I am using render.MaterialOverrideByIndex not SetSubMaterial. Not sure if it will help but here is where I create the material for the images [code] local material = htmlPanel:GetHTMLMaterial(); local materialID = string.Replace(material:GetName(), "__vgui_texture_", ""); local matData = { ["$basetexture"] = material:GetName(), ["$model"] = 1 }; cache[uniqueID] = CreateMaterial("fMaterials_"..materialID, "VertexLitGeneric", matData); [/code]
[QUOTE=yesfish;48496932]How can I ensure alpha blended SENTs actually render last? They look fine against brushes and larger props but smaller props and NPCs always draw over the top of my translucent SENTs and I can't find any answers on google as to why![/QUOTE] Found the answer to my own problem. In the entity declaration: [code]ENT.RenderGroup = RENDERGROUP_TRANSLUCENT[/code] [url]http://wiki.garrysmod.com/page/Enums/RENDERGROUP[/url]
Is there any way to check if the player's client is completely loaded and that you can call clientside functions like Team and GetActiveWeapon? if not ply:GetActiveWeapon() then return end is giving me errors about GetActiveWeapon() not existing.
[QUOTE=Dakotacss;48509638]Anybody know why this happens? Is this normal with custom models? [IMG]http://i.imgur.com/caz7te4.png[/IMG] These work perfectly fine with png&jpeg on the default citizen models but I am using Enhanced Citizens. If I use a vtf with Enhanced Citizens it works just fine but I planned on using png mainly. I should also note that I am using render.MaterialOverrideByIndex not SetSubMaterial. Not sure if it will help but here is where I create the material for the images [code] local material = htmlPanel:GetHTMLMaterial(); local materialID = string.Replace(material:GetName(), "__vgui_texture_", ""); local matData = { ["$basetexture"] = material:GetName(), ["$model"] = 1 }; cache[uniqueID] = CreateMaterial("fMaterials_"..materialID, "VertexLitGeneric", matData); [/code][/QUOTE] [code]["$basetexturetransform"] = "center 0 0 scale 1 1 rotate 0 translate 0 -2"[/code]
[QUOTE=Hoffa1337;48507717]any convenient ways of copying a players pose onto a ragdoll? Tried looping through the bones storing the positions and angles then applying them to the ragdoll but it seems to do jack shit so I'm probably using it wrong :drool: Edit: Have some motivational moving pictures to get an idea of what I'm doing: [media]https://www.youtube.com/watch?v=xdrGyqt8JOc[/media][/QUOTE] Copying the bone angles to the ragdoll from the player entity is what I have done in the past to make it a smooth transition from player to ragdoll.
[QUOTE=Revenge282;48512241]Copying the bone angles to the ragdoll from the player entity is what I have done in the past to make it a smooth transition from player to ragdoll.[/QUOTE] did you get the player colors working?
[QUOTE=Giraffen93;48511808][code]["$basetexturetransform"] = "center 0 0 scale 1 1 rotate 0 translate 0 -2"[/code][/QUOTE] Thank you so much! Everything works perfect now.
[QUOTE=Hoffa1337;48512518]did you get the player colors working?[/QUOTE] [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/matproxy/player_color.lua[/url] might be useful in figuring it out, but I never messed with it past realizing it didn't work off the bat.
Is it normal for an emit sound to have an echo?
[QUOTE=Revenge282;48513103][url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/matproxy/player_color.lua[/url] might be useful in figuring it out, but I never messed with it past realizing it didn't work off the bat.[/QUOTE] i took a look at it the ragdoll ent needs to have a function called ent:GetPlayerColor() that returns the ragdoll color as a vector; if it doesn't, it'll use the default dark blue instead also if ent:GetRagdollOwner() returns something valid (should be a player entity), it'll try to grab the player color from them instead
[QUOTE=Hoffa1337;48512518]did you get the player colors working?[/QUOTE] [lua] playerRagdoll.GetPlayerColor = function( ) return aColor end [/lua] Make sure you override the GetPlayerColor function of the ragdoll on the client as well.
I want a certain Lua file only to run if another addon is present (you get errors if both files aren't present). Would I do this by looping throuh [URL="http://wiki.garrysmod.com/page/engine/GetAddons"]engine.GetAddons()[/URL] to find it, or is there a cheaper/faster way to check for a specific one? Would this be slow/cause lag? [CODE] local function AddonCheck( boolean ) for i,v in ipairs(engine.GetAddons()) do function() if title[v] == //desired adddon name if mounted[v] == true then return true else return false else return false end end end end end [/CODE] Also I don't have a lot of experience with loops so im not sure if that syntax is 100% correct
[QUOTE=Becomeimp;48514673]I want a certain Lua file only to run if another addon is present (you get errors if both files aren't present). Would I do this by looping throuh [URL="http://wiki.garrysmod.com/page/engine/GetAddons"]engine.GetAddons()[/URL] to find it, or is there a cheaper/faster way to check for a specific one? Would this be slow/cause lag? [CODE] local function AddonCheck( boolean ) for i,v in ipairs(engine.GetAddons()) do function() if title[v] == //desired adddon name if mounted[v] == true then return true else return false else return false end end end end end [/CODE] Also I don't have a lot of experience with loops so im not sure if that syntax is 100% correct[/QUOTE] A better solution would be to check for any globals created by that addon, assuming there are some.
[QUOTE=Becomeimp;48514673]I want a certain Lua file only to run if another addon is present (you get errors if both files aren't present). Would I do this by looping throuh [URL="http://wiki.garrysmod.com/page/engine/GetAddons"]engine.GetAddons()[/URL] to find it, or is there a cheaper/faster way to check for a specific one? Would this be slow/cause lag? [CODE] local function AddonCheck( boolean ) for i,v in ipairs(engine.GetAddons()) do function() if title[v] == //desired adddon name if mounted[v] == true then return true else return false else return false end end end end end [/CODE] Also I don't have a lot of experience with loops so im not sure if that syntax is 100% correct[/QUOTE] It's late here, so I may be reading it wrong, but you're checking the addons against a table. (mounted[v] == true) Shouldn't you be checking if the addon is registered by doing 'v.mounted == true'? Same thing for title.
[QUOTE=man with hat;48514847]A better solution would be to check for any globals created by that addon, assuming there are some.[/QUOTE] Thanks, I'll take a look into this route! [QUOTE=Z0mb1n3;48514898]It's late here, so I may be reading it wrong, but you're checking the addons against a table. (mounted[v] == true) Shouldn't you be checking if the addon is registered by doing 'v.mounted == true'? Same thing for title.[/QUOTE] the output of engine.GetAddons() is a table thats like this: (example from wiki) [CODE] 1: downloaded = true models = 0 title = Title of Addon file = addons/title_of_addon_123456789.gma mounted = true wsid = 123456789 [/CODE] I'm checking first for the correct addon title, then if the said addon has a "true" boolean for "mounted". Like I said, I may be a bit off on the syntax?
[QUOTE=Revenge282;48513103][URL]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/matproxy/player_color.lua[/URL] might be useful in figuring it out, but I never messed with it past realizing it didn't work off the bat.[/QUOTE] Ok so colors are working as they should but I get spammed with "SetBonePosition: Bone is unwritable" [lua] if SERVER then AddCSLuaFile() util.AddNetworkString( "NeuroWeapons_TransmitBoneUpdate" ) local mEntity = FindMetaTable( "Player" ) function mEntity:CopyAllBoneAngles( target ) net.Start( "NeuroWeapons_TransmitBoneUpdate" ) net.WriteEntity( target ) net.WriteEntity( self ) net.Broadcast() end end if CLIENT then net.Receive( "NeuroWeapons_TransmitBoneUpdate", function( length, client ) local target = net.ReadEntity() local pplayer = net.ReadEntity() if( IsValid( target ) && IsValid( pplayer ) ) then target.GetPlayerColor = function( ) return IsValid( pplayer ) and pplayer:GetPlayerColor() or Vector( 1,1,1 ) end target:SetModel( pplayer:GetModel() ) -- fix inconsistency with bot player models not applying instantly on spawn. target:InvalidateBoneCache() for i=0,pplayer:GetBoneCount() do local tp,ta = pplayer:GetBonePosition( i ) if( tp && ta ) then target:SetBonePosition( i, tp, ta ) end end end end ) end [/lua] What am I missing ?
Sorry, you need to Log In to post a reply to this thread.