Angelwolf Posted March 4, 2016 Share Posted March 4, 2016 I have just noticed a very, very strange bug in my game which also appears to be affecting some of my other games. If I run and shoot (especially with the shotgun from the FPS Weapons Pack) then I actually shoot and injure myself. The faster the player move speed, the more the damage. With a run speed of 5, 50hp is removed from the player. I don't understand why or how this is happening. I'm completely clueless. I have tried using the original player FPS script, have tried loading the player prefab back in etc. Can't seem to get it to work normally. Has this happened to anyone else? Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
Angelwolf Posted March 4, 2016 Author Share Posted March 4, 2016 Ok, after pulling my hair out for hours and hours, I finally figured out what was causing this. And I honestly have no idea why, because it doesn't make sense. A directional light. Deleting the directional light fixed everything. I don't know why, but it did. Now... where did I leave my whisky? Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
nick.ace Posted March 5, 2016 Share Posted March 5, 2016 What FPS are you getting? I think the directional light is causing a performance hit, which means that you are essentially running into the bullet because it doesn't move in time. The bullet is an entity itself so you can have this issue. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 5, 2016 Share Posted March 5, 2016 Whoa that is the most interesting bug of all time. It would be easily fixable just by checking to make sure the hit object isn't the player himself. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted March 5, 2016 Share Posted March 5, 2016 Nothing should hit the player if SetPickInfo is 0. but I can see in cases where you want things to shoot at you. Yeah, the way you'd go around this is make a collision type that hits everything but the player, and have your pick function use that. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Angelwolf Posted March 5, 2016 Author Share Posted March 5, 2016 My first solution attempt at this was to make the person firing the projectile to me immune from it, but my limited coding knowledge meant I couldnt quite work it out. The speed issue mentioned by nick.ace is definitely plausable; since removing the directional light the fps has increased. Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
nick.ace Posted March 5, 2016 Share Posted March 5, 2016 This is approach is even easier imo. Just use SetKeyValue on the enemies and the player to label them as something. Also, label the bullet so that it has an owner. Then, when you are testing for collisions, you will know what you hit. Quote Link to comment Share on other sites More sharing options...
klanphear Posted March 6, 2016 Share Posted March 6, 2016 I have the same issue and have for some time. Just haven't got around to trying to figure it out. I am using the FPS Pack from the store. It seems to have started around the time the Merc came out. The Shot Gun hurt's a lot. I have actually used it to kill me testing re-spawn code. I was my own enemy. Maybe the hitbox is intersecting with the bullet. Possible that the pick point is too close to player hitbox, rotation or speed related? Haven't had time to try to figure it out, this never used to happen to me. I thought maybe it was just some bug I created but it happens with clean install, new project and very randomly. BTW loving leadwerks, runs like butter on my machine. So quiet. People who purchased the weapon pack and die by their own weapon may not be to happy. I will keep an eye on the post's. I know the say's solved but, re-coding the dlc weapons you just bought to use them would have to suck. Especially if you are just getting started and you just bought them. Just sayin. Quote Link to comment Share on other sites More sharing options...
Angelwolf Posted March 6, 2016 Author Share Posted March 6, 2016 Klanphear, out of interest, have you tried removing the default directional light that is added to every new map by default? Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
klanphear Posted March 6, 2016 Share Posted March 6, 2016 Angelwolf, Just tried re- moving light and I still shoot myself. I have child pivots for HUD and game info. I will try moving and removing those next. It seems to occur mostly on first firing gun. Had dropped the vwep prefab into the scene in the past and it seemed to help, but I can still shoot myself. Maybe this will be my focus today. Quote Link to comment Share on other sites More sharing options...
klanphear Posted March 6, 2016 Share Posted March 6, 2016 just checked an old script and didn't shoot myself. Further investigation shows hitbox for bullets at line 177, FPSPlayer script. if I translate the zed axis value negitive (-1) I can't seem to be able to shoot myself and the merc can still kill me. I usually do not change the original scripts that come Leadwerks I make a copy so I have reference if I mess up. I changed this line at 181 hitbox:Translate(0,0.9,-1) --Hitbox for bullets self.entity:SetCollisionType(Collision.Character) local hitbox = Model:Box(0.5,1.8,0.5) hitbox:SetPosition(self.entity:GetPosition()) hitbox:Translate(0,0.9,-1) hitbox:SetParent(self.entity,true) hitbox:SetCollisionType(Collision.Prop) hitbox:SetShadowMode(0) 2 Quote Link to comment Share on other sites More sharing options...
Angelwolf Posted March 6, 2016 Author Share Posted March 6, 2016 ^^ Just tested this with a value of -0.5 and confirm it works. Obviously not the most feasible fix, but definitely pain-free for someone with little coding knowledge! 1 Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
cassius Posted March 6, 2016 Share Posted March 6, 2016 glad to hear you are no longer shooting yourself 1 Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
klanphear Posted March 6, 2016 Share Posted March 6, 2016 Increasing your move speed still can effect this though. so 0.5 works with a 2.5 move speed so you may have to adjust this if you require higher speeds. Just implementing a check like they said above is the better choice but for someone with little coding knowledge this is a quick work around. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.