Without further ado: Fast and easy way to edit to a MR mod:
Preface: I am writing this primarily to help myself convert stuff, dural knows his own mod in and out, I am not knocking his achievement or the mod in any way, but I needed a "guide for dummies" so to speak, this should help me and others a bit further before we ask questions to the master.
A block of text starting with <!-- and ending with --> is a comment
A line starting with > is file manager/explorer stuff
A line starting with a number is editor (NP++, 7zip, GE)
A line filled with *** denotes end of operation with file, double line means save and close.
Revision 1.0 08/09-13: Initial text. By Spaceraver
Revision 1.1 11/09-13: Some more explanations and optional stuff added.
Revision 1.2 12/09-13: Fixed the location of setting up the 3PT hitch, seems the shop grounds are an object.
Revision 1.3 25/12-13: Added GE download links, thanks HeinzS.
Revision 1.4 06/02-14: Added more explanation to 3PT hitch rotations and offsets.
Revision 1.5 22/02-14: Revised formula for setting spring, easier to understand, added realballast spec and implementation, see thread
As of Patch 2.0 you will need GE 5.0.3, which you can get here after registering:
Jamespants has made a tool to calculate most of the common values here
I chose to do it by hand only to get into it more, Calculator in windows, Click View/view as scientific works wonders.
<!-- This part optional but highly recommended: -->
>Download Notepad++ here:
<!-- Setup -->
>Right click Notepad++, Run as Admin.
1. Click Settings/File Associations, add Notepad -> all extensions, add Web -> xml, add public -> lua, save.
2. Click Plugins/Plugin manager/Show Plugin Manager, check Gmod Lua Indexer, XML Tools, click Install and Close.
3. Exit Notepad++
>Download 7zip here:
<!-- Setup -->
>Right click 7Zip File Manager, Run as admin.
1.Click Tools/Options.
2. Check under "System" tab -> rar and zip.
3. Go to "Editor" tab, find your path to Notepad++ ie "C:\Program Files (x86)\Notepad++\notepad++.exe" and save.
>Exit 7zip.
<!-- Giants Editor is part of the game and so should be installed when you install the game. -->
<!-- Now we are ready to actually edit a mod. -->
>Unzip the mod you want to edit to a folder, rename it with mrMODNAME, move it to mods and open the folder.
>Open the i3d file of your mod with GE. should do this automatically
1. in the left side you will see a coloumn named Scenegraph.
2. Select the model.
3. Look in the right hand side of the program under Attributes and click the Rigid Body tab.
4. Change the following values to 0:
Linear Damping
Angular Damping
5. Save and close the program.
DO NOT under any circumstances rotate the mouse wheel, this moves the view and also the ingame view, if you did this, reload before changing the values again
6. Realballast settings:
Set everything pertaining extra weight and wheels visible in GE, and note the index path in the attributes window, we use that in moddesc and in step 13 of Vehicle.xml.
>Open the moddesc.xml with NP++
<!-- Note how comments turn green in NP++? This is why I use it, to comment out an entire line fast, mark the line and press CTRL+SHIFT+Q on your keyboard -->
1. <!-- Under --> <vehicleTypes> <!-- add this line: --> <specialization name="realisticVehicle"/>
<!-- After --> <specialization name="honk" /> <!-- add these lines: -->
<specialization name="realisticMotorized"/>
<specialization name="realisticSteerable"/>
<!-- Example :-->
<specialization name="realisticVehicle"/>
<specialization name="motorized" />
<specialization name="steerable" />
<specialization name="hirable" />
<specialization name="aiTractor" />
<specialization name="bunkerSiloCompacter" />
<specialization name="honk" />
<specialization name="realisticMotorized"/>
<specialization name="realisticSteerable"/>
Optional line to add after realisticSteerable:
<specialization name="realisticBallast"/>
This spec gives us control of adding weight, or setting dual wheel and thereby adding both ballast and traction.
This means that we can use it instead of Einblendung.lua or other script is used to show and hide weight and wheels, this can be removed.
I will explain later on how it works in part 12, for now open the i3d file and set all weights and wheels visible and note the numbers in the attributes window.
2. Find and comment out ALL lines containing these specialisations like so: <!--specialization name="ESLimiter" /-->
Also find the L10N lines with reference to the specialization and comment these out too. <!-- I chose to comment out anything relating to them as I get some errors. -->
Known conflicting specialisations at time of writing:
rufa.lua" -> example : fendt 936 from the mod contest, reverse steering
"eslimiter.lua" -> functionality already exists in the "mr" engine
"manualIgnition.lua" -> (dural can provide a "mr" version of the global manual ignition)
"handThrottle.lua" -> Not needed in the mod
"allrad.lua" -> functionality already exist in the "mr" engine
3. Save and close your moddsec.xml
<!-- All vehicle types are base game types as far as I know -->
>Open the MODNAME.xml, from here on just keep that document open in NP++
<Wheels>
1. Setup wheels section so it is on 4 lines between <wheels autoRotateBackSpeed="1"> and </wheels>
<!-- Example that has been set-up to work with MR, I will walk you through the values -->
<wheels autoRotateBackSpeed="1">
<wheel rotSpeed="60" rotMax="32" rotMin="-30" driveMode="1" repr="0>0" driveNode="0>0|0" radius="1.05" deltaY="0.12" suspTravel="0.24" spring="75" damper="20" mass="1" brakeRatio="1" />
<wheel rotSpeed="60" rotMax="30" rotMin="-32" driveMode="1" repr="0>1" driveNode="0>1|0" radius="1.05" deltaY="0.12" suspTravel="0.24" spring="75" damper="20" mass="1" brakeRatio="1" />
<wheel rotSpeed="0" driveMode="2" repr="0>2" radius="1" deltaY="0.08" suspTravel="0.14" spring="129" damper="20" mass="1" brakeRatio="1" />
<wheel rotSpeed="0" driveMode="2" repr="0>3" radius="1" deltaY="0.08" suspTravel="0.14" spring="129" damper="20" mass="1" brakeRatio="1" />
</wheels>
2. Remove "longitudalStiffness" and "lateralStiffness" from all wheels.
3. Add brakeRatio="X" where X is "0" for wheel without; and "1" for wheel with brakes.
4. The steering wheels always have a rotSpeed, rotMax, rotMin. <!-- You can set different values pairwise for rotMax/rotMin to achieve less resistance when turning - see "Ackermann steering" on the web -->
5. Adjust driveMode="X" where X is "0" for non driven *2WD*, "1" for driven in 4WD mode, and "2" is always driven, back wheels are mostly a "2"
6. Calculate spring="X" with formula 278 x max permissible load on axle in metric tonnes/(suspTravel*100 - 2). Min suspTravel should be 0.05 for any wheel. (else, the dynamic mass computing would be less accurate)
<!--Example for the front wheels (278*6)/(0.24*100-2)=75
Example for the rear wheels (278*9.55)/(0.14*100-2)=129 -->
Slightly easier formula:
(278*6/22)
Same formula just remove the 0. and minus 2
Remember that the max permissible load on the axle is own weight and lift capacity as total if you cannot find the data for max permissible load.
6. Adjust damper="20" mass="1" on all wheels.
*********************************************************************
1. Remove the whole <motor></motor> section
2. Replace the section <accelerationSpeed maxAcceleration="X" deceleration="X" backwardDeceleration="X" /> with <accelerationSpeed maxAcceleration="1" deceleration="1" brakeSpeed="3" />
3. Change these values:
<fuelCapacity>600</fuelCapacity> <!-- do not change from original -->
<fuelUsage>0</fuelUsage> <!-- set to 0 -->
<downForce>0</downForce> <!-- set to 0 -->
<bunkerSiloCompacter compactingScale="X"/> <!-- set to 0.25 times the mass of vehicle in metric tonnes -->
<!-- Example 9.9*0.25=2.475~2.4 -->
4. Add these lines
<realMaxVehicleSpeed>50</realMaxVehicleSpeed> <!-- Max forward speed in KM/H -->
<realMaxReverseSpeed>40</realMaxReverseSpeed> <!-- Max reverse speed in KM/H -->
<realBrakeMaxMovingMass>20</realBrakeMaxMovingMass> <!-- Max weight in metric tonnes the vehicle can stop without help from other wheel brakes, if unknown set it to max load of vehicle x 1.5 -->
<realBrakingDeceleration>5</realBrakingDeceleration> <!-- deceleration in m/s2. 2 = very bad. 3 = bad. 4 = average. 5 = good. 6/7 = trucks, cars braking system -->
<realSCX>X.X</realSCX> <!-- This is the drag coefficient (cW) of the vehicle, you can use this simple formula: width x height x 0.8 x 0.85 (in meters). Example : <realSCX>4.1</realSCX> -->
<realPtoPowerKW>135</realPtoPowerKW> <!-- Value is in KW, 1 Hp = 0.736 KW. Unknown value can be calculated with Engine Power*0.92. Example : <realPtoPowerKW>61</realPtoPowerKW> -->
<realMaxFuelUsage>40</realMaxFuelUsage> <!-- Litres pr hour, unknown value, use this formula : max usage = power(KW) x 0.272. Example : <realMaxFuelUsage>17.5</realMaxFuelUsage> -->
<!-- Optional things to add, not needed for MR engine to run, but can tweak your vehicle further -->
<realHydrostaticTransmission>true</realHydrostaticTransmission> <!-- If using a hydrostatic transmission, else omit -->
<realTransmissionEfficiency>0.87</realTransmissionEfficiency> <!-- This is for oldtimers, "manual" gearbox, hydrostatic transmission -->
<realTyreGripFx>1.05</realTyreGripFx> <!-- A value of less than 1 means the tractor digs more, bigger than 1 for floatation, dual tyres or tracked vehicles -->
<realAiManeuverSpeed>8</realAiManeuverSpeed> <!-- Max speed the AI will go on the headland, useful to make the AI negotiate a proper headland turn -->
<realDisplaySlip>true</realDisplaySlip> <!-- Set "true" to display slip, most new tractors with radar can display this. "false" for no radar -->
<realVehicleSteeringAngle>33</realVehicleSteeringAngle> <!-- Only articulated machines : we need to define the steering angle by ourselves -->
<speedRotScale scale="0.1" /> <!-- Only articulated machines, reduced steering speed as function of travel speed -->
<!-- These last setting are for new tractors, if you install a mod-chip for example to newer tractors, to tweak the torque rise.
Do not use the values unless you either know the tractor does this from the factory or you make the mod have an "add-on" chip-->
<realSpeedBoost minSpeed="15">35</realSpeedBoost> <!-- boost in KW, active at speed X (km/h) -->
<realImplementNeedsBoost minPowerCons="22">35</realImplementNeedsBoost> <!-- boost in KW, active at which power (KW) consumption from implements ? => example : PTO tools, hydraulics... -->
<realMaxBoost>40</realMaxBoost> <!-- max boost in KW possible => when speed and PTO boost are active together for example -->
<components>
1. Add realMassWanted="X" where X is the dry mass of vehicle.
<!-- Example -->
<component1 centerOfMass="0 0 0" solverIterationCount="80" realMassWanted="0.400"/>
Multiple components:
For a 5 components tractor :
Main component: 20%
Frontwheel: 16%
Frontwheel: 16%
Rearwheel: 24%
Rearwheel: 24%
For a 6 components tractor :
Main component: 20%
Frontaxle: 10%
Frontwheel: 15%
Frontwheel: 15%
Rearwheel: 20%
Rearwheel: 20%
2. Save the xml but keep it open in NP++.
3. Adjust the centerofMass by going ingame with developerconsole enabled, buy the vehicle, bring up the console and type: debugmode,
4. Look at the masses on the wheels at the top left of the screen when debugmode is enabled and on flat surface, the farm yard grounds where you reset vehicles to in Mr map is flat.
<!-- Example -->
<components count="1">
<component1 centerOfMass="0 0.35 0.1" solverIterationCount="10" realMassWanted="4.15" />
</components>
5. Adjust deltaY in the <wheels> section if needed, look at the "cosAngleValue" when debugmode is enabled =>
this value should be as near as possible to 1 when the vehicle is alone on a completely flat ground
6. Save the xml, keep it open.
7. Save and abort, reload the savegame, use developerconsole and debugmode to see the differences.
7. If it works like you want it to, get out of debugmode by typing it again, save the game.
*********************************************************************
We now turn our attention to the 3pt hitch, but first a note from dural:
He warns that if the i3d has scale bigger than "1", rotation not equal 0 in the transformgroup of the 3pt in the i3d file, this value will be off.
This is Giants standard, and allow us to automatically compute the right angle values.
So to sum up:
No scale other than 1 for any TG of the "rotationNode" tree <!-- example : "attacherJointBackRot" -->
no y translation for the "attacherJointBackRot2"
no translation for the "attacherJointBack"
Fix that first in GE, there are some poorly made mods out there too, or you will have problems.
1. Find <Attacherjoints> section of xml.
2. Look for a line that looks like this
<!-- Example --> <attacherJoint index="14|0|0|0" rotationNode="14|0" maxRot="-16 0 0" rotationNode2="14|0|0" maxRot2="9 0 0" maxTransLimit="0 0.5 0" maxRotLimit="0 0 20" moveTime="1.5">
3. Remove the "maxTransLimit", "maxRotLimit" and "minRot2" of each 3-pt hitch
4. Add after minRot"X" minRotDistanceToGround="X" minRotRotationOffset="X"
<!-- minRot"X" is the rotation of the lower arms above horizontal, minRotDistanceToGround="X" is the highest point reachable for the 3pt hitch,
minRotRotationOffset="X" is the rotation of the implement in relation to horisontal in degrees, negative value tips it backwards, positive forwards-->
5. Add after maxRot"X" maxRotDistanceToGround="X" maxRotRotationOffset="X"
<!-- maxRot"X" is the rotation of the lower arms below horizontal, maxRotDistanceToGround="X" is the lowest point the 3pt hitch can lower to,
minRotRotationOffset="X" is the rotation of the implement in relation to horisontal in degrees, negative value tips it backwards, positive forwards -->
<!-- Example -->
<attacherJoint index="0>10|0|0" rotationNode="0>10" minRot="15 0 0" minRotDistanceToGround="1" minRotRotationOffset="8" maxRot="-44.461 0 0" maxRotDistanceToGround="0.200" maxRotRotationOffset="0" rotationNode2="0>10|0" maxRot2="44.461 0 0" moveTime="2" ptoOutputNode="0>19" ptoFilename="$data/vehicles/steerable/powerTakeoff.i3d">
6. Go ingame again, open developerconsole and type: testvehicle when the vehicle is on flat ground, move it a bit and repeat the testvehicle command, the farm ground you reset vehicles on is flat
7. Save and abort game
8. Open your log.txt in your savegame folder and find the entry regarding "testvehicle"
9. Set maxRot to value reported in log ie testvehicle says -44.461, value should be "-44.461 0 0"
10. Set maxRot2 to inverse value of maxRot ie testvehicle says -44.461, value should be "44.461 0 0"
11. Save the xml, load the savegame and do a testvehicle in the console again. Values should be the same as before.
12. Repeat step 6-11 if there are discrepancies to the values. If they keep changing, check the i3d in GE.
13. Setting realballast, curtesy of :
Add this instead of <blends></blends> or it might be part of lightsaddon, check for "zwilling"
<realBallasts>
<!--Weights-->
<mode mass="1.8" comTrans="0 0 -1.5">
<ballast index="4>1|0|0"/>
<ballast index="5>1|0|0"/>
</mode>
<!--Rear twin wheels-->
<mode mass="1" comTrans="0 0 -1.5" tyreGripFx="1.05" vehicleFlotationFx="1.15" >
<ballast index="4>1|1" />
<ballast index="5>1|1" />
</mode>
<!--Rear and front twin-->
<mode mass="2.2" comTrans="0 0 -0.2" tyreGripFx="1.05" vehicleFlotationFx="1.25">
<ballast index="2>1|1|1" />
<ballast index="3>1|1|1" />
<ballast index="4>1|1" />
<ballast index="5>1|1" />
</mode>
</realBallasts>
This is a script from the 926 I converted, that has both wheel weights and dual wheels
Note how the last one refers to all of the nodes, otherwise you will turn on one set (front) and remove the other set (rear)
******************************************************************************************************************************************** ************************************
******************************************************************************************************************************************** ************************************
Congratulations, you are done.