• Anyway to set self.Owner:GetAimVector() into specific bounds?
    6 replies, posted
This is for npc's (not snpc's, so i cant go around it in the ai's code) im basically trying to get some control over npc's fire spread... Tried everyway i know, cant say found a bugless way... Anywho.. Tried to math.clamp individual parts of the vector(later figuered that was a really dumb idea..) didn't work.:saddowns: I'm sure good ol' facepunch knows the solution:raise:
Set their proficiency using [url]http://wiki.garrysmod.com/?title=NPC.SetCurrentWeaponProficiency[/url]
[QUOTE=sniperlover;23225901]Set their proficiency using [URL]http://wiki.garrysmod.com/?title=NPC.SetCurrentWeaponProficiency[/URL][/QUOTE] WeaponPrificiency only gives you 5 choices, even those are not that much different really.. [editline]01:32PM[/editline] Ok.. so self.Owner:GetAimVector() is something like 0.09(00/50),0.95(00/50), 0.3(050/100). So i tried to do something like this:[LUA]ovx = math.Round(self.Owner:GetAimVector().x * 10) ovy = math.Round(self.Owner:GetAimVector().y * 10) ovz = math.Round(self.Owner:GetAimVector().z * 10) bullet.Dir = Vector(ovx/10,ovy/10,ovz/10)[/LUA]and the result was really good accuracy.. but.. it snaps into 4 different places? O.o [URL="http://img824.imageshack.us/i/gmconstruct0022.jpg/"][IMG]http://img824.imageshack.us/img824/2040/gmconstruct0022.jpg[/IMG][/URL] Atleast im on the right track right?
I can tell you setting the proficiency to perfect would be a lot better
[QUOTE=sniperlover;23226538]I can tell you setting the proficiency to perfect would be a lot better[/QUOTE] I kinda need something more precise than that and with more than 5 choices. Why is it so hard to launch a simple bullet from owner to the current enemy? :/
-snip- Nevermind
[QUOTE=decyg;23226583]Have you tried setting all aimvectors to max or min?[/QUOTE] If the thing that you're saying is the same which im thinking about then wouldint it point to specific area on the map instead of where its looking? If not.. then i dont know what you mean :/
Sorry, you need to Log In to post a reply to this thread.