Region4
   
   
   
     
     
  PLUGIN SETUP
 

 

The addon kit includes a prepared template esp ready to receive your addon model. You can add multiple models to one esp by cloning the contained refs, or create seperate plugins for each model you build, if you prefer.

The template addon plugin only references entries in the CARS! master (esm). Make sure you don't accidently reference anything in XRE - CARS!.esp, as those references will break upon saving.

All objectID's in CARS! plugins start with XRocketCar.

This section describes adding a single model to a clean plugin template.





  ORGANIZE YOUR PLUGIN
 
  • Choose a name for your model
  • Put your files in the correct folders:
    - Textures in Textures\XRocket\Cars\[name]
    - NIF model in Meshes\XRocket\Cars\[name]
  • Update the texture paths in your NIF model
  • Clone of the template esp and name it XRE - CARS! ADDON - [name].esp
  • Load the esp in G.E.C.K. without loading XRE - CARS!.esp
  • Change the model of XRocketCarModelAddonTemplate to your own
  • Find the 5 refs with AddonTemplate in their name and replace that with your model name




  PLUGIN OBJECT FUNCTIONS
 
TEMPLATE ESP OBJECT FUNCTION
XRocketCarModelXXX This is your car model.
XRocketCarSetupScriptXXX The setup script of your car. See below.
XRocketCarSetupObjectXXX This misc. object is spawned before each drive session to run the attached setup script.
XRocketCarModelListXXX This is the master list for your model. The setup object should be at index 0. It should contain all versions of the same car model; all using the same setup script.
XRocketCarModelInfoXXX

Message you fill with your own information about the model.

XRocketCarLoadOrderCheckObject Used by XRE to check for correct load order, leave this alone.
MASTER ESM OBJECT FUNCTION
XRocketCarADDONRexImport Models added to this list will become available for import at the REX car shop. Add only objectID's, not referenceID's.
XRocketCarADDONNoLiftDelivery If your car is so large that it does not fit the carlift, adding it to this list will have it's delivery at the Rex shop skip the carlift sequence. Add only objectID's, not referenceID's.
XRocketCarObjectScript A system script that must be attached to every car model.
XRocketCarADDONModels Placing your modellist (not the models themselves) in here makes the included models available in CARS!.
XRocketCarADDONPreRegister If you want a placed car worldref to be initialized before it's object sript runs, add the referenceID (not the objectID) to this list. Otherwise it won't initialize before the player gets close enough for it's worldcell to load. Which means it won't have a carkey assigned before that; If, for instance, you targeted a vendor as keyholder it will not become available for purchase until the player has visited the car itself.



  THE SETUP SCRIPT
 
The setup script (XRocketCarSetupScriptXXX) contains your car's parameters, it's where you determine most of your car's specs and features. Consider all 'fields' to be required and be sure not to alter anything besides the setup variables. Most of them have valid ranges which should obviously not be exceeded. Look at the setup scripts from the official XRE models to get more understanding of these values.



VARIABLE FUNCTION
CarInfoMessage ObjectID of the message that you fill with you car's info. Drivers can summon it from the ingame CARS! menu.
CarModVersion The car setup version of CARS! for which this car is designed, for compatibility checks. It's found on the global value XRECARMODELVERSION in XRE - CARS!.esp.
CarVelocityForwardLimit Maximum velocity, in kph. This is only a limit and doesn't determine power/speed.
CarVelocityBackwardLimit Maximum reverse drive velocity, around 20 is usually good.
CarDriveForce

Equivalent to engine power, the right value depends on the physical properties of the car model, particularly the total mass. Take a look at the setups of the official XRE models and experiment when you're tuning your model (next chapter).
Side note: All force parameters are integers and have a log12 ratio to force, thus adding 12 to a CarDriveForce value doubles the corresponding force value.

CarReverseDriveForce Reverse drive force, usually fine around 4 below CarDriveForce, use lower values to simulate heavier vehicles
CarBrakeForce Brake force, usually between 3 and 10 below CarDriveForce, use lower values to simulate heavier vehicles
ClimbForceMod Drive force modifier determining how well the car climbs slopes. Usually 0 or 1. Increase this value to give your car some extra offroad ability or if you're using a low CarDriveForce relative to the car's mass and the car struggles too much on slopes.
CarTransmission Set to 1 for automatic, 2 for manual, 3 for both (switchable while driving)
CarSndSGOverlap Gear switching hysteresis. Should normally be left at 0.1
GearRatios Gear shift percentages of top speed (millecoded, use the calculator)
   - [1st 3 digits] 1st to 2nd gear percentage of velocity limit
   -
[2nd 3 digits] 2st to 3rd gear percentage of velocity limit
   -
[3rd 3 digits] 3rd to 4th gear percentage of velocity limit. Setting this value
                         higher than 100 sets number of gears to 3 instead of 4
CarGearSwitchTime Time it takes to shift gears, only applies to engine sound. Use a lower value for sportier cars.
CarSwitchGearDriveHoldTime Time interval where there is no engine force between gears. Default is 0.15, higher values make shifting gears more sluggish, good for trucks
CarSteerForce Force used to turn the wheels. Too low or too high values imair steering. Look at setups from official XRE cars to get an idea. The ideal value mostly depends on the model's mass, mass distribution and wheel positions. Experiment.
SteerCenterForceMod Force modifier that determines the force used to keep the wheels straight while not steering. The base center steerforce relates directly to CarSteerForce (factor 3 smaller), this modifier is used to adjust from there. Start at 0 and tune up/down to find which value gives your car the most stability. The result is usually close to 0.
SpeedSensSteering This parameter determines how much steering is tamed with increasing velocity. This helps to prevent swerve/spinning by decreasing over-responsive steering at higher speeds. Higher values make steering unresponsive. The right value depends on the agility/stability of your car. Start with 4 and evaluate.
CarOverSteering Setting this to 1 makes the oversteer function available on the car: Holding down de oversteer key disables speed sensitive steering, allowing the driver to take sharper turns, drift.
CarSndEngineType Engine sound type: 1=regular, 2=muscle, 3=truck
DoorSnd Door sound index: currently 1, 2 or 3
HornSnd Horn sound index: 1 to 7
CarBaseHealth The base hitpoints of your car. Corresponds to actor hitpoints, the car takes the same amount of damage from weapons and explosions as creatures and npc's.
CarRadShield Level of protection from radiation: 1=none, 2=low, 3=high
CarBaseFuel Base fuel tank size of the car, in liters
CarFuelConsumption Approximate fuel consumption per km, at average speed, in liters.
Consider that the NV world size is roughly 2 by 4 km, so a car with a 40 liter tank and a consumption of 3 liter per km can cross the map about three times north to south on a full tank.
CarPassengerSeats Number of available seats for teammates
CarGunnerPositions Number of available gunner positions for teammates. Every available one must be positioned.

Gunner1Pos, Gunner2Pos,
Gunner3Pos, Gunner4Pos

Gunner mount positions, setoff at 500 (millecoded, use the calculator)
   - [1st 3 digits minus 500] Gunner X axis position
   -
[2nd 3 digits minus 500] Gunner Y axis position
   -
[3rd 3 digits minus 500] Gunner Z axis position
CarControlPos Positions of control force sources, setoff at 500 (millecoded, use the calculator)
Leave this value at 455530528 unless you know what you're doing.
   - [1st 3 digits minus 500] Drive control center Y axis position
   -
[2nd 3 digits minus 500] Drive control center Z axis position
   -
[3rd 3 digits minus 500] Steer control Z axis position
CarTankPos

Position of fuel tank, setoff at 500(millecoded, use the calculator)
Get these data form your NIF model. May need some adjustment, test at a service station.
   - [1st 3 digits minus 500] Tank X axis position
   -
[2nd 3 digits minus 500] Tank Y axis position
   -
[3rd 3 digits minus 500] Tank Z axis position

CarCamPos Base position of chase cam, setoff at 0(millecoded, use the calculator)
   - [1st 3 digits] Cam Y axis position, reversed
   -
[2nd 3 digits] Cam Z axis position
   -
[3rd 3 digits] Camera target Z axis position, usually set to the car's height itself
ExitCarDistance Distance from car center at which the player exits the car, from car center
ExitCarAngle Angle relative to car at which exiting player is distanced, -90 is left from center
FrontLightStrength Intensity of the headlights 1 to 3
DashboardIndex Currently there's only one available dashboard, so leave at 1
CarFlipForceAdjust Adjustment of force used to flip the car, which is based on cardriveforce
CarNominalMass Sum of all rigidbody masses in the NIF model, only used for car specs display in the car menu
CarDefaultPhysicsLevel Physics level applied while not overridden in car menu, should generally be left at 25
EDITION SPECIFIC OVERRIDES
This is an optional section in the setup script where you can override the default parameters for different versions of your model. For instance, you can make a sports edition of your car by simply adding another XRocketCarModel to the same modellist and add higher driveforce and maxvelocity, conditioned to the models objectID:
  if CarBase == XRocketCarModelXXX
      set XRocketCarSetupHandler.CarVelocityForwardLimit to X
      set XRocketCarSetupHandler.CarDriveForce to X
  endif


NON - SETUP SCRIPT PARAMETERS
Two parameters are not set in the setup script as they need to be known to XRE before the setup script runs: The store value and trunk size. They're set on the setup object itself:
  - Setup object value --> Car value
  - Setup object weight --> Trunk size index (0=no trunk, 1=160, 2=190, 3=220, 4=250)


  WORLD PLACEMENT
 
  • When placing your model in the world editor, you'll notice they apear nose-up. This is normal, just turn the car on it's wheels.
  • When a car is initialized ingame, the XRE registry service assigns an index to it which corresponds to to a unique carkey and licence plate number. The Linked Reference property of the placed car allows you to control where the key is placed. There are three options:
    - Linked to an actor like a vendor adds the key to their inventory
    - Linked to a world object like an XMarker places the key at it's world location
    - Linked to nothing leaves the car unlocked
  • The CARS! registry supports up to 70 cars in the world, so don't go wild with placing cars, or just place nothing and leave your model available for import at the Rex shop.
fig.1 Linked to the XMarker will have the carkey placed on the table
 
  INTEGRITY CHECK
 
When you've imported your model for the first time in the geck, it's a good idea to test it's operational basics. Place a world ref of your car in the world and do these checks:
  • Check if a plate number appears and if the car starts. If not, you didn't set up the lists correctly.
  • Enter your car and drive around a bit to see if the body and wheel collision is there and there are no strange behaviours like shaking or blocked steering/driving. If it does, you probably didn't update some constraint(s) in the NIF model, or you've messed up something in the node structure.
  • Check if the lights work
  • If you changed the control force positions in the model, you can check if the CarControlPos code correctly repositions the projectile sources by doing the following:
    - Disable the CarVisElements node and enable the meshes in the
      DriveControlNode and SteerControlNode.
    - Start the game and before entering your car open the console and type
      "set xreaddontestmode to 1".
    - You can now visually establish if the projectile sources line up correctly.
fig.2 A car dancing around on a malfunctioning left front wheel.
 
 
   
   
   

(c) Ermeso 2013

 

contact