You are here

Car Setup Tutorials For Trents Maxscript Tools.

Pages

KiLLerBoy_001's picture
Norman E. Carnage
Posts: 55
Submitted: Wed, 14/10/2015 - 11:41

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

Edited by: KiLLerBoy_001 on Wed, 14/10/2015 - 11:45
Trent's picture
I was in the War!
Community VIPKickstarter BackerCompetition Winner
Posts: 2997
Submitted: Wed, 14/10/2015 - 12:58

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.

KiLLerBoy_001's picture
Norman E. Carnage
Posts: 55
Submitted: Wed, 14/10/2015 - 13:38

coowl thnx

Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1135
Submitted: Wed, 14/10/2015 - 17:26

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.

Edited by: Mad Mike on Wed, 14/10/2015 - 17:26

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1135
Submitted: Mon, 14/12/2015 - 14:14

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.

Edited by: Mad Mike on Mon, 14/12/2015 - 14:14

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1135
Submitted: Sun, 13/12/2015 - 16:09

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.

Quote:
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
Edited by: Mad Mike on Thu, 20/04/2017 - 10:54

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1135
Submitted: Wed, 09/12/2015 - 21:51

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)

Edited by: Mad Mike on Thu, 10/12/2015 - 13:32

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1135
Submitted: Thu, 10/12/2015 - 11:52

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.

Edited by: Mad Mike on Thu, 10/12/2015 - 13:32

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1135
Submitted: Wed, 02/08/2017 - 09:34

Level 3 - Chapter 4 – Live Axle with Trailing Arms

Part 1

________________________________________________________________________________________________

4-A] Required Parts

Mandatory parts to get Suspension system working in-game

When Setting up a Live Axle with Trailing Arms, you will need the following parts (as a minimum) to make the suspension system work.
____________________________
4-A-i] – Hubs

In the Level 1 & 2 Tutorial, we used Null Nodes for the Hubs. Here you will need actual model parts for these. You can see an example of the Hubs in the colour coded image below.
____________________________
4-A-ii] – Live Axle

The Live Axle forms a rigid body between the two hubs. You can see an example of the Axle in the colour coded image below.
____________________________
4-A-iii] – Trailing Arms

A Pair of Trailing Arms will form the connection between the Axle and the Mounts. Both Trailing Arms will need to be separate parts. You can see an example of the Trailing Arms in the colour coded image below.
____________________________
4-A-iiii] – Trailing Arm Mounts

Each Trailing Arm needs a respective mount to attach to. You can see an example of the Trailing Arm Mounts in the colour coded image below.
____________________________
4-A-v] Brake Disc/Drum

In the Level 1 Tutorial, we used null nodes for the brakes. here we will use an appropriate model for the braking system. If you are modelling disc brakes, the Calliper will need to be a separate part from the disc.
____________________________
4-A-Vi] Wheel

Same as the Level 1 Tutorial
________________________________________________________________________________________________

4-B] Extra Parts

Additional parts that are required to fully realize a live axle.

____________________________
4-B-i] Shock Absorbers

A Shock Absorber is there to dampen any movement of the suspension and absorb any ‘shock’ or impulse exerted on it. The Shock Absorber will need to be separated into two parts, an upper & lower shock. These two ‘halves’ should end up rotating in such a way, that they always form a straight line, mimicking the visual appearance of a real shock absorber. You can see an example of the Shock Absorbers in the colour coded image below.
____________________________
4-B-ii] Coil Springs

The Coil Spring is there to provide rebound in the system, and is wrapped around the shock absorber. You can see an example of the Coil-springs in the colour coded image below.
____________________________
4-B-iii] Driveshafts/UJ

As part of transmitting power from your transmission to the axle, you will need to have a part representing a Universal-Joint/UJ attaching to the differential on the axle, and another part for the driveshaft to connect to the Universal-Joint/UJ on your transmission
____________________________
4-B-iiii] Damper/Axle Mount

Lastly, we need to group all of these parts under a single part to keep the hierarchy clean, and ideally simplify the setup process by keeping all of the live axle parts grouped under one non-crushable part to prevent the animated parts from moving away from one another as the vehicle takes damage.
____________________________
4-B-v] Visual Representation

Below is a colour coded image, showing all of the requisite parts listed above.
◦Brake Drums (Red: 255,000,000)
◦Hubs (Orange: 255,102,000)
◦Live Axle (Yellow: 255,255,000)
◦Trailing Arm Mounts (Blue: 000,000,255)
◦Trailing Arms (Green: 000,255,000)
◦Damper (Axle) Mount (Brown: 075,025,000)
◦Upper Shock/Damper (Cyan: 000,255,255)
◦Lower Shock/Damper (Pink: 255,000,255)
◦Coil Spring (White: 255,255,255)

The vehicles chassis & the universal joint are shown in dark grey. Wheels are hidden from view

________________________________________________________________________________________________

4-C] Typical Hierarchy

Below is the Hierarchy of how these parts need to be organised under the Damper (Axle) Mount.

Edited by: Mad Mike on Wed, 02/08/2017 - 09:34

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1135
Submitted: Wed, 02/08/2017 - 09:35

Level 3 - Chapter 4 – Live Axle with Trailing Arms

Part 2

________________________________________________________________________________________________

4-D] Part Setup (Mandatory Parts)

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

Quote:
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

Information regarding Pivot Points (accessed under the hierarchy tab) will be in each section.

____________________________

4-D-i]

Damper (Axle Mount)

While not strictly a mandatory part, the Damper Mount will keep the hierarchy clean, and ideally simplify the setup process by keeping all of the live axle parts grouped under one non-crushable part to prevent the animated parts from moving away from one another as the vehicle takes damage.

This only needs to be set-up as a non-crushable part, with an appropriate resilience factor to prevent the entire axle system from being offset in a light collision. As the Tutorial Car is a hefty Intermediate car, I have selected a value of 2.0.

Lastly, the damper mount will need to be welded to its parent part – the chassis (or body if vehicle has a unitized body-frame construction). The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.
____________________________

4-D-ii]

Hubs

Setup of the Hubs is similar to the hubs for the level one tutorial car, but as we have an actual model part, you do not need to assign a collision property. In addition to basic structure data, the appropriate ‘POINT_OF_SUSPENSION’ must be assigned to match the wheel for that corner of the vehicle.

Additionally, you will need to make use of the ‘Set as Hub’ tool under ‘Tools’ -> ‘Car’. Once this has been pressed, you should see a ‘Hub’ Part Modifier under the modifiers tab. You will need to:

  • set the ‘Hub Type’ as ‘Live Axle Hub’
  • Select the Appropriate Corner, which matches the physics property for that corner
  • Select the Wheel Position, you can either select the wheel node, or the Hub

Additionally, the Hubs Pivot Point (accessed under the hierarchy tab) must have the same Y & Z Axis position as that of the Wheel Nodes, otherwise you may find the entire suspension system offset from where it should be in-game. The same applies for the brake drum/disc and the live Axle.

Lastly, Live Axle Hubs will need to be welded to their parent part – the Live Axle. The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.
____________________________

4-D-iii]

Axle

The Live Axles’ Pivot Point (accessed under the hierarchy tab) must have the same Y & Z Axis position as that of the Wheel Nodes, otherwise you may get strange off-setting of the entire suspension system in-game.

You do not have to set any physics property for a live axle.

In addition to basic structure data, You will need to use the ‘Set As Axle’ Command under ‘Tools’ -> ‘Car’. It will bring up the following modifier.

Make sure that the ‘Axle Type’ is set as ‘Live Axle’ and that the ‘Axle Wheel’ is always set to the right side for the axle. In this instance, as we are setting up the rear axle – that requires the ‘Axle wheel’ to be set as ‘Rear Right’.

Lastly the Axle Pivot is the point on the axle, where the right trailing arm attaches to the axle. You will need to create a position helper at the point where the Trailing Arm attaches. Below you can see this helper highlighted in white. Depending on how you’ve constructed your axle, that may affect where the Trailing Arm attaches, and subsequently where the pivot point is.

NOTE: The game will calculate where the Trailing Arm attaches to the left side of the axle by mirroring the X position of the Live Axle Pivot point, so make sure your Live Axle & Trailing Arms are symmetrical.

The final step is to weld the Live Axle to the Damper/Axle Mount. Select an appropriate weakness value. Most tougher cars use ‘-5’ to ‘-8’. As the tutorial car is a hefty body on frame intermediate car, I have selected ‘-5’. The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.
____________________________

4-D-iiii]

Trailing Arm Mounts

In addition to basic structure data, The Trailing Arm Mounts need to make use of the ‘Set as Mount’ command under ‘Tools’ -> ‘Car’. It will bring up the following modifier.

The ‘Axle Type’ needs to be set as ‘Trailing Arm'. The ‘Axle wheel’ will need to match the wheel for that corner, in this case – it is the ‘rear right’ trailing arm for the ‘rear right’ wheel. The ‘Mount Point’ is the point in world-space where the Trailing Arm will attaches to the Mount. Below you can see a Position Helper set to that Point (highlighted in White). If you have set the Trailing Arm Mounts’ Pivot Point (accessed under the hierarchy tab) to this point, then you can just select the Actual Trailing Arm Mount for the ‘Mount Point’.

The Trailing Arm Mount will need to be welded to its’ parent part – the Damper (Axle) Mount. The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.
____________________________

4-D-v]

Trailing Arms

In addition to basic structure data, The Trailing Arms need to make use of the ‘Set as Trailing Arm’ command under ‘Tools’ -> ‘Car’. It will bring up the following modifier.

The ‘Axle Wheel’ will need to match that of the Trailing Arm Mount, in this case the ‘Rear Right’ Wheel.

The ‘Mount Pivot Point’ is where the Trailing Arm pivots about and attaches to the Trailing Arm Mount. The Pivot point for this part (accessed under the hierarchy tab) should be set to this point.

The ‘Axle Pivot Point’ is where the Trailing Arm meets the Axle. You should reference the ‘Axle Pivot Point’ Position Helper here, make sure to create another helper for the Trailing Arms on the left side of the axle.

Below, both of the position helpers used are highlighted in white.

Despite the trailing Arm declaration, you will need to manually animate the Trailing Arm using a ‘SnapPointToPointOnOtherPart()’ and a ‘RotatePointToPointOnOtherPart()’ function.
____________________________
4-D-v-1] SnapPointToPointOnOtherPart()

Select the ‘Point-to-Point Animation’ under ‘Tools’ -> ‘Car’ to bring up the following modifier. The ‘Point-to-Point Animation’ defaults to ‘SnapPointToPoint’.

As we need the Trailing Arm to stay attached to its’ Mount:

  • The ‘Point on this object’ should be set to the point where the Trailing Arm Pivots about
  • The ‘Other Object’ should be the relevant Trailing Arm Mount
  • The ‘Point on other object’ should be set to the point where the Trailing Arm meets the Mount

So both the ‘Point on this object’ and ‘Point on other object’ need to be set to the same position helper referenced as the ‘Trailing Arm Pivot’.
____________________________
4-D-v-2] RotatePointToPointOnOtherPart()

Select the ‘Point-to-Point Animation’ under ‘Tools’ -> ‘Car’ to bring up a second modifier. change the dropdown to ‘RotatePointToPointOnOtherPart’.

As we need the trailing to rotate to stay with the axle:

  • The ‘Point on this object’ should be set to the point where the Trailing Arm meets the Axle
  • The ‘Other Object’ should be the Axle
  • The ‘Point on other object’ should be set to the point where the Trailing Arm meets the Axle

So both the ‘Point on this object’ and ‘Point on other object’ need to be set to the same position helper referenced as the ‘Axle Pivot Point’ in the Trailing Arm declaration.

Lastly, the trailing arm should be welded to its’ parent part – the Trailing Arm Mount. The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.
____________________________

4-D-Vi]

Brake Disc/Drum

Setting up the Brake Disc/Drum very similar to how we set-up the brakes in the level 1 tutorial. As we have an actual model part, you do not need to assign a collision property. In addition to basic structure data, the appropriate ‘POINT_OF_ROTATION’ must be assigned to match the wheel for that corner of the vehicle.

The Pivot Point for the Brake Disc/Drum (accessed under the hierarchy tab) must have the same Y & Z Axis position as that of the Wheel Nodes, otherwise you may find the entire suspension system offset from where it should be in-game.

The Brake Disc/Drum should be welded to its’ parent part – the relevant hub Mount. The weld vertex/vertices do NOT have to meet an actual vertex on the parent part.

If you have modelled disc brakes, then the ‘Brake Calliper’ will only need basic structure data, and to be welded to it’s parent part – the Hub.
____________________________

4-D-Vii]

Wheels

Setting up the Wheels is no different to how we set-up the wheels in the level 1 tutorial. These must be parented to the brake disc/drum, and also welded to their parent.

Edited by: Mad Mike on Wed, 02/08/2017 - 09:35

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

Pages

randomness