Dear returning Carmageddon fans Image

These last years, the CWA Board assimilated what was archived from many old Carmageddon forums, including the whole of the Official Carmageddon.com Forums.
If you wish to merge any previous account you might have had with your new or existing CWA account, don't hesitate to reach out to us !

Car Setup Tutorials For Trents Maxscript Tools.

The 2016 reincarnation of Carmageddon! Thanks, SCi!
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Carmageddon Max Damage:

Car Setup Tutorials/s for 3ds Max

Some areas of the tutorial are currently under-going light updates/ammendments.

Primary Levels of guide are now content complete. Some additional resources are still under Construction. Syntax or formatting errors may still present.

Big Thanks to Trent & Errol for their hard work in getting Modding going.

________________________________________________________________________________________________

This guide consists of three levels:

  • Level 1 will contain the basics on how to set up a simple car that will work reasonably well in-game. Basic UI assets will be included CONTENT COMPLETE
    Revised for Max Damage, also indcludes basics on custom trailer hitches.

  • Level 2 will cover how to set up more advanced features; detachable & Jointed parts, breakable parts (Windows/lights), Lights, advanced UI Assets CONTENT COMPLETE
    Revised for Max Damage

  • Level 3 will cover how to set up full mechanical & animated parts in all three supported suspension types to match the official Cars - CONTENT COMPLETE
    Revised for Max Damage

  • Wheel Setup

    - Step by Step of how to set up wheels. Includes 'Required Assets' & notes on deflated tire models CONTENT COMPLETE
    Revised for Max Damage

________________________________________________________________________________________________

Additional Resources (Not specific to Maxscript):

________________________________________________________________________________________________
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 2 - Chapter 5

Breakable Parts (Windows & Lights)


________________________________________________________________________________________________

Breakable parts, such as lights & windows, are setup like a crushable detachable part, but are usually not set as being detachable (so don't set a weakness in the weld), unless you want these parts to detach, it’s your choice. With these parts, the Pivot point should be set to the center of the object, as it makes setting the position of ‘Crush Damage Emitters’ easier.

After completing the basic settings like any other crushable part (including the colour of vertices for the weld), you need to look at the ‘Advanced Crush Damage’ Dropdown under the ‘Car Structure Part’ modifier.

________________________________________________________________________________________________

5-A] Crush Damage Substitution

You can have up to five different crush damage materials.

  • Press ‘-1′ to start configuring the first stage

  • Enter the name of the material you want to change in the ‘Original Material Name’

  • Enter the name of the desired damaged material you want in the ‘Damaged Material Name’

  • Press ‘Set’

  • Repeat the process for ‘-2′, ‘-3′, ‘-4′ & ‘-5′ if you have more damage materials

NOTE: If this part is the windshield, you will want it to break when the driver is ejected, so tick ‘Driver Ejection Smash’

________________________________________________________________________________________________

5-B] Crush Damage Emitter

You can have the same amount of crush damage emitters as crush materials (up to 5)

  • Press ‘-1- to start configuring the first stage

  • Enter the name of the particle effect you want in the ‘Emitter Name’ Box (Official cars usually use F_glasssmall or F_glasslarge) **

  • Press ‘Pick Point’ to select the spawn point, and then click on this part

  • Press ‘Set’

NOTE: An error message may then after pressing ‘set’, disregard it and immediately select a different part, then go pack to the part you’re configuring.

** – for a list of all available particle effects, look in effects.zad

________________________________________________________________________________________________

5-C] Sound Configuration

This sets a Sound effect (SFX) for when the part is damaged. Simply type the name of the effects into the ‘Crush Damage Sound Sub’, official cars usually use GlassLens or PlasticLens.

________________________________________________________________________________________________

5-D] Weld

After setting up the crush damage, don't forget to weld the window/light/breakable part to its parent.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 2 - Advanced Car Features


________________________________________________________________________________________________

Preface/About:

Welcome to Level 2! This a guide will build on what was covered in Level 1, including the setup of considerably more car parts for your car in Carmageddon Max Damage (CMD) using Trents Maxscript Tools. This is not a guide on how to model or texture a car, this guide will cover:

  1. Detachable (Crushable) Parts

  2. Detachable (Non-Crushable) Parts

  3. Flappable Parts

  4. Jointed Parts

  5. Breakable Parts (Windows & Lights)

  6. Functional Lights

  7. Part Animations (Engine Vibration, Fan & Pulleys Rotations, etc)

  8. Advanced UI assets (damage indicator)

On the official cars, the car body is divided up into many separate parts, components such as: Bumpers, Air-Dams/Splitters, Wings, Windshield Wipers, Bumpers, Grilles, Hood, Trunk, Fenders, Front-Clip, Quarter Panels, Skirts, Trunk, Tail-Gate & Rocker Panels are among many possibilities for detachable parts. Additionally some parts may be setup as ‘Breakable’ Parts, such as the windows & lights – these parts will substitute their respective materials & textures for one of up to to five damaged versions as they deform, replicating the cracking & shattering of glass & plastic in the real world.

Before We continue, I will be importing the more complex Level 2 version of the Tutorial car. As opposed to the two model parts that made up the Level 1 Model, this new version has Forty-Six Parts all in all. We are going to replace the simple Level 1 ‘c_Body’ with the new version (that is ready to have detachable parts added), and then gradually add in all the extra parts. To replace the old ‘c_Body’ with the new one, follow these steps:

Getting ready for the new car parts

  • Load the MaxScript & open the car you rigged following the Level 1 Tutorial

  • Save it as a new version

  • Rename the ‘c_Body’ as ‘c_Body_old’, and unlink the Hubs, Engine, Driver Node and Exhaust Node using the schematic view
    Make sure that the Brake Nodes & Wheel Nodes are still linked to the hubs

  • Hide your ‘c_Body_Old’

Importing/Merging in the new car

  • Import/merge in your new version of the car (If importing the car from another format, make sure to match-up the material names)

  • Make sure the position of the new ‘c_Body’ and detachable parts is correct

  • Remember the ‘c_Body’ pivot point should be set to 0,0,0

Setting up the new car body to replace the old one

  • Select the new c_Body, and run the following tools: •‘Tools’ -> ‘Common’ -> ‘Setup Hierarchy’

  • ‘Tools’ -> ‘Cars’ -> ‘Configure Car Structure’
    As the new ‘c_Body’ doesn’t have any child parts yet, this should not take long

  • Setup the basic structure data for the new ‘c_Body’ in the same way we did for the ‘c_Body’ in the level 1 Tutorial •Setup the car characteristics (General Defence, Car Defence, Offence, Value Factor, Deform Factor)

  • Setup basic settings (Crushability, Stiffness)

  • Add the Driver Box (remember to set the vertex colour for the 8 vertices that form the driver box)

  • Add ‘Named Render Level’ for the Driver Node

Linking the Hubs and other parts to the new ‘c_Body’

  • Use the Schematic view to link the Hubs, Engine, Driver Node & Exhaust Node to the new ‘c_Body’

  • Change the ‘Weld Partner’ in the Hubs & Engine to the new ‘c_Body’

With these steps complete, to add new parts to the car, we will use the ‘Tools’ -> ‘Car’ -> ‘Add Structure Part’ to add ‘CNT Hierarchy’ and ‘Car Structure Part’ Modifiers. Then the new parts just have to be linked into the hierarchy.

NOTE: This tutorial will not cover setup of every single new part on the Level 2 car. Instead I will cover the different types of parts that can be setup, and in some instances - demonstrate setup on one or two parts. I will leave it up to you to decide which criteria to apply to the parts on your own car. If you have followed the Level 1 tutorial and have a basic car setup & working, then this tutorial should be easy to follow. If you have not completed the Level 1 Tutorial to setup a basic car, then please do so before continuing with this tutorial.

________________________________________________________________________________________________
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 2 - Chapter 4

Jointed Parts


________________________________________________________________________________________________

Jointed parts are regular parts, that can dangle or open before falling off, but the joint is not activated by pressing the ‘Flaps’ Key. Jointed parts typically use a Ball joint to allow rotation in more than one axis, enabling parts to dangle and drag along the ground.

________________________________________________________________________________________________

4-A] Weld vertices

Similar to a flappable part, jointed parts have to have 2 welds, with 2 different colours for the weld vertices:

  • Regular Weld – Green (RGB: 255,000,000)

  • Jointed Weld – Cyan/Turquoise (RGB: 000,255,255)

________________________________________________________________________________________________

4-B] Structure data & welds

Primary Structure part setup is otherwise identical to any other crushable part or a flappable part. With the Structure data set you will need to add two welds to the part.

Regular Weld:

  • Needs a ‘Weakness’ Value (typically -4)

Jointed Weld

  • Make sure to change vertex colour from Green (default weld colour) to Yellow(RGB: 255,255,000), Yup, that's right - the weld colour is set to Yellow despite the vertices being Cyan/Turquoise. This is how it is set up on the official cars.

  • No other values set!

________________________________________________________________________________________________

4-C] Creating the Joint

With the welds in place, the next step is to create one or two joints. With the Part selected, Go to ‘Tools’ -> ‘Car’ -> Create Joint’. This will create the joint at the origin of this part (where the pivot point is) Next We have to configure the joint, and then attach it to the ‘latch’ weld. Generally Jointed parts use ball joints, so select ‘Ball’ as the ‘Joint Type’. The values that typically need to be set are:

  • Weakness – Sets how easy the joint is to break
    Usually set to 200-300 (tweak to your liking after testing)

  • Limit – Enables to set the angles that the part can rotate in the X axis **
    First number is the minimum angle (in degrees) the part can rotate from where it is normally

    Second number is maximum angle (in degrees) the part can rotate from where it is normally

  • Limit 2 – Enables to set the angles that the part can rotate in the Z axis **
    First number is the minimum angle (in degrees) the part can rotate from where it is normally

    Second number is maximum angle (in degrees) the part can rotate from where it is normally

  • Twist – Enables to set the angles that the part can rotate in the Y axis **
    First number is the minimum angle (in degrees) the part can rotate from where it is normally

    Second number is maximum angle (in degrees) the part can rotate from where it is normally

  • ‘Use Joint Location’ needs to be ticked, and the joint must then be positioned in car-space where you want the part to pivot about

  • ‘Use Joint Normal’ also needs to be ticked

** These axis are local to the joint, if you rotate the joint, then these axis will rotate with it, so once your values are set – rotate the joint so the axis are where you want them to be.

NOTE: If you alter any variables of the joint – the rotation of the joint will automatically default to what it was when you created it, so you may need to rotate it back.
________________________________________________________________________________________________

4-D] Adding the joint

The last step is to select the part we want to use this joint, then:

  • Navigate to the ‘Latch’ weld

  • Open the ‘Joints’ drop-down

  • Press ‘Add Joint’, and select this joint

  • Press ‘Add Joint’

NOTE: Most jointed parts have a joint defined at both ends (E.G. Each end of a bumper), allowing the part to dangle from either end.
________________________________________________________________________________________________
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
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 »

Assuming NOW is a good time to say "Wow. Great Job Mike" ! :)
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Assuming NOW is a good time to say "Wow. Great Job Mike" ! :)
Now is as good a time as any. Thanks :)

There's still some tweaks to make here and there, but with the exception of the Level 3 Tutorial (that's going to be a while down the line), all the main tutorial content is now present.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
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 »

'80s Time Warp wrote:
Assuming NOW is a good time to say "Wow. Great Job Mike" ! :)


Now is as good a time as any. Thanks :)


There's still some tweaks to make here and there, but with the exception of the Level 3 Tutorial (that's going to be a while down the line), all the main tutorial content is now present.

Didnt want to interrupt you while you were working. I wanted to say good job an hour after I saw it posted. I said out loud "Holy Shit !!!"

now where is the map one :)
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

No worries :)

A map tutorial won't come from me (for a long time yet). I don't intend to even start looking at map setup until I've finished every vehicle in my build que.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
Espyo
road raged psycho
Posts: 1288
Joined: Sat May 28, 2011 10:43 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by Espyo »

starbuck wrote:[Didnt want to interrupt you while you were working. I wanted to say good job an hour after I saw it posted. I said out loud "Holy Shit !!!"
Exactly this. It'd be like clapping while the pianist is still playing. Amazing job, bloody hell!
I'm Espyo from the Carmageddon Wiki!
I'm currently working on a Pikmin fan engine.
User avatar
shane
Stainless
Posts: 1080
Joined: Sun May 22, 2011 11:00 am

Car Setup Tutorials For Trents Maxscript Tools.

Post by shane »

That's a fantastic write up '80s Time Warp, I'm sure this is going to be very handy for many modders! I've made it a sticky post for you.
Ex-Carmageddon Community Manager - Carmageddon.com
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Thanks for the kind words guys :)
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 2 - Chapter 7

Part Animations


________________________________________________________________________________________________

In Carmageddon Max Damage, there are lots of different animations that can be applied to parts to improve the appearance of parts on the cars. In this tutorial, we will only be looking at the Animations grouped under ‘Standard Animation’ in the MaxScript. The ‘Point to Point Animations’ are usually only used in the setup of vehicle suspension, steering & driveshafts. It is vitally important that the pivot point/local axis for these parts is appropriately positioned & rotated, such as the pivot point for a fan being at the centre of its shaft.

Animation Types:

  • Rotate – Part will rotate ‘A’ degrees in either local X, Y or Z axis

  • Slide – Part will slide ‘A’ units in either local X, Y or Z axis

  • Oscillate – Part will oscillate a minimum of ‘A’ units and a maximum of ‘B’ units in either local X, Y or Z axis

  • Rock – Part will rock back and forth at a speed of ‘A’ units up to a maximum of ‘B’ Degrees in either local X, Y or Z axis, relative to a set position

  • Vibrate – Part will vibrate based of set variables in either local X, Y or Z axis, relative to a set position

With each animation, there are various controllers that can be used to either set a constant animation, or an animation based of a variable relative to the cars state.

________________________________________________________________________________________________

7-A] Rotate:

Usually used for parts like fans, pulleys & driveshaft's, this will set a rotation in a local axis.

  • Fans & Pulleys are usually linked to ‘ENGINE_CRANK_ANGLE’

  • Driveshafts are usually linked to ‘GEARBOX_OUTPUT_ANGLE’, or the relevant ‘WHEEL_ROTATION_…’ for that corner

________________________________________________________________________________________________

7-B] Slide:

The best example of Sliding Animations are those used by the Eagle R & Hawk R to animate their respective Aerofoil spoilers. The Slide will get a part to move in its local X Y or Z axis, using the following variables to define the motion:

  • Desired animation controller

  • Distance to move, usually the part will move this distance per unit of the animation controller (controller dependant)

Aerofoil Spoilers are usually controlled by “SPEED_DEPENDANT_AEROFOIL” or “SPEED_DEPENDANT_AEROFOIL_2″. When these animation controllers are used – the Animation will NOT Trigger until a certain speed has been reached, and will then retract when the vehicle drops below a certain speed. You can set custom speeds for both animation controllers under the ‘Car Characteristics’ Modifier

  • default value for deploying “SPEED_DEPENDANT_AEROFOIL” – 60 Miles per hour (approx. 100 KMH)

  • default value for retracting “SPEED_DEPENDANT_AEROFOIL” – 30 Miles per hour (approx.. 50 KMH)

________________________________________________________________________________________________

7-C] Oscillate:

The best example of an Oscillation is that used on Twisters Drill (in Conjunction with a rotation) The Oscillation will get a part to Move back and forth in a local axis. Variables to be set are:

  • Desired animation controller

  • Minimum amount of movement

  • Maximum amount of movement

________________________________________________________________________________________________

7-D] Rock:

The best example of a Rocking animation is that used by Towmeisters Jaws. The rocking animation will get a part to rotate (in the direction of it’s local X, Y or Z axis) back and forth about a point in part-space. Variables to set include:

  • Desired animation controller

  • Base speed of rocking

  • Max Amplitude (angle) of rocking motion

  • Position of Pivot for rocking motion (defined in part space)

Once the part reaches the Max Amplitude, it will begin rocking back.

________________________________________________________________________________________________

7-E] Vibrate:

Used mainly by engines, takes in various settings to define:

  • Minimum & Maximum frequency (speed) of vibration

  • Minimum & Maximum amplitude (distance/displacement) of vibration

  • Origin of Vibration

  • Desired animation controller, usually ‘ENGINE_NORMALISED_RPM’

________________________________________________________________________________________________

7-F] Animation Controllers:

These are the currently available Animation Controllers. Comments are in Red on line below

Thanks to Trent for collating this list

  • NONE
    // Not tested

  • STEERING_OVER_TIME
    // Not tested

  • STEERING
    // Triggers X units of animation per 1 degree of steering angle,

    Usually used for steering wheel - animation value will need to be negative (-1, -2, -3) for this

    Also used for Subpressors Water Cannon, Tropikills Canoes, APC Camera

  • ENGINE_RPM
    // Triggers X units of animation per 1 RPM

  • ENGINE_CRANK_ANGLE
    // Triggers X units of animation relative to engine crankshaft angle

    Usually used for engine pulleys & radiator fan

  • WHEEL_ROTATION_FR
    // Triggers X units of animation relative to rotation of Front Left Wheel

    Usually used for driveshaft's from diff to Front Right wheel

  • WHEEL_ROTATION_FL
    // Triggers X units of animation relative to rotation of Front Left Wheel

    Usually used for driveshaft's from diff to Front Left wheel

  • WHEEL_ROTATION_RR
    // Triggers X units of animation relative to rotation of Rear Right Wheel

    Usually used for driveshaft's from diff to Rear Right wheel

  • WHEEL_ROTATION_RL
    // Triggers X units of animation relative to rotation of Rear Left Wheel

    Usually used for driveshaft's from diff to Rear Left wheel

  • GEARBOX_OUTPUT_ANGLE
    // Triggers X units of animation per 1 degree of gearbox output angle,

    Usually used for Transmission to Differential animation

  • ENGINE_NORMALISED_RPM_OVER_TIME
    // Not tested yet

  • ENGINE_NORMALISED_RPM
    // Usually used when animating engine (Vibration)

  • ENGINE_RPM_OVER_TIME
    // Not tested

  • CONSTANT_OVER_TIME
    // Not tested

  • CONSTANT
    // Constant Animation

  • WHEEL_SPEED_OVER_TIME
    // Not tested

  • WHEEL_SPEED
    // Not tested

  • SPEED_DEPENDENT_AEROFOIL
    // Triggered when certain speed reached. Custom values can be set for

    - Deploy speed,

    - Retract speed,

    - Time taken to deploy

    - Time taken to retract

    Default Deploy Speed: 60 Miles per hour,

    Default Retract Speed: 30 Miles per hour

  • AIR_BRAKE
    // Triggered when brakes applied, Custom values can be set for

    - Min speed that air brake deploys at

    - Max Speed that air brake deploys at

    - Deploy Speed

    - Retract Speed

  • SPEED_OVER_TIME
    // Not tested

  • SPEED
    // Triggers X units of animation relative to vehicle speed (Metres/Second).

  • SPEED_DEPENDENT_AEROFOIL_2
    // Triggered when certain speed reached. Custom values can be set for

    - Deploy speed,

    - Retract speed,

    - Time taken to deploy

    - Time taken to retract

________________________________________________________________________________________________
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
KiLLerBoy_001
driver
Posts: 55
Joined: Mon Aug 31, 2015 7:17 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by KiLLerBoy_001 »

Hmm cant seems to export in any way ( empty meshes is all im getting )

and importing works but no textures show up or get imported ( even when enabling the option for it ) just checkerboard
User avatar
Trent
mindless
Posts: 3265
Joined: Wed Apr 05, 2000 9:08 am
Contact:

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

When exporting you need to make sure all the objects you're exporting have a CNT Hierarchy modifier applied to them and any actual meshes need the Node Type set to MODL and any null nodes are set to NULL. If they aren't then select the root object, go to Tools and click "Setup Hierarchy" with "Selection (+Children)" selected in the drop down menu.

You also need to have the hierarchy set up so everything is descended from a single object. If that's all done then you need to select that root object and click "Export Full CNT & MDL Hierarchy" from the export tab, that will save out the CNT file and all the associated MDL files. If you just want to edit the topology of a single object then you can just select that object and use "Export MDL" or if you just want to move objects around and change the hierarchy then you can just select the root object and click "Export CNT".

Regarding textures not importing, do you have all the ZADs extracted in the game's directory correctly? Do you have the game directory set in the tool's settings screen? Are all the textures in TDX format? Does the MAXScript Listener window show any errors? Are the MT2 files all in the same folder as the MDLs?
a.k.a. Brent
User avatar
KiLLerBoy_001
driver
Posts: 55
Joined: Mon Aug 31, 2015 7:17 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by KiLLerBoy_001 »

gets loads of errors :P

and yes i have the ZAD's etc though when stating the scripts give a statement about loading the .dll's so i gues the errors there

ill look into it and when i get my hands or more info ill let you know
User avatar
KiLLerBoy_001
driver
Posts: 55
Joined: Mon Aug 31, 2015 7:17 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by KiLLerBoy_001 »

Getting errors at export time for certain .MDL's

my C_Body for example Errors with " -- Uknown property: "count" in undefined

Error then shows this part of CRExport.ms


for j=1 to vertNormals[i].count do
(
--currentVertNormal = vertNormals[i][j]
--faceIndicesForThisNormal = faceIndicesForNormals[i][j]
append newVertsList #(pos, vertNormals[i][j])

for k=1 to faceIndicesForNormals[i][j].count do
(
USERVerts[tvToUSERVerts[i]].TimesUsed +=1
if(faceNewVertInds[faceIndicesForNormals[i][j][k]] == undefined) do
(
faceNewVertIndsOldToNew[faceIndicesForNormals[i][j][k]] = #()
faceNewVertInds[faceIndicesForNormals[i][j][k]] = #()
)
append faceNewVertIndsOldToNew[faceIndicesForNormals[i][j][k]] i
append faceNewVertInds[faceIndicesForNormals[i][j][k]] newVertsList.count
count+=1
)
)
this then results in a .MDL of 0 kb and now showing up ingame and yes i did export without texture conversion
User avatar
Trent
mindless
Posts: 3265
Joined: Wed Apr 05, 2000 9:08 am
Contact:

Car Setup Tutorials For Trents Maxscript Tools.

Post by Trent »

You need to add a Unwrap UVW modifier to the object, 3DSMax does something weird to meshes when you detach polygons from them which throws things out of whack and the Unwrap UVW modifier sorts it out.
a.k.a. Brent
User avatar
KiLLerBoy_001
driver
Posts: 55
Joined: Mon Aug 31, 2015 7:17 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by KiLLerBoy_001 »

coowl thnx
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Damn'it. Trent beat me to it.

Trents solution is better than the one I've been using up until now. I will add it to a troubleshooting section in the future.

Not that it matters now hehe, but my solution was:

  • - remove all rigging data (CNT hierarchy, car structure part, etc) from the affected parts

  • - convert the affected models to an 'editable poly'

  • - convert the affected models back to an 'editable mesh'

  • - reconfigure CNT hierarchy & structure part data as appropriate

EDIT: Added problem & solution to bottom section of this post.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Reserved For the following Level 3 Tutorial sections:

Possible expansion roughly covering >4 wheel setup (structure data for all indexed wheels has to be done manually) may go here.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Reserved For the following Level 3 Tutorial sections:

Expansion where necessary
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 3 - Chapter 2

Overview of Point to Point Animations

As part of setting up each suspension type, you will need to make use of various Point-To-Point Functions to manually animate parts such as: Shock Absorbers, Coil Springs, Trailing Arms, Leaf Springs, Tie Rods & Driveshafts.

The following Point-To-Point functions are used to move and manipulate model parts about a point in their own part space, relative to a point in the space of another part. These are accessed via 'Tools' -> 'Car' -> 'Point-to-Point Animation'.

________________________________________________________________________________________________

2-A] SnapPointToPointOnOtherPart()

Generally Used in Vehicle Suspension & Drivetrain

This Function is used to snap a point on this part (defined locally in part-space), to a point on another part (defined locally in that parts space)

________________________________________________________________________________________________

2-B] RotatePointToPointOnOtherPart()

Generally Used in Vehicle Suspension & Drivetrain

This Function is used to Rotate This part, so that a point on this part (defined locally in part-space), meets a point on another part (defined locally in that parts space)

________________________________________________________________________________________________

2-C] RotatePointToPointOnOtherPartWithScaling()

Generally Used in Vehicle Suspension & Drivetrain

Similar to the above, but the part will be scaled to meet the point on the other part. This is providing that this parts Pivot-Point/Local-Axis/Object-Origin is rotated such that the point on this part can be reached by drawing a line in this parts Local X, Y or Z Axis

________________________________________________________________________________________________

2-D] RotatePointToLineOnOtherPart()

Generally Used in Vehicle Steering

This Function is used to Rotate This part, so that a point on this part (defined locally in part-space), meets a line on another part (defined locally in that parts space)
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 3 - Chapter 3

Position Helpers & their role


________________________________________________________________________________________________

All of the various methods written in a cars structure.xml that pertain to animating parts typically require the declaration of one or more positions defined locally in the space of that part (relative to the parts pivot point). The Position Helpers (accessed via ‘Tools’ -> ‘Car’ -> ‘Create Position Helper’) are used by the various methods in the MaxScript to work out those positions. If you Create a Position Helper (PH) when a Model Part is already selected, then it will create a PH at the Pivot Point of that Part.

PHs can be referenced by multiple methods on multiple parts. The MaxScript will Calculate the PHs position in local part space for any part that references it in any methods when it writes the structure.xml. These are an essential part of setting up animated suspension using the MaxScript.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 3 - Chapter 9 – Example Engine


________________________________________________________________________________________________

When setting up your engine, there are a few animations that can be added to it and its child parts to improve its appearance in-game.

Unless otherwise stated in the setup information for each part, all mechanical parts typically have the following main settings

Render Level:
  • ◦Set at 3, unless part is very large or on clear display (Axle, Engine)

Basic Settings:


  • ◦Enable Crushability and set to 0.0

____________________________

9-A] Engine Pulleys & Radiator Fan

If you have separated out your radiator fan, and the pulleys that the fan belts run between from the base engine model. You can animate these using a rotation linked to “ENGINE_CRANK_ANGLE”.

It is important that each pulley & the fans’ pivot-points are set to the centre of their respective shafts. These pulleys & the radiator fan must then be set as child objects of the engine.

In addition to the standard structure data, each pulley will need to be assigned the rotation through ‘Tool’ -> ‘Car’ -> ‘Standard Animation’.

  • ‘Animation Type’ should default to rotate

  • ‘Local axis’ must be set to Z

  • ‘Degree’ value should be left at 1.0 for the crank pulley, the ‘degree’ value on other pulleys may vary if they are smaller in diameter.
    // For example, if your alternator pulley is half the size of the crank pulley, then increase the ‘degree’ value to 2.0

  • ‘Controller’ should be set to “ENGINE_CRANK_ANGLE”

Lastly, all pulleys and the radiator fan should be welded to their parent part. In the case of the Tutorial car, which has a mechanical (Crank Driven) Radiator fan, all pulleys & the fan are welded to the Engine. The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.

____________________________

9-B] Engine Vibration

In addition to animating the pulleys & the fan. You can animate the entire engine block with a ‘vibrate’ animation that mimics the rumbling/rocking of an engine as it rev’s up in the real world.

Ideally, for the most realistic appearance - the engines pivot point should be set so that it has the same Y Axis position (Z axis in 3ds max) as where the centre of the crankshaft would be.

In addition to the standard structure data we set for the engine model in the level 1 tutorial, assign a ‘Standard Animation’ through ‘Tool’ -> ‘Car’ -> ‘Standard Animation’. Change the ‘Animation Type’ to ‘Vibrate’.

  • ‘Local Axis’ should be set to ‘Z’

  • ‘Controller’ should be set to “ENGINE_NORMALISED_RPM”

You will notice another set of variables are now available to enter.

  • ‘Centre of Rotation’ is the point about which the animation originates.
    // You can select the engine model for this, or create a position helper at the Pivot Point of the Engine and reference that instead. It’s your choice

  • ‘Min Frequency’ is the minimum amount of times the animation can be triggered
    // Value used on the official cars is typically 1.0

  • ‘Max Frequency’ is the maximum amount of times the animation can be triggered
    // Value used on the official cars is typically 50.0

  • ‘Random Freq’ is a psuedo-random value intended to randomize the frequency
    // Value used on the official cars is typically 0.5

  • ‘Min Amplitude’ is the minimum amount of amplitude (displacement) applied by the animation
    // Value used on the official cars is typically 0.25

  • ‘Max Amplitude’ is the maximum amount of amplitude (displacement) applied by the animation
    // Value used on the official cars is typically 0.5

  • ‘Random Amp’ is a psuedo-random value intended to randomize the amplitude
    // Value used on the official cars is typically 0.25

Experiment with the above values to tweak the animation to your liking.

Lastly, as covered in the Level 1 Tutorial - don't forget to weld your engine to its' parent part. The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
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 »

Just checking back after playing COD BO3, SW BF and Yoshis World (For my wife :) )

All I can say is Holy Crap, good work.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Thanks Starbuck.

Some extra tutorial news:

After ripping apart the '67 Rattlers front suspension and rebuilding it, I have successfully completed my first test of Macpherson Strut suspension. The Tutorial sections for that suspension type will be coming soon enough.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 3 - Chapter 1

Overview of Supported Suspension Types in-game & Animations


________________________________________________________________________________________________

1-A] Live Axle with Trailing Arms

Live Axles are one of the oldest & simplest suspension types in the world. Each hub is connected to a rigid axle, which is then connected to the vehicles frame/chassis via Leaf Springs or Trailing Arms with independant shock absorbers/Coil Springs. In Carmageddon Max Damage, Live Axles support is based around a Trailing Arm setup as opposed to Leaf Springs.

________________________________________________________________________________________________

1-B] (Double) Wishbone Suspension

Double Wishbone Suspension is the second type of Supported Suspension in Carmageddon Max Damage. With Wishbone Suspension, Each Hub is connected to the vehicles frame/chassis via two wishbones, which link from the upper and lower ends of the hub, to two mounting bracket attached to the chassis.

Additionally there are Shock Absorbers & Coil Springs to cushion & dampen any motion undertaken between the Hubs & the Chassis

________________________________________________________________________________________________

1-C] (MacPherson) Strut Suspension

Similar to Double Wishbone Suspension. Instead of two wishbones connecting to the hub, the Hub is connected to a wishbone on its lower pivot, and connected to shock abosrber & coil Spring on its' upper pivot, which link to a point higher up on the vehicle Body/Chassis[/s]

________________________________________________________________________________________________

1-D] Notes:

All Suspension Types will differ in terms of what you will have to model depending on whether or not Steering or Propulsion applies to that corner. While All Cars in Carmageddon Max Damage are Four Wheel Drive, you can alter the Torque Split to mimic Front Wheel Drive and Rear Wheel Drive (to an extent).

I recommend that you model & animate an appropriate suspension system for each car, rather than trying to squash a Four Wheel Drive system under every car.

Since this tutorial is covering the setup of mechanical parts, all of which are typically non-crushable. Unless otherwise stated in the setup section, all parts will use the following settings under the 'car structure part' modifier.

Render Level:
  • Set at 3, unless part is very large or on clear display (Axle, Engine)

Basic Settings:


  • ◦Enable Crushability and set to 0.0

Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Level 3 - Full Mechanical Parts


________________________________________________________________________________________________

Preface/About:

Welcome to Level 3. This Tutorial will cover the integration & setup of full animated mechanical parts for a car, on top of what was covered in the Level 1 & Level 2 Tutorial. Do not attempt this unless you are familiar with the basics covered in the two previous tutorials. Certain elements that were covered through-out the previous two tutorials will not be repeated here.

This guide will cover:

  • Chapter 1 – Overview of Supported Suspension Types in-game & Animations CONTENT COMPLETE

  • Chapter 2 – Overview of Point to Point Animations CONTENT COMPLETE

  • Chapter 3 – Position Helpers & their role in car setup using the Maxscript CONTENT COMPLETE

  • Chapter 4 – Setting up a Live Axle with Trailing Arms - (Part 1), (Part 2), (Part 3) CONTENT COMPLETE

  • Chapter 5 – Setting up (Double) Wishbone Suspension - (Part 1), (Part 2), (Part 3) CONTENT COMPLETE

  • Chapter 6 – (MacPherson) Strut Suspension - (Part 1), (Part 2), (Part 3) - CONTENT COMPLETE

  • Chapter 7 – Setting up Steering Rack & Tie Rods for vehicle steering CONTENT COMPLETE

  • Chapter 8 – Powertrain/Drivetrain (Driveshafts) CONTENT COMPLETE

  • Chapter 9 – Example Engine setup (Pulley/Fan Rotation and Engine Vibration) CONTENT COMPLETE

  • Chapter 10 – Extra Interior Parts (Steering Wheel) CONTENT COMPLETE

This guide will not cover how to model the mechanical parts, it will simply show the parts that are required and how to set them up correctly. There is lots of useful information & reference images out there on suspension types.

NOTE: For the purposes of this tutorial, whenever I refer to the vehicles:

  • X Axis – that is the axis of vehicle width (left to Right)

  • Y Axis – that is the axis of vehicle height (Down to Up)

  • Z Axis – that is the axis of vehicle length (Front to Back)

At times I may (additionally) refer to the axis local to 3ds max, this will always be in brackets after the above axis declaration.
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
phlooo
pedestrian
Posts: 12
Joined: Mon Feb 22, 2016 2:19 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by phlooo »

Hello '80s Time Warp, and thank you very much for the dedication you put in this guide.

I have a problem though...

I followed the first level and exported my car. But when I open the structure.xml it's empty... Actually there is just the headline but nothing is defined inside the STRUCTURE balise...

I used a model I ported from a GTA V addon car.

It's so frustrating :(
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Hi Phlooo.

When you began setting up the car, did you use the 'Configure Car Structure' tool under 'Tools' -> 'Car' on the root of the vehicle (c_Body)?

'Configure Car Structure' adds the root vehicle characteristics modifiers, which are necessary for the vehicle structure to export properly. If the root of the vehicle does not have the 'car characteristics' set, then when you export, the structure.xml will look like this:

<?xml version="1.0" encoding="utf-8"?>

Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
phlooo
pedestrian
Posts: 12
Joined: Mon Feb 22, 2016 2:19 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by phlooo »

First, thanks for your fast reply!

And yes, I did use this option on the c_Body, as indicated in the guide.

But my structure.xml looks exactly like this, that's why I dont understand...
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

No worries

Were there any errors indicated by the maxscript? or did it report 'export successful'?
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
phlooo
pedestrian
Posts: 12
Joined: Mon Feb 22, 2016 2:19 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by phlooo »

It depends actually. I got this error multiple times :

--Runtime error: Map support not enabled for specified map channel: 2

but after reapplying a material to the 4 wheels (the ones created by the script), it exports fine without any error...
User avatar
'80s Time Warp
Road Warrior
Posts: 1257
Joined: Wed Aug 03, 2011 8:30 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by '80s Time Warp »

Interesting, I have never had that error before.

After it has exported without error, is the structure.xml still empty?

Just to make sure everything has gotten added to the Root (c_Body) correctly, does the modifier list for the c_Body contain the following:

  • - CNT Hierarchy

  • - Car Structure Part

  • - Vehicle_Setup.cfg

  • - Car Characteristics

Do all of the car parts have 'CNT Hierarchy' modifiers present? If one part doesn't have 'CNT_hierarchy' data set, then it will screw up the export and will usually mess up the structure.xml
Just another '80s Dreamer....
Twitter Manifestation. - Mods for Max Damage.
Please do not use my old/deadname.
User avatar
phlooo
pedestrian
Posts: 12
Joined: Mon Feb 22, 2016 2:19 pm

Car Setup Tutorials For Trents Maxscript Tools.

Post by phlooo »

Yep, the structure.xml just contains the basic "<?xml version="1.0" encoding="utf-8"?>" even when export is reported "successful".

Edit: I tried saving the car on another hard disk, in the unlikely scenario where 3ds Max couldn't write correctly in the CarMODgeddon folder, but this didn't help at all.

And yes, the c_Body has all these modifiers, and every car part has the "CNT Hierarchy" modifier, I checked multiple times since it drove me nuts for the whole day :(

I really don't understand, maybe should I try from scratch with another model?
Locked

Check who’s online

Users browsing this forum: No registered users and 112 guests