Weak Wheels!

The 2016 reincarnation of Carmageddon! Discuss, mod and troubleshoot!
User avatar
Defcon
hit n run
Posts: 217
Joined: Mon Sep 30, 2002 4:00 pm

Weak Wheels!

Post by Defcon »

Hello!
After a long time, I´m playing C:MD again.
But everything i touch, my wheels are destroyed.

Question:
Is there any text config to make my wheels a bit more sturdy?
User avatar
Trent
mindless
Posts: 2950
Joined: Wed Apr 05, 2000 9:08 am

Re: Weak Wheels!

Post by Trent »

Each car has a structure.xml file which controls various things including how much of an impact is required to break things off. What you need to do is change the weakness of the wheel welds. This is an example of a wheel part and weld from a structure.xml:

Code: Select all

<PART name="Wheel_FL">
      <![CDATA[
		CDamageParameters:Set_RenderLevel( 1 )
        CDamageParameters:Add_PhysicsProperty( "FRONT_LEFT_WHEEL" )
        CDamageParameters:Set_ShapeType( "TIC_TAC_X" )
        CDamageParameters:Set_Restitution( 1.5 )
      ]]>
      <WELD partner="Disc_FL">
        <![CDATA[
          CWeldParameters:Add_PartSpaceVertex( 0.2, 0, 0 )
				  CWeldParameters:Set_Weakness( -5 )
		  ]]>
      </WELD>
    </PART>
The CWeldParameters:Set_Weakness( -5 ) is what needs to be changed. Normally the value is the distance in meters it needs to move for the weld to break, but negative values are predefined "tokens" which are mapped to actual values in CGameParameters.lol:

Code: Select all

	CGameParameters:Add_Damage_CrushMaterialToken( -1, 0.001 )
	CGameParameters:Add_Damage_CrushMaterialToken( -2, 0.005 )
	CGameParameters:Add_Damage_CrushMaterialToken( -3, 0.01 )
	CGameParameters:Add_Damage_CrushMaterialToken( -4, 0.02 )
	CGameParameters:Add_Damage_CrushMaterialToken( -5, 0.03 )
	CGameParameters:Add_Damage_CrushMaterialToken( -10, 0.03 )
	CGameParameters:Add_Damage_CrushMaterialToken( -11, 0.06 )
So -5 is equal to moving 3cm before it snaps. If you change it to something a value like 10 or 20 then it will be tougher to break. You can either do that in each of the structure.xml files or change the token's mapped value in CGameParameters.lol, however that will change the strength of all welds which use the -5 token, not just the wheels.

Other settings related to wheel damage are available in the CGameParameters.lol script:

Code: Select all

-- The multiplication factors used for creating false collision bounds for the wheels and tyres
-- so they can be subject to impacts even when 'hidden' inside the car's body

	CGameParameters:Set_WheelBoundsXFactor( 1.2 )
	CGameParameters:Set_WheelBoundsYZFactor( 1.1 )

-- The fraction of a wheel's weld strength at which non-snapping wheel damage may start occurring
	
	CGameParameters:Set_WheelDamageWeldThreshold( 0.1 )

-- The fraction of a wheel's weld strength at which tyre damage may start occurring
	
	CGameParameters:Set_TyreDamageWeldThreshold( 0.01 )

-- The fraction of a wheel's weld strength at which max tyre damage occurs (there's then a random factor
-- on top of this)
	
	CGameParameters:Set_TyreDamageWeldMax( 0.7 )
Reducing the first two will make the wheels more difficult to hit. Increasing the next three will change at which point of damage to the wheel's weld the various stages of damage occur. So it the weld is set to 10, when an impact moves the wheel 1cm it may start to get damaged (e.g. go wobbly), at 0.1cm the tyre may get punctured and start to de-rim and at 7cm the tyre will be destroyed (give or take a random factor).

To do these mods you will need to grab Minge from my website and use that to extract the game data and add

Code: Select all

-use_zads 0
to the game's commandline parameters to make it run using the extracted data. To make changes to the LOL scripts, you will need to grab LOL Decoder from my website and run the LOL scripts you want to change through it to decompile them.

One point of note: If you mod any of the game's core files then it will warn you about running with modified data, disable multiplayer and stop career from saving. If you want to use the unreleased, unsupported, experimental beta patch then you could pack your modded changes up into a ZIP mod and run the game using that patch's new mod system which would allow saving and multiplayer (as long as you're playing with people running the same mods as you), and as a bonus all the LOL/LUA scripts won't need decompiling either.

Hope this helps!
a.k.a. Brent
User avatar
Defcon
hit n run
Posts: 217
Joined: Mon Sep 30, 2002 4:00 pm

Re: Weak Wheels!

Post by Defcon »

Thx for the help!
but as you are warning me, the career mode will be disabled, witch is my goal right now.
and to patch and mod everything now, is not worth it.....
i will just finish the game, and then start fiddeling with it again.
thx once again for the links! they will be helpfull in the future