Page tree
Skip to end of metadata
Go to start of metadata



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.

When attaching objects to the created rope, this should be done via 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], 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 empty for no hook. For V1.50+ hook must be a physX class.
  • ropeTop: String or Array - Either [x,y,z] offset, or name of rope's memory point which connects to the previous segment.
  • ropeBottom: String or Array - Either [x,y,z] offset, name of rope's 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,
  • swingSpring: Number - Spring created in swing directions, from interval <0, inf), 0 means no spring will be used
  • twistSpring: Number - Spring created in twist directions, from interval <0, inf), 0 means no spring will be used
  • damping: Number - damping 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 (Optional, 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. Winch does not use a hook so none is specified.
_winch = winchCreate [heli,"vbs2_rope_segment","vbs2_heloHook", [0,1,0], "bottom", "MyWinchPos", [0, 0, 0]]
Creates a winch at the heli's "MyWinchPos" memory position. Use as the top point of each segment [0,1,0] instead of a memory address and for the bottom position use the memory address "bottom". No swingSrping, or twistSpring and damping. A hook of type "vbs2_heloHook" 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.