• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
Still puzzled by this question and its holding up my project. Is there a way to use the map's navmesh to get a table of walkable vectors between 2 points? I [B]really [/B]don't want to have to make an invisible nextbot that walks the path and have my entity follow it but that might be the only choice
[QUOTE=Exho;48578192]Still puzzled by this question and its holding up my project. Is there a way to use the map's navmesh to get a table of walkable vectors between 2 points? I [B]really [/B]don't want to have to make an invisible nextbot that walks the path and have my entity follow it but that might be the only choice[/QUOTE] have you tried [URL="http://wiki.garrysmod.com/page/Category:PathFollower"]this[/URL]? edit:nevermind requires a nextbot to use compute
[QUOTE=skullorz;48578214]have you tried [URL="http://wiki.garrysmod.com/page/Category:PathFollower"]this[/URL]? edit:nevermind requires a nextbot to use compute[/QUOTE] Yup thats how my nextbots work. Its so silly because the PathFollower does exactly what I want to do but all that stuff is hidden so I don't have access to figuring out what vector its trying to go to next or how to get there
[QUOTE=Exho;48578245]Yup thats how my nextbots work. Its so silly because the PathFollower does exactly what I want to do but all that stuff is hidden so I don't have access to figuring out what vector its trying to go to next or how to get there[/QUOTE] Maybe this is worth a try. [url]https://github.com/MeltedBu11et/GM-A-Pathfinder[/url]
We fixed it by removing a playermodel from the server. The issue was with this [url]http://steamcommunity.com/sharedfiles/filedetails/?id=449548997[/url] playermodel.
[QUOTE=KnightDmG;48576846]My server causes players to crash from time to time giving them the error message too many indices for index buffer. . tell a programmer (43350>32768) Some players have 36882>32768, the numbers might change from person to person, as I don't have everyone sending them to me. Is there something I could do to fix this?[/QUOTE] [QUOTE=KnightDmG;48579537]We fixed it by removing a playermodel from the server. The issue was with this [url]http://steamcommunity.com/sharedfiles/filedetails/?id=449548997[/url] playermodel.[/QUOTE] If I'm remembering correctly from earlier in the thread, that error is caused by the game trying to draw decals on a model with way too many polygons. These could be blood splatters on a playermodel, bullet holes on a map prop, or anything else like that, as long as the model is horribly unoptimized/was made for an engine more modern than Source and has eleventy billion polys for some reason.
[QUOTE=Mista Tea;48573280]Is "[B]ScoreboardText[/B]" still a valid font anywhere within Garry's Mod? I'm dealing with an older Wire Extras tool and getting the following: [code][ERROR] lua/includes/modules/draw.lua:146: 'ScoreboardText' isn't a valid font[/code] If you know of a font that has replaced ScoreboardText, let me know. I'd like to create an issue/request on the Wire-Extras GitHub page.[/QUOTE] ScoreboardDefault is the new ScoreboardText, but is now Helvetica with 22px. The old ScoreboardText was Trebuchet with 24px, so you could replace it with Trebuchet24, which is identical to the old one. you can find all the default fonts here: [url]http://wiki.garrysmod.com/page/Default_Fonts[/url]
I have a couple questions regarding NPCs: 1: How can I use AddEntityRelationship to make a NPC consider all other NPCs and players as enemies? Using a single loop where both relationships are added doesn't seem to work. 2: How can I add a citizen to the player's squad? Thanks
[code] bullet.Callback = function(client, trace, dmg) if IsValid(client) and client:IsPlayer() then if trace.Hit and not trace.HitSky then local chance = math.random(1,100) if chance >= 60 then local emitter = ents.Create( "prop_physics" ) emitter:SetModel( "models/hunter/plates/plate.mdl" ) emitter:SetPos( trace.HitPos + (trace.HitNormal * 1) ) emitter:SetAngles( Angle(0,0,0) ) emitter:Spawn() emitter:Activate() emitter:GetPhysicsObject():EnableMotion(false) emitter:SetNotSolid( true ) emitter:SetRenderMode( 1 ) emitter:SetColor( Color(0,0,0,0) ) --client:SetPos(emitter:GetPos()) ParticleEffectAttach( "fire_verysmall_01", PATTACH_ABSORIGIN_FOLLOW, emitter, 0 ) SafeRemoveEntityDelayed( emitter, 6 ) end elseif trace.Hit and IsValid(trace.Entity) and not trace.HitWorld then local chance = math.random(1,100) if chance >= (100 - IncenIgniteChance) then trace.Entity:Ignite(math.random(5,12)) end end end end [/code] The PHX block is successfully created, but the particle system is not. Calling the chunk of code that creates a block and the particle system works just fine with lua_run, but not from here. The hook is being called serverside through entity fire bullets. EDIT2 OKAY, so apparently nothing particle related can be created inside of a bullet callback? [editline]31st August 2015[/editline] [QUOTE=TFA;48581710]I have a couple questions regarding NPCs: 1: How can I use AddEntityRelationship to make a NPC consider all other NPCs and players as enemies? Using a single loop where both relationships are added doesn't seem to work. 2: How can I add a citizen to the player's squad? Thanks[/QUOTE] 1. Have you tried [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/NPC/AddRelationship"]NPC:AddRelationship[/URL], and calling it when the NPC is spawned? That part works for NPCs, but for players you need to use [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/NPC/AddEntityRelationship"]NPC:AddEntityRelationship[/URL] I recommend putting that in a think hook and use [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/NPC/Disposition"]NPC:Disposition[/URL] to check if the statuses don't match and then set them accordingly.
-snip- Fixed
Is there a way to modify the threshold for fall damage? It seems that damage isn't considered fall damage until the player's speed is over 525 or so, and I'd like to lower that to about 400.
[QUOTE=wranders;48593735]Is there a way to modify the threshold for fall damage? It seems that damage isn't considered fall damage until the player's speed is over 525 or so, and I'd like to lower that to about 400.[/QUOTE] Yes. Use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnPlayerHitGround]GM/OnPlayerHitGround[/url] and create the appropriate damage. Then just remove [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/GetFallDamage]GM/GetFallDamage[/url] from the equation. I will post specifics when I get home from work if you still need them.
I need to re-scale the map. Sounds weird, but I kinda do. The following does not work: This is a rough example. Drawing the map model this way, causes some major issues with 2D skyboxes. I need a better method to render the map. [code] Entity(0):SetNoDraw( true ) Entity(0):DrawModel( ) Entity(0):SetModelScale( 20, 0 ) [/code] (20 because 0.05 * 20 = 1. 1 is normal scale.) Why? I scaled down everything in the source engine by 0.05. The picture of the problem is here: [t]https://dl.dropboxusercontent.com/u/17839069/C_345.png[/t] If I kept the model's normal scale. YET, I increased the scale of the map. I could side-step a major issue which would be Vector rounding. The code I posted, is a rough guess of how I would accomplish it. It might seem like it works, however I need it to work properly. So far, there's a method I could avoid this vector-rounding. Which would involve: [code] cam.Start3D( ); cam.IgnoreZ( true ) Ply:DrawModel( ) cam.IgnoreZ( false ) cam.End3D( ) [/code] But it's way too unfair. Hacky and almost unusable. If you have suggestions, please post them.
Hey i have a problem with my lua code for the pointshop addon. My gameserver have different gamemodes and in one gamemode (morbus) the pointshop skins destroy the gameplay. So i tried to solve the problem without lua experience. I added to the pointshop/lua/autorun/pointshop.lua these code: [CODE] // added if (game.GetMap() != "gm_construct") then return end // pointshop if SERVER then AddCSLuaFile() include "pointshop/sv_init.lua" end if CLIENT then include "pointshop/cl_init.lua" end PS:Initialize()[/CODE] (gm_construct just for testing) [U][B]It´s working,[/B][/U] but when i try to add more maps with the operator "or" it don't work anymore... without a error. I also try the same thing with gmod.GetGamemode and gmod.GetGamemode().Name (for sure i printed the correct names) but without succes or a error :D [CODE] // added if (gmod.GetGamemode() != "sandbox") then return end // pointshop if SERVER then AddCSLuaFile() include "pointshop/sv_init.lua" end if CLIENT then include "pointshop/cl_init.lua" end PS:Initialize()[/CODE]
[QUOTE=nattax;48596753]Hey i have a problem with my lua code for the pointshop addon. My gameserver have different gamemodes and in one gamemode (morbus) the pointshop skins destroy the gameplay. So i tried to solve the problem without lua experience. I added to the pointshop/lua/autorun/pointshop.lua these code: [CODE] // added if (game.GetMap() != "gm_construct") then return end // pointshop if SERVER then AddCSLuaFile() include "pointshop/sv_init.lua" end if CLIENT then include "pointshop/cl_init.lua" end PS:Initialize()[/CODE] (gm_construct just for testing) [U][B]It´s working,[/B][/U] but when i try to add more maps with the operator "or" it don't work anymore... without a error. I also try the same thing with gmod.GetGamemode and gmod.GetGamemode().Name (for sure i printed the correct names) but without succes or a error :D [CODE] // added if (gmod.GetGamemode() != "sandbox") then return end // pointshop if SERVER then AddCSLuaFile() include "pointshop/sv_init.lua" end if CLIENT then include "pointshop/cl_init.lua" end PS:Initialize()[/CODE][/QUOTE] [code]if !(gmod.GetMap() == "gm_construct" or gmod.GetMap() == "gm_flatgrass") then return end[/code] I put it all into brackets, made it look for a match, and then inverted that bool I get from the brackets. Read as "if not on construct or on flatgtrass then return end"
-snip-
[QUOTE=Revenge282;48594147]Yes. Use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnPlayerHitGround]GM/OnPlayerHitGround[/url] and create the appropriate damage. Then just remove [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/GetFallDamage]GM/GetFallDamage[/url] from the equation. I will post specifics when I get home from work if you still need them.[/QUOTE] Excellent. I played around with some things and got it working exactly how I need it to. Here it is just in case anyone else has this same question: [CODE] function GM:OnPlayerHitGround( ply, inWater, onFloater, speed ) if speed > 400 and !inWater then local dt = DamageInfo() dt:SetDamageType( DMG_FALL ) dt:SetDamage( speed / 8 ) dt:SetAttacker( game.GetWorld() ) dt:SetInflictor( game.GetWorld() ) ply:TakeDamageInfo( dt ) end end function GM:GetFallDamage( ply, speed ) end [/CODE] I included [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnPlayerHitGround]GM/OnPlayerHitGround[/url] in this just to make sure this one was called instead. Thanks for the guidance! [B]Edit:[/B] On further research, this is exactly how TTT handles fall damage. So yeah. :s: Should've scoured everything there first.
[QUOTE=HDG_MrDeeJayy;48596852][code]if !(gmod.GetMap() == "gm_construct" or gmod.GetMap() == "gm_flatgrass") then return end[/code] I put it all into brackets, made it look for a match, and then inverted that bool I get from the brackets. Read as "if not on construct or on flatgtrass then return end"[/QUOTE] Thank you very much you solved this problem. You made a small issue not "gmod.GetMap()" its "game.GetMap()". Have you any clue how i can do the same thing for a specific gamemode. Like i said with "gmod.GetGamemode" and "gmod.GetGamemode().Name" (for sure i printed the correct names) i don´t have success. Maybe i wrote the code wrong i don´t know.
Trying to get a player to make sounds that will be heard by other players. I'm trying to use PlayerEnt:EmitSound( 'Soundscript' ). It doesn't play when called from a function in the lua file, but it does play when I call the same line from console, though the sound stops when the player moves. Thoughts?
[QUOTE=wranders;48598187]Trying to get a player to make sounds that will be heard by other players. I'm trying to use PlayerEnt:EmitSound( 'Soundscript' ). It doesn't play when called from a function in the lua file, but it does play when I call the same line from console, though the sound stops when the player moves. Thoughts?[/QUOTE] Was your sound created using sound.Add? If so, what channel did you set it to? It being stopped when the player moves may indicate it's on the wrong channel, and footsteps are covering it up. How is your function to play the sound called?
[QUOTE=Z0mb1n3;48598231]Was your sound created using sound.Add? If so, what channel did you set it to? It being stopped when the player moves may indicate it's on the wrong channel, and footsteps are covering it up. How is your function to play the sound called?[/QUOTE] Jesus, I guess I need to sleep. Yes, all the sounds are setup with sound.Add. Had the sounds set to CHAN_BODY and missed that that channel was also used for footstep. Good lookin' out. I switched them to CHAN_AUTO and it seems to be working now (at least as far as I can tell). Any danger running sounds in the auto channel?
[QUOTE=wranders;48598261]Jesus, I guess I need to sleep. Yes, all the sounds are setup with sound.Add. Had the sounds set to CHAN_BODY and missed that that channel was also used for footstep. Good lookin' out. I switched them to CHAN_AUTO and it seems to be working now (at least as far as I can tell). Any danger running sounds in the auto channel?[/QUOTE] Nope, not that I have experienced. CHAN_AUTO seems to be the default channel for any sound that doesn't fit into one of the other categories.
I have no idea where to even start with this but randomly on our server parts of the maps will turn invisible. spinning fans, part of the map glass etc will just go invisible but you can still collide with them. It's not the map as all surf maps are causing it, I'm not doing anything that I'm aware of that could cause it. No server errors or client errors and it happens to everyone in the server at the same time. There was something to-do with emitters with "CUtlLinkedList overflow! (exhausted index range) (65535)" but that doesn't happen anymore after I put the fix in yet it still happens :(
[QUOTE=Mrkrabz;48600037]I have no idea where to even start with this but randomly on our server parts of the maps will turn invisible. spinning fans, part of the map glass etc will just go invisible but you can still collide with them. It's not the map as all surf maps are causing it, I'm not doing anything that I'm aware of that could cause it. No server errors or client errors and it happens to everyone in the server at the same time. There was something to-do with emitters with "CUtlLinkedList overflow! (exhausted index range) (65535)" but that doesn't happen anymore after I put the fix in yet it still happens :([/QUOTE] Sounds like you might be hitting some sort of limit like the lua or entity limit. That or it could be lots of lag?
[QUOTE=YourStalker;48600099]Sounds like you might be hitting some sort of limit like the lua or entity limit. That or it could be lots of lag?[/QUOTE] Ill keep an eye on the entity limit next time, the only thing I could think of is Pointshop which I'm removing soon as I'm almost done with my own. Thanks
-snip- neeeevermind, I was being silly and wasn't doing it right
Unrelated to coding, any pc builders here? I've just bought all the components to build a new pc, but I was wondering, should I install gmod on the ssd? Since I'm constantly editing files on there is that going to affect the life span of it because of constant saving?
[QUOTE=Alig96;48600740]Unrelated to coding, any pc builders here? I've just bought all the components to build a new pc, but I was wondering, should I install gmod on the ssd? Since I'm constantly editing files on there is that going to affect the life span of it because of constant saving?[/QUOTE] To be honest, I don't think it makes that much of a difference. There was a big thing about the reading / writing on a SSD, but in the long run, I'll probably buy another before it makes a difference. I've got all source games on my SSD, and all others on my second HDD. [editline]2nd September 2015[/editline] -snip -
[QUOTE=Mrkrabz;48600160]Ill keep an eye on the entity limit next time, the only thing I could think of is Pointshop which I'm removing soon as I'm almost done with my own. Thanks[/QUOTE] Kept an eye on the entity limit and it's stayed at 280 since the map started. It happens to a block of people at a time and didn't seem to be the entire server this time. Not even sure where to start with debugging.
[QUOTE=Mrkrabz;48600954]Kept an eye on the entity limit and it's stayed at 280 since the map started. It happens to a block of people at a time and didn't seem to be the entire server this time. Not even sure where to start with debugging.[/QUOTE] Have you removed pointshop yet? Trails and stuff might be why. Also, problem of my own, I'm using 3D panels and attaching them to entities. Is there any way to set their 'origin', so-to-speak, to the center of the panel rather than top left? Or better yet, is it possible to cancel all active panel animations? Say, if I want to completely stop AlphaTo in its tracks?
Sorry, you need to Log In to post a reply to this thread.