JimmyJ Posted January 29, 2014 Share Posted January 29, 2014 Hi, I was wondering how I would go about making it so zombies could be ran over by cars in MTA DayZ. We bought the scripts from -ffs-Sniper and Woovie (ether of you can pm me to verify), so we do have access to the scripts to make the necessary changes. As of right now when you run in to a zombie with a car it feels like you just ran in to a brick wall but I would like to make so it behaves the same as if you run over a regular player. I do have a little programming experience but I need a little guidance on how I would go about doing this. Link to comment
Saml1er Posted January 29, 2014 Share Posted January 29, 2014 Show us the code. Don't show the whole script but just the part you want to change. Link to comment
Moderators IIYAMA Posted January 29, 2014 Moderators Share Posted January 29, 2014 I don't know why sometimes the ped collisions are still active when they are already dead. But you can try this to prevent the wall... client https://wiki.multitheftauto.com/wiki/On ... eCollision server setElementVelocity and find a paid scripter....... Link to comment
JimmyJ Posted January 31, 2014 Author Share Posted January 31, 2014 If there is any paid scripters reading this, I'm just curious on how much you would charge for something like this? Link to comment
denny199 Posted January 31, 2014 Share Posted January 31, 2014 Not much, it might require some basic maths (for the inpact rotation etc) but that would be easy, i'd say it would be free... edit: i'll make it for you when i'm home Link to comment
JimmyJ Posted January 31, 2014 Author Share Posted January 31, 2014 That would be great! Just let me know what you would need. Thank you so much man. Link to comment
denny199 Posted January 31, 2014 Share Posted January 31, 2014 So I was just derping arround with the collisions, now there was a bit of a problem, the event "onClientVehicleCollision" is ofcourse triggered when the client's vehicle has been collisioned, now the problem is the updating progress of the car bumping is just a matter of speed, my car bumps when it hit the ped hard, just like you said like wall, when i'm hitting it slowly, it doesn't work like a wall. Now the problem was, when I was hitting the peds with nitro on (infernus), the peds won't fly away, my car would just bump. (see the video below) this was tested with normal peds. Now I tought, maybe the zombies behaves different because it's walking arround etc, so I tested it with the zombies resource, and it was behaving the same... So the "onClientVehicleCollision" isn't working properly with the setElementVelocity on high speed, but what you can do is create colshapes arround every zombie and then when a vehicle hit the colshape, it will calculate the velocity with getElementVelocity or ( https://wiki.multitheftauto.com/wiki/GetElementSpeed ) and then use setElementVelocity to push those nifty zombies away, I don't have time for it, right now but i'll look into it when I have the time ofcourse. Here's the video: And here's the code that i used for the ped velocity (client only), it's not much (yet) but maybe someone can contribute it just because it's awesome to do a job for someone : addEventHandler("onClientVehicleCollision", root, function(collider,force, bodyPart, x, y, z, nx, ny, nz) if collider then if ( source == getPedOccupiedVehicle(localPlayer) ) and (getElementType(collider) == "ped") then -- local fDamageMultiplier = getVehicleHandling(source).collisionDamageMultiplier -- might come in later handy for calculating the damageMultiplier --setElementCollisionsEnabled ( collider, false ) local pedX, pedY, pedZ = getElementPosition ( collider ) local endX, endY, endZ = pedX-x, pedY-y, pedZ-z --[[ calculating output outputChatBox ( endX ) outputChatBox ( endY ) outputChatBox ( endZ ) ]] setElementVelocity ( collider, endX, endY, endZ ) end end end ) I'll probally gonna watch in the weekend for it, since I don't have alot of time right now (so much things for school what needs to be done). (sorry if my english sentences are incorrect, i'm tired ) Regards, Danny Link to comment
JimmyJ Posted January 31, 2014 Author Share Posted January 31, 2014 Wow, this alone will be a big improvement. Thanks man! Link to comment
Einheit-101 Posted January 31, 2014 Share Posted January 31, 2014 I will follow this topic and i could contribute if i have time. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now