TetherToHorse - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
This article has been flagged as inaccurate.
Please help improve the wiki by learning how to contribute.

Member of: ObjectReference Script

Function to tether the prisoner cart to a horse.

Syntax[edit | edit source]

Function TetherToHorse(ObjectReference akHorse) Native

Parameters[edit | edit source]

Return Value[edit | edit source]

None

Examples[edit | edit source]

; Tether the cart to the horse
Cart.TetherToHorse(Horse)

Notes[edit | edit source]

  • This function moves the horse into position relative to the cart when called.
  • The best time to call this function is in the OnCellLoad() event as at that time both the cart and the horse will have 3D.
  • This function must be applied only to a cart containing Havok data consisting of the following:
  1. A main chassis.
  2. 4 Wheels each attached to 3D named (WheelBackLeft, WheelBackRight, WheelFrontLeft, WheelFrontRight).
  3. A pole sticking out from the front of the cart. to attach to the horse.
  • As of this writing there is a script named CartAndHorseTether with a horse property to perform this function.
  • The cart is not pulled by the pole attached to the wheels. Attempts to do this caused the suspension system for the wheels to break due to the stress. Instead the horse is constrained directly to the cart main chassis. The pole is constrained to the cart for aesthetic reasons only (including turning the wheels).
  • An action is also applied to the cart chassis. This action applies a gravity multiplier to attempt to add extra weight to the cart as well as keeps track of the cart's roll. If the cart tips beyond 45 degrees an impulse is applied to attempt to force the cart back upright.

INISettings[edit | edit source]

There are a number of INISettings used to set up the Havok constraints between the cart and the horse.

 [Cart]
 sHorseConnect="HorseSpine2" ;Name of the bone to add a keyframed Havok object and constraint to the cart.
 fHorseOffsetX=72.0  ;Offset of the horse relative to the cart in X (in BSUnits).
 fHorseOffsetY=300.0 ;Offset of the horse relative to the cart in Y (in BSUnits).
 fHorseOffsetZ=0.0   ;Offset of the horse relative to the cart in Z (in BSUnits).
 fCartPivotX=0.0     /X,Y,Z Offsets of the pivot point for the main constraint relative to the cart (in HKUnits).
 fCartPivotY=3.5
 fCartPivotZ=-0.2
 fHorsePivotX=0.0    ;X,Y,Z offsets of the pivot point for the main constraint relative to the horse connection point (In HKUnits).
 fHorsePivotY=0.0
 fHorsePivotZ=-0.5
 fPolePivotX=0.0     ;X,Y,Z offsets for the constraint point between pole and horse relative to the pole (In HKUnits).
 fPolePivotY=3.8
 fPolePivotZ=0.0
 fHorsePolePivotX=0.0     ;X,Y,Z offsets for the constraint point between pole and horse relative to the horse (In HKUnits).
 fHorsePolePivotY=-0.5
 fHorsePolePivotZ=1.3
 fWheelAngVelMult=2.0 ;Multiplier to angular velocity applied to the wheels to keep them moving even when not on the ground (1.0 = 1 rev/second).
 fTipImpule=10000.0   ;Amount of impulse to apply to "Roll" of cart if it tips beyond 45deg.

See Also[edit | edit source]