Dzsozi (h03) Posted June 23, 2017 Share Posted June 23, 2017 (edited) Hello! I was browsing around mods and stuff for GTA SA and I found this video on youtube. My question is how can I reach the same effect in MTA? What functions I need to make the vehicles flip more easily when touching the ground with the roof or something else but wheels. I already figured out how can I stop vehicles from sliding on the ground if they are on their roof or side, but I would like to know how can I reach this effect that can be seen in the video. Just check it and you will probably understand what I mean by "stickier" ground. What functions will I need to use, or how can I make a similar effect on vehicle physics? I downloaded the files so I can see if there is anything that helps me, but not too much, only a handling.cfg (which I don't think how they achieved this, or not ONLY by handling) and a .dat file, which I opened, but contained not enough information for me to help me out with this. Thank you for your answers in advance! P.S.: If anybody is interested in how I made the vehicles stop from sliding when flipped, here's the script: function isVehicleOnRoof(vehicle) local rx,ry=getElementRotation(vehicle) if (rx>90 and rx<270) or (ry>90 and ry<270) then return true end return false end addEventHandler("onClientVehicleCollision", root, function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and isElement(vehicle) then if isVehicleOnRoof(vehicle) then if getVehicleSpeed(vehicle) > 1 then local multiplier = 0.015 local speedX, speedY, speedZ = getElementVelocity (vehicle) local loweredSpeedX, loweredSpeedY, loweredSpeedZ = speedX-(speedX*multiplier), speedY-(speedY*multiplier), speedZ-(speedZ*multiplier) setElementVelocity(vehicle, loweredSpeedX, loweredSpeedY, loweredSpeedZ) end end end end) EDIT: lol sorry for the long title Edited June 23, 2017 by Dzsozi Link to comment
WorthlessCynomys Posted June 23, 2017 Share Posted June 23, 2017 Hy. This resource is actually in the Resources topic of this forum. Link to comment
Dzsozi (h03) Posted June 23, 2017 Author Share Posted June 23, 2017 2 minutes ago, StormFighter said: Hy. This resource is actually in the Resources topic of this forum. What? Which one? Link to comment
WorthlessCynomys Posted June 23, 2017 Share Posted June 23, 2017 2 minutes ago, Dzsozi said: What? Which one? The resource that the video is about. Link to comment
Dzsozi (h03) Posted June 23, 2017 Author Share Posted June 23, 2017 (edited) 1 minute ago, StormFighter said: The resource that the video is about. I don't know which resource it is in the Resources topic, could you link it? The video is about a mod for default GTA:SA. Edited June 23, 2017 by Dzsozi Link to comment
WorthlessCynomys Posted June 23, 2017 Share Posted June 23, 2017 Oh... nevermind. Sorry, I just saw that you posted the vehicle realism system. I'm a bit tired. Sorry again. Link to comment
Dzsozi (h03) Posted June 23, 2017 Author Share Posted June 23, 2017 (edited) 3 minutes ago, StormFighter said: Oh... nevermind. Sorry, I just saw that you posted the vehicle realism system. I'm a bit tired. Sorry again. Haha, no problem I would like to do something like this for that project. Edited June 23, 2017 by Dzsozi Link to comment
WorthlessCynomys Posted June 23, 2017 Share Posted June 23, 2017 I'd play with the vehicle handlings to reach that effect. Just in case you haven't thought about that. But I'm not into vehicle scripts, so that's just a guess. Link to comment
Dzsozi (h03) Posted June 24, 2017 Author Share Posted June 24, 2017 (edited) It is not caused by the handling, I just tested it on the admiral, copied the handling line from the downloaded handling.cfg for admiral and applied it in-game using handling editor, the same handling got applied like in the video, but when I flipped I kept sliding on the ground, so I think this has to do something with the surface.dat file, the handling is just for more realism I guess. Edited June 24, 2017 by Dzsozi Link to comment
WorthlessCynomys Posted June 24, 2017 Share Posted June 24, 2017 You can also detect if the vehicle is in a rolling state and apply a little rotation to it with setVehicleTurnVelocity. Or you can do that based on speed, so if you spin at 200, you'll do plenty of barell rolls. Link to comment
Dzsozi (h03) Posted June 24, 2017 Author Share Posted June 24, 2017 I will try that but I dont't know two things. 1. Is there any way to reset the vehicle turn velocity? Because I am changing that in other resource as well and I would have to reset that somehow. 2. How I could detect if the vehicle is in a "rolling state"? Link to comment
WorthlessCynomys Posted June 24, 2017 Share Posted June 24, 2017 If I were you, I'd make a script on client side, with what I'd check the vehicle's turn velocity on it's y axis on every frame, and if it's bigger than X then apply a little bit more to it. The other thing. Turn velocity is basically spin. So resetting that means you set it to 0. getVehicleTurnVelocity() setVehicleTurnVelocity() 1 Link to comment
Captain Cody Posted June 24, 2017 Share Posted June 24, 2017 It'd probably be possible to make your own surface properties by figuring out which values need to be added to remove all grip from said surface, then using proccessLineOfSight to get your current surface and add grip depending on so. However, it'd likely be very resource intensive and would need a server side refresher to accurately change your grip on the go. Either that or make a suggestion allowing changing of surface data properties. Link to comment
Moderators IIYAMA Posted June 25, 2017 Moderators Share Posted June 25, 2017 Those are edited vehicle properties. (You can see the strange behaviour of the wheels) Use hedit to figure out the values. https://community.multitheftauto.com/index.php?p=resources&s=details&id=3716 Link to comment
Dzsozi (h03) Posted June 25, 2017 Author Share Posted June 25, 2017 (edited) Achieved a very similar effect like in the video with the method @StormFighter said. Thank you for the help everyone! Edited June 25, 2017 by Dzsozi Link to comment
koragg Posted June 25, 2017 Share Posted June 25, 2017 1 hour ago, Dzsozi said: Achieved a very similar effect like in the video with the method @StormFighter said. Thank you for the help everyone! Are you planning to release it to the community uncompiled? (Or can you send it via Skype?) This would be a nice addition to my race server if you allow me to use it. Link to comment
Dzsozi (h03) Posted June 25, 2017 Author Share Posted June 25, 2017 1 hour ago, koragg said: Are you planning to release it to the community uncompiled? (Or can you send it via Skype?) This would be a nice addition to my race server if you allow me to use it. I don't know yet, I would like to finish it first, at least the big and harder part of it. 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