Car Setup Tutorials For Trents Maxscript Tools.

The 2016 reincarnation of Carmageddon! Discuss, mod and troubleshoot!
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

It's in exactly the same place in both editable mesh and editable poly.

If the car model loads up in the garage then the MDL files are fine.

Crashing on race load is usually an issue with something in the structure.xml being very wrong. The way I find out what's broken in it is I use a binary testing method: remove half the nodes from the structure.xml and test it. If it works then past back in half of what's removed. If it doesn't then paste back in all of what you removed and remove the other half. Keep doing that until you find the specific nodes which are breaking the car and you should be able to deduce what the issue is or have a more precise problem to ask how to fix.

Other reasons for crashing could be missing key components such as the car's wheels or setting materials to be based of non-existent materials.
a.k.a. Brent
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

I admit I am having troubles with wheels, for one thing I dont seem to get it. I know if the wheels are not correct (nonexistent) they may not show up in the garage with wheels on them.Right now car is 20 times to big. I see a corner of it spinning on the screen. :P

I have to edit and possibly check everything to make sure its in there.

But learning those 5 files is a little bit confusing too, the XML files mostly. I am still in the learning process but I am getting it one step at a time.

I would post a link to the car file here, but I want it to be a surprise when its forum ready. Hopefully a basic car by the end of the week.

I am getting really confused here. First I am at "4-B] Collision Model" so do I just make a blank cube or set of cubes ?

And I just copied the SystemDamage XML file from the C1 car and did not edit it yet. I have a car called "Stone" (secret Reason)

And I see these errors in the Script_log

stone: Error processing SYSTEMS DAMAGE - couldn't find crushable part 'c_Body'

stone: Error processing SYSTEMS DAMAGE - couldn't find solid part 'Engine'

stone: Error processing SYSTEMS DAMAGE - couldn't find solid part 'Gearbox'

stone: Error processing SYSTEMS DAMAGE - couldn't find complicated wheel 'Wheel_FL'

stone: Error processing SYSTEMS DAMAGE - couldn't find complicated wheel 'Wheel_FR'

The name of the crushable collision file was separate item in 3ds max and called "c_Body_Collision" exported like that topic said.

What about the rest ? Do I need to name those items under CNT Heirarchy and for example can I edit out the gearbox statement in the SystemDamage XML file ? How do I setup a complicated wheel ?

In Max WHEEL_FL for example is already named.
User avatar
Mad Mike
road raged psycho
Posts: 1233
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by Mad Mike »

What do we do if the game crashes to the desktop and there is no error listed in the "Script_Log" with anything about our car ?
When there is no usable error in the script_log, it is usually something fundamental in the structure.xml that is screwed up. This could be an incorrect physics property, or something could be missing from the structure.xml and potentially the CNT hierarchy.

When faced with a crash on event load, with no usable errors, my first port of call is to verify the physics properties in the structure.xml are correct. In fact, I will usually do that after initial structure.xml export.


Spoiler: Physics Properties for a normal four wheeled vehicle


Hub_FL
  • - FRONT_LEFT_POINT_OF_SUSPENSION

  • - FRONT_LEFT_POINT_OF_STEERING

Brake_FL


  • - FRONT_LEFT_POINT_OF_ROTATION

Wheel_FL


  • - FRONT_LEFT_WHEEL

Hub_FR


  • - FRONT_RIGHT_POINT_OF_SUSPENSION

  • - FRONT_RIGHT_POINT_OF_STEERING

Brake_FR


  • - FRONT_RIGHT_POINT_OF_ROTATION

Wheel_FR


  • - FRONT_RIGHT_WHEEL

Hub_RL


  • - REAR_LEFT_POINT_OF_SUSPENSION

Brake_RL


  • - REAR_LEFT_POINT_OF_ROTATION

Wheel_RL


  • - REAR_LEFT_WHEEL

Hub_RR


  • - REAR_RIGHT_POINT_OF_SUSPENSION

Brake_RR


  • - REAR_RIGHT_POINT_OF_ROTATION

Wheel_RR


  • - REAR_RIGHT_WHEEL



Only thing in there was a reference to "Could not Load Texture: 'spatter_X' for material 'Data_Core\Content\Vehicles\(every other car in the game)\Paint" ?
You can ignore that warning.

I admit I am having troubles with wheels, for one thing I dont seem to get it. I know if the wheels are not correct (nonexistent) they may not show up in the garage with wheels on them.Right now car is 20 times to big. I see a corner of it spinning on the screen. :P
Correct, if the wheel nodes do not exist, then no wheels will appear in the garage. Furthermore, the game will crash when you try to load an event.

I am getting really confused here. First I am at "4-B] Collision Model" so do I just make a blank cube or set of cubes ?
It depends on the the shape of your vehicle. The whole purpose of the collision mesh is that it should reflect the most basic shape of the vehicle with a very small number of triangles to simply collision detection. Take a look at the official cars for reference.

And I see these errors in the Script_log

stone: Error processing SYSTEMS DAMAGE - couldn't find crushable part 'c_Body'

stone: Error processing SYSTEMS DAMAGE - couldn't find solid part 'Engine'

stone: Error processing SYSTEMS DAMAGE - couldn't find solid part 'Gearbox'

stone: Error processing SYSTEMS DAMAGE - couldn't find complicated wheel 'Wheel_FL'

stone: Error processing SYSTEMS DAMAGE - couldn't find complicated wheel 'Wheel_FR'

The name of the crushable collision file was separate item in 3ds max and called "c_Body_Collision" exported like that topic said.


What about the rest ? Do I need to name those items under CNT Heirarchy and for example can I edit out the gearbox statement in the SystemDamage XML file ? How do I setup a complicated wheel ?


In Max WHEEL_FL for example is already named.

The above errors mean that the game cannot find the quoted parts in the vehicles CNT hierarchy at all. So, the parts have either not exported or are incorrectly named. The biggest concern right now is the wheels. In 3dsmax, make sure that 'Wheel_FL' & 'Wheel_FR' are parented to their relevant brake nodes in the hierarchy. Without the wheel nodes, the vehicle will crash the game when you try to load an event.

'Complicated Wheels' are the wheels. That is why it doesn't say anything about editing that part of the 'systemsdamage.xml' in the tutorial.

If the root of your vehicle is not called 'c_Body', then either rename it to 'c_Body', or change the crushable part reference in the bodywork section in the 'systemsdamage.xml' to match the name of the root of your vehicle.

As for the Engine & Gearbox/Transmission, do you have model parts on the car that represent these? If so, then you need to name them 'Engine' & 'Gearbox', or change the solid part reference in the 'systemsdamage.xml' to match their current names.
One man... Alone... Wrecking opponents in the Automobile he loves.
Twitter Manifestation. - Mods for Max Damage.
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

starbuck

You can leave the problem with the wheels on the next version. You can always connect any wheels from standard cars in the game. See the last lines in the file vehicle.cfg.

Also you can not do collision box. I understand that the game itself creates a standard cube, if it is not in the file cars.

Сant wait to see your car. :)
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

Mad Mike if you dont mind I am going to send you my file to keep it a secret.

Please check it over. Thanks.

LuckyMike I am sending you a PM
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Thank you. :)
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Somebody try to create a battle tank? How it works? I know that the tracks and additional "wheels" of Blitzkrieger are stored in a folder with the simple wheels. it's all that I understand...

:-)


Mad Mike and Doctor Fraggington did something similar.

I do not understand what I'm doing wrong. When i try to moving suspension parts of tank, game has crashing on race load.

Maybe there's a tutorial?
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

LuckyMike wrote:Somebody try to create a battle tank? How it works? I know that the tracks and additional "wheels" of Blitzkrieger are stored in a folder with the simple wheels. it's all that I understand...

:-)

Mad Mike and Doctor Fraggington did something similar.

I do not understand what I'm doing wrong. When i try to moving suspension parts of tank, game has crashing on race load.

Maybe there's a tutorial?
Pretty sure its not only in the modeling phase where the problem lies, but in one of the setup files etc.
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

The garage wheels in the wheel folder are only for when the car is shown in the garage. Tank tracks are dynamically created by the game based on settings at the top of the structure.xml file in the vehicle characteristics section which define how tracks behave (e.g. How much they sag, etc.) and point to a CNT/MDL which defines a single section of the track, then in the main hierarchy of the structure.xml you define which wheels belong to which tank track. You need at least 2 wheels per track and can have multiple tracks per vehicle (Blitzkrieger only has 2 tracks but project x has 4, etc.)

Currently my tools do not have support for setting up more than 4 wheels or tank tracks so you would have to do it manually.
a.k.a. Brent
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Some problems with MDL exporting or importing...

export

http://pastebin.com/yZxHgkwn

after "import car"

http://pastebin.com/RQpSr1U8
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

By any chance did you originally import that model from an OBJ file? OBJ files break shit. Try running this script a few times then exporting again:

for obj in objects do 
(
if classof obj == editable_poly then
(
vertList = #{1 .. (polyop.getnumverts obj)}
polyop.breakverts obj vertList
obj.weldThreshold = 0.001
polyop.weldvertsbythreshold obj #{1 .. (polyop.getnumverts obj)}
)
else if classof obj == editable_mesh then
(
vertList = #{1..(meshop.getnumverts obj)}
meshop.breakVerts obj vertList
meshop.weldvertsbythreshold obj #{1..(meshop.getnumverts obj)} 0.001
)
)
a.k.a. Brent
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Thanks Trent. Yes, is originally been OBJ. :-)

I'm run your script few times, then try to export and get this.


Looks very good, a few changes and everything will be ready.
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Another problem with cars :-)

In max is look like this


In game its look like this.
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

The normals are obviously fucked up on the model in 3dsmax, which is causing the faces of the exported model to be flipped. Chances are if you turn on backface culling in 3dsmax it will look the same. The solution to the normals pointing the wrong way is to flip them.

Just a question, but are these models ones you've made yourself or just found on the internet?
a.k.a. Brent
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

just found

Prompt how to make blood stains on the texture? I just copied the contents of the file with material from the official car and changing the names of textures. What are the specific requirements for texture units have? In max is necessarily make one texture, on a single material (not Multi/Sub-Object)?
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

LuckyMike wrote:just found
I avoid doing the OBJ file converting thing if I can avoid it now. too much trouble in my opinion because of the issues.

Just an FYI. Better to texture it all from scratch all over again. For example some of the materials I converted over from the C2 maps not only came out one sided but backwards as well. Like the fences you could see thru them but once you got to the other side you couldnt go back that way.

Even though it would be great for you to do an ambulance in the game. Blood inside AND outside.

PS been busy all week , couldnt touch my remade model.
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Good to see you. :-)

I read some info about importing OBJ in 3DsMax. It is the most common and the most incompatible format for importing into max...
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

LuckyMike wrote:just found
I would recommend making your own models so you can learn exactly how things are made and avoid problems like this caused by the fact it's just a random model off the internet.

Prompt how to make blood stains on the texture? I just copied the contents of the file with material from the official car and changing the names of textures.
Any material which is set to be based off "car_shader_double_sided_base" will get blood splats applied. You should really only have one material for that, though, as using multiple ones has potential to be a performance sink. Just make sure all the bodywork in one texture and it will be fine.

What are the specific requirements for texture units have?
I don't understand what exactly you're asking. Can you be more specific?

In max is necessarily make one texture, on a single material (not Multi/Sub-Object)?
You can use either Standard materials or Multi/Sub materials, both work fine.

Starbuck wrote:Just an FYI. Better to texture it all from scratch all over again. For example some of the materials I converted over from the C2 maps not only came out one sided but backwards as well. Like the fences you could see thru them but once you got to the other side you couldnt go back that way.
You don't need to texture the whole level from scratch to fix that, you just set the material to be double sided by adding to the MT2 file. Retexturing wouldn't fix that anyway, things like those fences need to be double sided whatever you do to texture them.
a.k.a. Brent
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Trent wrote:
Any material which is set to be based off "car_shader_double_sided_base" will get blood splats applied. You should really only have one material for that, though, as using multiple ones has potential to be a performance sink. Just make sure all the bodywork in one texture and it will be fine.

You can use either Standard materials or Multi/Sub materials, both work fine.

Paint.MT2


Spoiler:


<?xml version="1.0"?>




palomino_paint.png


Spoiler:









No blood splats.
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

Without having the car I can't advise you on what's wrong because what you've shown is exactly how materials should be set up to receive blood splats.

Are you sure the model isn't inside out? The blood splats will only be applied to the Side1 textures, not the Side2 textures, so just change Side2_DiffuseColour texture so something else (e.g. solid red) to see if that's the case.

Another thing to try is make the texture 2048 x 2048. 2024 is a really bizarre resolution, games like to have power-of-2 resolution textures as that's what GPU hardware is optimised for.

Also are you certain no blood splats ever appear? Blood doesn't appear on cars every single time you run over a Ped, there's been plenty of times I've ploughed through a load of peds in official cars and not had any blood stick to it...
a.k.a. Brent
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

I resize textures to 2048, s2 textures is just solid white.

I don't know, bloody milk hell and nothing...
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

Trent I have a model that needs to have a double sided texture.

It already said "" in the MT2 file AND under the 3dsmax material editor under Basic Parameters it does say Double Sided.

So why isnt it double sided in the garage or in the game ?
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

It doesn't matter what settings are set on materials in 3DSMax, the script doesn't use anything except the diffuse texture filename. Maybe try a capital V in Value and all capitals for TRUE. Otherwise I'll need to see the whole MT2 because the DoubleSided tag is the way you make materials double side, there is no other way of doing it.
a.k.a. Brent
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

The V was from a copy/paste from another thread.

Here is what is inside the MT2 file

"<?xml version="1.0"?>

Hear is the file https://1drv.ms/u/s!AN8b1QWn6IwDrW8
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

Whhoooops. Changing TRUE to caps fixed it.
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

"No blood splats" fixed.


What was done wrong.


Spoiler:




User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

And are older cars we made for CR going to work without modification in CMD ?

My god Mike I meant to post that question in Trents thread, sorry. Removed that part
User avatar
AlexTSK
mindless
Posts: 2858
Joined: Sun Dec 18, 2011 1:12 pm
Location: South Africa

Car Setup Tutorials For Trents Maxscript Tools.

Post by AlexTSK »

I don't see why they wouldn't work, they'd probably need to be updated with certain new parameters probably though like where the cockpit cam is situated, but maybe not. We'll see soon enough :)
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

AlexTSK wrote:I don't see why they wouldn't work, they'd probably need to be updated with certain new parameters probably though like where the cockpit cam is situated, but maybe not. We'll see soon enough :)
OMG ! I forgot about the cockpit cam !

Just DLed it, did the tutorial, copied the Carmidgeddon.lua file over and my basic Flintstone car showed up.
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

override_vehicle_name = "YOUR VEHICLE NAME HERE"

override_driver_name = "YOUR DRIVER NAME HERE"

override_bio = "YOUR DRIVER BIO HERE"

not working now ^-(


Spoiler:


module(...)

camera_distance = 32

cop = false

tier = -1

progress = 2

shipped = true

--leaderboard_id = 11

override_vehicle_name = "Interceptor"

override_driver_name = "Max"

override_bio = "Max Rockatansky is a Main Force Patrol officer fighting for peace on the roads"


User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

Nice looking car Lucky Mike. Did you make it yourself or is it just the usual :P
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

starbuck wrote:Nice looking car Lucky Mike. Did you make it yourself or is it just the usual :P
Thanks. For me is more then just nice looking car.

I'm still learning "max how to". 8-)
User avatar
Mad Mike
road raged psycho
Posts: 1233
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by Mad Mike »


not working now ^-(



Spoiler:


module(...)

camera_distance = 32

cop = false

tier = -1

progress = 2

shipped = true

--leaderboard_id = 11

override_vehicle_name = "Interceptor"

override_driver_name = "Max"

override_bio = "Max Rockatansky is a Main Force Patrol officer fighting for peace on the roads"




If the text is not showing up, then something must be wrong with your vehicle_setup.lol. This has worked fine for me on every vehicle.

You should remove the 'leaderboard_id' line altogether, as it does not apply to any custom vehicles. I suspect that the '--' prior to the 'leaderboard_id' may be the issue, resulting in the game ignoring the rest of the vehicle_setup.lol. The script_log should contain confirmation of that.

Try this instead:


module(...)
camera_distance = 32
cop = false
tier = -1
progress = 0
shipped = true
override_vehicle_name = "Interceptor"
override_driver_name = "Max"
override_bio = "Max Rockatansky is a Main Force Patrol officer fighting for peace on the roads"
One man... Alone... Wrecking opponents in the Automobile he loves.
Twitter Manifestation. - Mods for Max Damage.
User avatar
starbuck
kill boss
Posts: 1604
Joined: Wed Jan 21, 2004 12:26 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by starbuck »

LuckyMike wrote:
starbuck wrote:Nice looking car Lucky Mike. Did you make it yourself or is it just the usual :P


Thanks. For me is more then just nice looking car.

I'm still learning "max how to". 8-)

Looks a LOT better than your other "imports". Its nice to have a creation you can be proud of.

Too bad for me modeling in max isnt one of my strengths.

Cant wait to see it ready in the game. Thanks for working towards adding more regular mods.
User avatar
LuckyMike
hit n run
Posts: 239
Joined: Thu Jan 07, 2016 8:51 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by LuckyMike »

Mad Mike

Thanks. But is not working again. Maybe is a problem in other files.