Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Introduced in

Version:1.34

Description

Description:Creates "winchable" rope segments, which are attached to a vehicle. A vehicle can have several winches attached to it.

Attaching objects to the created rope should be done using createJointExt - SphereJoint:

_endrope = winchEndSegment winch; // last rope segment on existing winch
[someObj,_endrope] createJointExt ["FixedJoint",["tieDown_1_1"],[]]; // attach object to rope

Syntax

Syntax:winchCreate [vehicle, ropeClass, hookClass, ropeTop, ropeBottom, offset, [swingSpring, twistSpring, damping], ropeProperties, collision]
Parameters:
  • vehicle: Object - Object rope is attached to.
  • ropeClass: String - Type of rope to use. Can be "vbs2_rope_segment","vbs2_rope_segment_0_6", or "vbs2_rope_segment_1_2".
  • hookClass: String - Type of hook to use. Leave empty for no hook. In V1.50+, the hook must be a PhysX class.
  • ropeTop: String or Array - Either an [x,y,z] offset, or name of the rope memory point which connects to the previous segment.
  • ropeBottom: String or Array - Either an [x,y,z] offset, or name of the rope memory point which connects to the next segment.
  • offset: String or Array - Winch offset in relation to vehicle. Either an array ([x,y,z]) or a named selection.
  • ropeProperties: Array of [swingSpring, twistSpring, damping] - Rope properties that consist of:
    • swingSpring: Number - Spring created in swing directions, from interval <0, inf), 0 means no spring is used.
    • twistSpring: Number - Spring created in twist directions, from interval <0, inf), 0 means no spring is used.
    • damping: Number - Simulates environmental (air) friction and can be used for stabilizing the rope perpetual swinging, from interval <0, inf), 0 means no damping, reasonable values are around 0.2.
  • collision: Boolean - Toggles collisions for the winch rope segments (pptional, default: true) (V2.03+)
Return Value:NetObject - Winch device (-1, if failed to create).

Examples

Examples:
_winch = winchCreate [heli,"vbs2_rope_segment","", "top", "bottom", [0, 0, 0], [0, 0, 0]]
Creates a winch on the object at [0,0,0], and for the rope segments uses the class "vbs2_rope_segment". The model has two memory addresses, "top" and "bottom", to get the model coordinate position where to attach each segment to. The winch does not use a hook, so none is specified.
_winch = winchCreate [heli,"vbs2_rope_segment_0_3","vbs_helicopter_hook", [0,1,0], "bottom", "MyWinchPos", [0, 0, 0]]
Creates a winch at the helicopter (heli) "MyWinchPos" memory point. Use [0,1,0] as the top point of each segment, instead of a memory address; and for the bottom position, use the memory address "bottom". No swingSrping, or twistSpring, or damping parameters. A hook of the type "vbs_helicopter_hook" is created.

Additional Information

See also: winches, winchUnwind, winchDispose, createRope
Multiplayer:
Problems:

Notes







Posted on Jul 16, 2010
Kronzky
Any hooks create via this command are currently not attached to the vehicle, so this option should only be used on static vehicles.