MM2 making a car with a jiggly piece

User avatar
theSixtyEight
MM2X Newbie
MM2X Newbie
Posts: 5
Registered for: 9 years 2 months
Slovakia

MM2 making a car with a jiggly piece

Postby theSixtyEight » Tue Feb 27, 2024 1:30 pm

Hi, is it possible to create a car with a mesh piece that jiggles around when driving?
I am trying to recreate my own car into MM2 and I have this "fox tail" on antenna attached. It jiggles around when driving, would it be possible to recreate that somehow in MM2? Is there support for it from engine standpoint? (like perhaps to add/hack it in as truck trailer or something of that nature)
(image in attachment)
Thanks!
Attachments
jiggly.JPG

User avatar
MysteryDriverX
MM2X Newbie
MM2X Newbie
Posts: 25
Registered for: 5 years 8 months
Been thanked: 1 time

Re: MM2 making a car with a jiggly piece

Postby MysteryDriverX » Tue Feb 27, 2024 11:54 pm

What's up! That's a cool idea actually. I once made a RC car and tried to think of a way to add a jiggly piece for an antenna too but back then I opted for not having it. Unfortunately as far as I know there isn't a very good way of doing it, but there are a few options to try to approximate to the result:

-You could make it as a "supension" piece. The game supports suspension parts like "shocks" that stretch and compress as your car bounces, since it shares part of the code with Smuggler's Run. The problem you'd have here is that the way it stretches and compresses might be unrealistic and the jiggly effect would stop as soon as the car stops bouncing. Another inconvenient but only if you use Zmodeler is that you'll have to use Blender for this feature to work when you export the car.

-You could make it as an object with an animated texture. The game supports animated textures the following way: When you are making a model you assign it a texture called for example "anim.tga". But in the .ar file you do NOT include that file, you include the frames of the animation named "anim-0001.tga", "anim-0002.tga", etc. Then in your tune folder you include a file called "anim.movie" which is actually a text file, and inside that file you write "rate 10" where 10 can be any number for the animation speed. Check the Piccadilly Circus mod for an example of how this works. The problem with this method is that animations on cars only work if your car has no damage textures. And also, it would be constantly animated. A third problem is that it will look bad on opponent cars that use this car, unless you have NuHook I think.

-The third option is to get NuHook which supports Lua and create your own Lua script that allows for the animation to work given certain conditions. It wouldn't be exactly as before since in this case you control the texture swapping directly via Lua code. This sounds pretty complex though cause I wouldn't know how to tie it to the way the car behaves so that it animates realistically. And you still have the same problem as before where you can't control texture swapping via Lua if your car has damage textures too. Examples of vehicles that swap textures via Lua are the Yamaha Banshee quad bike and the Harley Davidson Fat Boy.

I guess the best bet might be making it as a suspension piece, probably as a "shock" piece. For that I guess download a vehicle with suspension, like the Bronco by Bugattiman I think, or the Geo Tracker by me, import it to blender to see what the suspension part is named. Make sure to have the latest version of Dummiesman's Blender addon.

User avatar
theSixtyEight
MM2X Newbie
MM2X Newbie
Posts: 5
Registered for: 9 years 2 months
Slovakia

Re: MM2 making a car with a jiggly piece

Postby theSixtyEight » Wed Feb 28, 2024 1:37 pm

Oh damm thats really extensive reply, I appreciate that.
I Share same thought as you do, using suspension piece is probably the best(easiest) way how to acheive that. I had no idea there was an addon for blender, it must be pretty new thing , I only remmeber zmodeler was used in past. Also its interesting nobody made blender tutorial yet (that I could find). Anyway im gonna dig into this, its been 9 years since I made my last car model for MM2 haha.
Out of curiosity, how did people find out that suspension works in mm2, was it just trial and error? I am wondering what else was "forgotten" in the code that could be used for creative purposes like the foxtail i am trying to create

User avatar
ITN_Tuning
MM2X Newbie
MM2X Newbie
Posts: 32
Registered for: 15 years 3 months
Location: Ruse, Bulgaria
Contact:
Bulgaria

Re: MM2 making a car with a jiggly piece

Postby ITN_Tuning » Thu Feb 29, 2024 11:10 am

You can try and make it as a fender (FNDR0_H) object, at least it'll steer with the car.
Image

User avatar
theSixtyEight
MM2X Newbie
MM2X Newbie
Posts: 5
Registered for: 9 years 2 months
Slovakia

Re: MM2 making a car with a jiggly piece

Postby theSixtyEight » Sat Mar 02, 2024 5:20 pm

Hi, so I tried also that fender option but will need to experiment more, thank you.
I am facing a problem with this model though, every time I crash into a building at speed of about 70mph+, the game crashes.
I had this with buses and police too but it seems that it dissapeared. Ive spent hours and hours trying to fix this issue but i am clueless now...I tried various bound meshes from other cars and some seem to improved this issue I think, also swapping wheels from other cars seemed to fix it (to certain point) but it is still present. Before a small touch with almost any object caused MM2 to crash, now its only high speeds head on crashes against buildings. Could anyone more experienced please look at my .ar?
https://www.dropbox.com/scl/fi/5q36ev1e ... zghva&dl=0

User avatar
MysteryDriverX
MM2X Newbie
MM2X Newbie
Posts: 25
Registered for: 5 years 8 months
Been thanked: 1 time

Re: MM2 making a car with a jiggly piece

Postby MysteryDriverX » Sun Mar 03, 2024 6:33 am

Sup, I tested your car but I didn't have the problem you mention. I tried hitting different walls as fast as possible (over 70 mph) but the game didn't crash. Do you have the problem still with other cars too or just this one? Cause it may be something other than the car causing it for you but I'm not sure what it could be.
I recommend also joining the midtown club discord server since many users are active there and have knowledge about modding. Invite: https://discord.gg/hFsM2WVThW Together with this website they form the whole MM2 community right now.
Do you have NuHook in your game? In that server you can get NuHook and with that your game will probably emit a more clear error message when it crashes, that some expert may recognize and understand.
There is unfortunately no Blender tutorial as you guessed. I still use Zmodeler and sometimes import the pkg or the z3d file itself to Blender to work with it a bit more there. I see you managed to get the axle part into the game though so that's great! At first I didn't realize what exactly you wanted to achieve cause I thought you wanted the entire antenna to bounce (this is why I recommended a shock piece rather than axle) but you meant just making the tail move around right? (while the antenna stays still). Shame that it moves so little in the game, I guess the axle movement isn't so noticeable. I can't think of a different way to make it work unfortunately, except with a Lua script and texture swapping using transparent and opaque textures to reveal and hide different "angled" copy-pasted versions of the antenna model. But again doing this won't work if the car also needs to have damage textures (damage negates texture swapping and animations for some reason). I don't know off the top of my head how to detect car movements that should make the antenna "change" via code but there's probably a way since Lua has access to the car's angles in x, y and z axis now. Otherise we must wait until Hook supports carrying objects with our cars, something that was being investigated a while back. Then those objects could have the texture swapping without affecting the car itself I think. Note that Lua scripts require NuHook to work.
Excellent job so far with the car!

User avatar
theSixtyEight
MM2X Newbie
MM2X Newbie
Posts: 5
Registered for: 9 years 2 months
Slovakia

Re: MM2 making a car with a jiggly piece

Postby theSixtyEight » Sun Mar 03, 2024 11:17 am

Hi, thank you for your detailed reply haha,
"Sup, I tested your car but I didn't have the problem you mention" that makes it even more confusing to me, hmmm.
I have problem with this car only , now im noticing I left a set of wheels from different car there, so thats why its not crashing for you probably, though, I remmeber it was crashing for me even with them....
I dont have NuHook, I iwlll look into it!
I will post this up also to the discord server but im also post link to this here: https://www.dropbox.com/scl/fi/ya169vwu ... mqycv&dl=0
its the same model but with my set of wheels, if this doesnt crash your game, i really really dont get it... I even asked a friend to install a fresh copy of MM2 and it was crashing for him.

User avatar
theSixtyEight
MM2X Newbie
MM2X Newbie
Posts: 5
Registered for: 9 years 2 months
Slovakia

Re: MM2 making a car with a jiggly piece

Postby theSixtyEight » Mon Mar 04, 2024 12:56 am

Issue solved, apparently one needs to have at least 2 materials (apart from one for SHADOW_H) on his model, otherwise the game crashes on cars impact. (just in case somebody searches for an answer)