ropeCreate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(55 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{TabView
____________________________________________________________________________________________


| Arma 3 |Game name=
|selected= 2
|1.34|Game version=
____________________________________________________________________________________________


| Creates a PhysX rope with given params. For <tt>Take on Helicopters</tt> syntax see [[ropeCreate_TKOH]].<br><br>
|title1= {{Template:TabView/GameTitle|tkoh}}
{{Informative | FROM object has to be transport vehicle, alive with [[enableRopeAttach | rope attachment]] enabled, TO object has to be an entity, alive with [[enableRopeAttach | rope attachment]] enabled.}}|Description=
|content1=
____________________________________________________________________________________________
{{RV|type=command


| [[ropeCreate]] [fromObject, fromPoint, toObject, toPoint, length, ropeStart, ropeEnd] |Syntax=
|game1= tkoh
|version1= 1.00


|p1=[fromObject, fromPoint, toObject, toPoint, length, ropeStart, ropeEnd]: [[Array]]|Parameter 1=
|gr1= Ropes and Sling Loading
|p2= fromObject: [[Object]] - transport where rope starts and which fly behavior will be affected |Parameter 2=
|p3= fromPoint: [[String]] or [[Array]] - position for the rope start, either a memory point [[String]] or relative offset [[Array]] |Parameter 3=
|p4= toObject: [[Object]] - entity which is automatically attached to other side of rope |Parameter 4=
|p5= toPoint: [[String]] or [[Array]] - position for the rope end, either a memory point [[String]] or relative offset [[Array]] |Parameter 5=
|p6= length (Optional): [[Number]] - rope length in meters. Default: -1 |Parameter 6=
|p7= ropeStart (Optional): [[Array]] - array in format [ropeStartType, ropeStartDownVector] where:
* ropeStartType: [[String]] - type of the rope start. Default: ""
* ropeStartDownVector: [[String]] or [[Array]], either a memory point [[String]] or relative vector [[Array]]. If [[String]] is given, then <tt>ropeStartDownVector</tt> is calculated from <tt>fromPoint</tt> towards <tt>ropeStartDownVector</tt> memory point. Default: [0,0,-1] |Parameter 7=
|p8= ropeEnd (Optional): [[Array]] - array in format [ropeEndType, ropeEndDownVector] where:
* ropeEndType: [[String]] - type of the rope end. Default: ""
* ropeEndDownVector: [[String]] or [[Array]], either a memory point [[String]] or relative vector [[Array]]. If [[String]] is given, then <tt>ropeEndDownVector</tt> is calculated from <tt>toPoint</tt> towards <tt>ropeEndDownVector</tt> memory point. Default: [0,0,-1] |Parameter 8=


| [[Object]] - created rope or [[objNull]] on failure|Return value=
|descr= Creates a rope.
____________________________________________________________________________________________
|s2= [[ropeCreate]] [fromObject, fromPoint, length, segments, unroll] |Syntax 2=


|p21= [fromObject, fromPoint, lenght, segments, unroll]: [[Array]] |Parameter 21=
|s1= [[ropeCreate]] [fromObject, fromPoint, toObject, toPoint, segments, length]
|p22= fromObject: [[Object]] - object where rope starts and which fly behavior will be affected |Parameter 22=
|p23= fromPoint: [[Array]] or [[String]] - specifies where on the object the rope should start, either a string (name of memory point) or an array of three numbers (vector in model coordinates) |Parameter 23=
|p24= length (Optional): [[Number]] - rope length |Parameter 24=
|p25= segments (Optional): [[Number]] - define number of rope segments (not used in A3)|Parameter 25=
|p26= unroll (Optional): [[Boolean]] - true if rope starts at one place and falls down unrolling itself, false to create it already in full length (default: false) (not used in A3) |Parameter 26=


|r2= [[Object]] |Return value 2=
|p1= fromObject: [[Object]] - object where rope starts and which fly behavior will be affected
____________________________________________________________________________________________


|x1 = <code>myRope = [[ropeCreate]] <nowiki>[</nowiki>[[vehicle]] [[player]], "slingload0", myCargo, [0, 0, 0], 10];</code> |Example 1=
|p2= fromPoint: [[Array]] or [[String]] - specifies where on the object the rope should start, either a string (name of memory point) or an array of three numbers (vector in model coordinates).
|x2 = <code>myRope = [[ropeCreate]] [veh1, [0,0,-2], veh2, [0,0,0], 10];</code> |Example 2=


| [[ropeDestroy]], [[ropeDetach]], [[ropeSetCargoMass]], [[ropes]], [[canSlingLoad]], [[enableRopeAttach]], [[getSlingLoad]], [[ropeAttachedObjects]], [[ropeAttachTo]], [[ropeLength]], [[ropeUnwound]], [[ropeAttachedTo]], [[ropeAttachEnabled]], [[ropeCut]], [[ropeEndPosition]], [[ropeUnwind]] |See also=
|p3= toObject: [[Object]] - object which is automatically attached to other side of rope (can be objNull, rope will stay with free end)


|p4= toPoint: [[Array]] or [[String]] - specifies where on the object the rope should finish, either a string (name of memory point) or an array of three numbers (vector in model coordinates)
|p5= segments: [[Number]] - define number of segments to be created
|p6= length: [[Number]] - (Optional) rope length in meters
|r1= [[Object]]
|s2= [[ropeCreate]] [fromObject, fromPoint, length, segments, unroll, ropeType]
|p21= fromObject: [[Object]] - object where rope starts and which fly behavior will be affected
|p22= fromPoint: [[Array]] or [[String]] - specifies where on the object the rope should start, either a string (name of memory point) or an array of three numbers (vector in model coordinates)
|p23= length: [[Number]] - (Optional) rope length
|p24= segments: [[Number]] - (Optional) define number of rope segments
|p25= unroll: [[Boolean]] - (Optional, default false) true if rope starts at one place and falls down unrolling itself, false to create it already in full length
|r2= [[Object]]
|x1= <sqf>myRope = ropeCreate [vehicle player, "fastrope0", 10, 10, true];</sqf>
|seealso= [[ropeDestroy]] [[ropeDetach]] [[ropeSetCargoMass]]
}}
}}


<h3 style="display:none">Notes</h3>
|title2= {{Template:TabView/GameTitle|arma3}}
<dl class="command_description">
|content2=
<!-- Note Section BEGIN -->
{{RV|type=command
 
|game1= arma3
 
|version1= 1.34
 
|eff= global
 
|gr1= Ropes and Sling Loading
 
|descr= Creates a PhysX rope with given params. Since Arma 3 v2.14 the optional arguments can be skipped by setting them to [[nil]].
{{Feature | Informative |
* ''fromObject'' has to be [[ropeCreate/transport | transport]] vehicle, [[alive]] with [[enableRopeAttach | rope attachment]] enabled, ''toObject'' has to be an entity, alive with [[enableRopeAttach | rope attachment]] enabled.
* {{hl|ropeEndType}} is defined in config under {{hl|"CfgNonAIVehicles" >> "RopeEnd"}}; see [[Arma 3: Ropes]]. Currently this is a hook that will be created on the end of the rope, and {{hl|ropeEndDownVector}} is its orientation, [0,0,-1] for example. The {{hl|"RopeEnd"}} is only shown when the rope is created object to object, it does not show on the open ended rope for some reason. There is currently no {{hl|"RopeStart"}}.
* The rope creation is limited to 63 segments.}}
 
|s1= [[ropeCreate]] [fromObject, fromPoint, toObject, toPoint, length, ropeStart, ropeEnd, ropeType, nSegments]
 
|p1= fromObject: [[Object]] - [[ropeCreate/transport | transport]] where the rope originates and which fly behavior will be affected
 
|p2= fromPoint: [[String]] or [[Array]] - position for the rope start, either a memory point [[String]] or relative offset [[Array]]
 
|p3= toObject: [[Object]] - entity which is automatically [[ropeAttachTo | attached to]] the end of the rope
 
|p4= toPoint: [[String]] or [[Array]] - position for the rope end, either a memory point [[String]] or relative offset [[Array]]


<!-- Note Section END -->
|p5= length: [[Number]] - (Optional, default -1) rope length in meters
</dl>


<h3 style="display:none">Bottom Section</h3>
|p6= ropeStart: [[Array]] - (Optional, default ["", [0,0,-1]]) array in format [ropeStartType, ropeStartDownVector] where:
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
* ropeStartType: [[String]] - type of the rope start (see description)
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
* ropeStartDownVector: [[String]] or [[Array]], either a memory point [[String]] or relative vector [[Array]]. If [[String]] is given, then {{hl|ropeStartDownVector}} is calculated from {{hl|fromPoint}} towards {{hl|ropeStartDownVector}} memory point
[[Category:Command Group: Ropes and Sling Loading]]


<!-- CONTINUE Notes -->
|p7= ropeEnd: [[Array]] - (Optional, default ["", [0,0,-1]]) array in format [ropeEndType, ropeEndDownVector] where:
<dl class="command_description">
* ropeEndType: [[String]] - type of the rope end (see description)
<dd class="notedate">Posted on November 8, 2014 - 14:57 (UTC)</dd>
* ropeEndDownVector: [[String]] or [[Array]], either a memory point [[String]] or relative vector [[Array]]. If [[String]] is given, then {{hl|ropeEndDownVector}} is calculated from {{hl|toPoint}} towards {{hl|ropeEndDownVector}} memory point
<dt class="note">[[User:Tajin|Tajin]]</dt>
<dd class="note">
Doesn't work well for towing vehicles on the ground.<br>
Their wheels don't turn freely and have a LOT of friction. You'll most likely end up flipping the vehicle over if you try to tow it.<br>
<br>
Also note that ropes can be destroyed/cut by shooting at them.
</dd>


<dd class="notedate">Posted on January 4, 2015 - 03:24 (UTC)</dd>
|p8= ropeType: [[String]] - (Optional, default "Rope") - rope type, {{hl|CfgVehicles}}' classname
<dt class="note">[[User:Feint|Feint]]</dt>
|p8since= arma3 2.06
<dd class="note">
 
Pay special attention to what is your '''fromObject''' and what is your '''toObject''' as this will have an impact on the physics of the rope.<br>
|p9= nSegments: [[Number]] - (Optional, default -1) - number of rope segments (max 63)
<br>
|p9since= arma3 2.14
 
|r1= [[Object]] - created rope or [[objNull]] on failure
 
|s2= [[ropeCreate]] [fromObject, fromPoint, length, ropeStart, ropeEnd, ropeType, nSegments]
 
|p21= fromObject: [[Object]] - [[ropeCreate/transport | transport]] where the rope originates and which fly behavior will be affected
 
|p22= fromPoint: [[String]] or [[Array]] - position for the rope start, either a memory point [[String]] or relative offset [[Array]]
 
|p23= length: [[Number]] - rope length in meters
 
|p24= ropeStart: [[Array]] - (Optional, default ["", [0,0,-1]]) array in format [ropeStartType, ropeStartDownVector] where:
* ropeStartType: [[String]] - type of the rope start (see description)
* ropeStartDownVector: [[String]] or [[Array]], either a memory point [[String]] or relative vector [[Array]]. If [[String]] is given, then {{hl|ropeStartDownVector}} is calculated from {{hl|fromPoint}} towards {{hl|ropeStartDownVector}} memory point
 
|p25= ropeEnd: [[Array]] - (Optional, default ["", [0,0,-1]]) array in format [ropeEndType, ropeEndDownVector] where:
* ropeEndType: [[String]] - type of the rope end (see description)
* ropeEndDownVector: [[Array]] - relative vector
 
|p26= ropeType: [[String]] - (Optional, default "Rope") - rope type, {{hl|CfgVehicles}}' classname
|p26since= arma3 2.06
 
|p27= nSegments: [[Number]] - (Optional, default -1) - number of rope segments (max 63)
|p27since= arma3 2.14
 
|r2= [[Object]] - created rope or [[objNull]] on failure
 
|x1= <sqf>myRope = ropeCreate [vehicle player, "slingload0", myCargo, [0, 0, 0], 10];</sqf>
 
|x2= <sqf>myRope = ropeCreate [veh1, [0, 0, -2], veh2, [0, 0, 0], 10];</sqf>
 
|x3= Free end rope (Alt Syntax):
<sqf>myRope = ropeCreate [vehicle player, [0, 0, 0], 10];</sqf>
 
|x4= A rope with a hook on the end:
<sqf>myRope = ropeCreate [heli, "slingload0", player, [0, 0, 2], 20, [], ["RopeEnd", [0, 0, -1]]];</sqf>
 
|x5= Since 2.14:
<sqf>myRope = ropeCreate [vehicle player, [0, 0, 0], 10, nil, nil, nil, 50];</sqf>
 
|seealso= [[Arma 3: Ropes]] [[ropeDestroy]] [[ropeDetach]] [[ropes]] [[ropeSegments]]
}}
 
}}
 
{{Note
|user= Tajin
|timestamp= 20141108145700
|text= Doesn't work well for towing vehicles on the ground.<br>
Their wheels don't turn freely and have a LOT of friction. You'll most likely end up flipping the vehicle over if you try to tow it.<br><br>
Also note that ropes can be destroyed/cut by shooting at them.<br>
'''Edit:''' see [[setTowParent]] since {{GVI|arma3|2.06|size= 0.75}}!
}}
 
{{Note
|user= Feint
|timestamp= 20150104032400
|text= Pay special attention to what is your '''fromObject''' and what is your '''toObject''' as this will have an impact on the physics of the rope.<br><br>
''For example:'' If you want to tow an Assault CRRC from a heavier Speedboat Minigun, attach two boats together with a rope.  If you drive the Speedboat Minigun and set the CRRC as the fromObject, the rope will have almost no elasticity and the CRRC will yank around as you tow it.  However, if you set the CRRC as the toObject, the rope will have more elasticity and will be a little friendlier for the CRRC when you are towing it.
''For example:'' If you want to tow an Assault CRRC from a heavier Speedboat Minigun, attach two boats together with a rope.  If you drive the Speedboat Minigun and set the CRRC as the fromObject, the rope will have almost no elasticity and the CRRC will yank around as you tow it.  However, if you set the CRRC as the toObject, the rope will have more elasticity and will be a little friendlier for the CRRC when you are towing it.
</dd>
}}


<dd class="notedate">Posted on July 9, 2015</dd>
{{Note
<dt class="note">[[User:Druid|Druid]]</dt>
|user= Sa-Matra
<dd class="note">
|timestamp= 20240522042007
Parameters ''segments'' and ''unroll'' are not supported in Arma 3. Segments are set automatically according the length of a rope.
|text= Following simulations are considered transports by that transport config list:
</dd>
<sqf>
</dl>
"motorcycle"
<!-- DISCONTINUE Notes -->
"car"
"carx"
"tankx"
"airplanex"
"helicopterrtd"
"shipx"
"submarinex"
"paraglide"
"parachute"
</sqf>
There could be more but unlisted there, but these should cover majority of the vehicles in all mods.
}}

Latest revision as of 11:34, 3 September 2024

tkoh logo small.png Take On Helicopters
Arma 3 logo black.png Arma 3
Hover & click on the images for description

Description

Description:
Creates a rope.
Groups:
Ropes and Sling Loading

Syntax

Syntax:
ropeCreate [fromObject, fromPoint, toObject, toPoint, segments, length]
Parameters:
fromObject: Object - object where rope starts and which fly behavior will be affected
fromPoint: Array or String - specifies where on the object the rope should start, either a string (name of memory point) or an array of three numbers (vector in model coordinates).
toObject: Object - object which is automatically attached to other side of rope (can be objNull, rope will stay with free end)
toPoint: Array or String - specifies where on the object the rope should finish, either a string (name of memory point) or an array of three numbers (vector in model coordinates)
segments: Number - define number of segments to be created
length: Number - (Optional) rope length in meters
Return Value:
Object

Alternative Syntax

Syntax:
ropeCreate [fromObject, fromPoint, length, segments, unroll, ropeType]
Parameters:
fromObject: Object - object where rope starts and which fly behavior will be affected
fromPoint: Array or String - specifies where on the object the rope should start, either a string (name of memory point) or an array of three numbers (vector in model coordinates)
length: Number - (Optional) rope length
segments: Number - (Optional) define number of rope segments
unroll: Boolean - (Optional, default false) true if rope starts at one place and falls down unrolling itself, false to create it already in full length
Return Value:
Object

Examples

Example 1:
myRope = ropeCreate [vehicle player, "fastrope0", 10, 10, true];

Additional Information

See also:
ropeDestroy ropeDetach ropeSetCargoMass

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Hover & click on the images for description

Description

Description:
Creates a PhysX rope with given params. Since Arma 3 v2.14 the optional arguments can be skipped by setting them to nil.
  • fromObject has to be transport vehicle, alive with rope attachment enabled, toObject has to be an entity, alive with rope attachment enabled.
  • ropeEndType is defined in config under "CfgNonAIVehicles" >> "RopeEnd"; see Arma 3: Ropes. Currently this is a hook that will be created on the end of the rope, and ropeEndDownVector is its orientation, [0,0,-1] for example. The "RopeEnd" is only shown when the rope is created object to object, it does not show on the open ended rope for some reason. There is currently no "RopeStart".
  • The rope creation is limited to 63 segments.
Groups:
Ropes and Sling Loading

Syntax

Syntax:
ropeCreate [fromObject, fromPoint, toObject, toPoint, length, ropeStart, ropeEnd, ropeType, nSegments]
Parameters:
fromObject: Object - transport where the rope originates and which fly behavior will be affected
fromPoint: String or Array - position for the rope start, either a memory point String or relative offset Array
toObject: Object - entity which is automatically attached to the end of the rope
toPoint: String or Array - position for the rope end, either a memory point String or relative offset Array
length: Number - (Optional, default -1) rope length in meters
ropeStart: Array - (Optional, default ["", [0,0,-1]]) array in format [ropeStartType, ropeStartDownVector] where:
  • ropeStartType: String - type of the rope start (see description)
  • ropeStartDownVector: String or Array, either a memory point String or relative vector Array. If String is given, then ropeStartDownVector is calculated from fromPoint towards ropeStartDownVector memory point
ropeEnd: Array - (Optional, default ["", [0,0,-1]]) array in format [ropeEndType, ropeEndDownVector] where:
  • ropeEndType: String - type of the rope end (see description)
  • ropeEndDownVector: String or Array, either a memory point String or relative vector Array. If String is given, then ropeEndDownVector is calculated from toPoint towards ropeEndDownVector memory point
since Arma 3 logo black.png2.06
ropeType: String - (Optional, default "Rope") - rope type, CfgVehicles' classname
since Arma 3 logo black.png2.14
nSegments: Number - (Optional, default -1) - number of rope segments (max 63)
Return Value:
Object - created rope or objNull on failure

Alternative Syntax

Syntax:
ropeCreate [fromObject, fromPoint, length, ropeStart, ropeEnd, ropeType, nSegments]
Parameters:
fromObject: Object - transport where the rope originates and which fly behavior will be affected
fromPoint: String or Array - position for the rope start, either a memory point String or relative offset Array
length: Number - rope length in meters
ropeStart: Array - (Optional, default ["", [0,0,-1]]) array in format [ropeStartType, ropeStartDownVector] where:
  • ropeStartType: String - type of the rope start (see description)
  • ropeStartDownVector: String or Array, either a memory point String or relative vector Array. If String is given, then ropeStartDownVector is calculated from fromPoint towards ropeStartDownVector memory point
ropeEnd: Array - (Optional, default ["", [0,0,-1]]) array in format [ropeEndType, ropeEndDownVector] where:
  • ropeEndType: String - type of the rope end (see description)
  • ropeEndDownVector: Array - relative vector
since Arma 3 logo black.png2.06
ropeType: String - (Optional, default "Rope") - rope type, CfgVehicles' classname
since Arma 3 logo black.png2.14
nSegments: Number - (Optional, default -1) - number of rope segments (max 63)
Return Value:
Object - created rope or objNull on failure

Examples

Example 1:
myRope = ropeCreate [vehicle player, "slingload0", myCargo, [0, 0, 0], 10];
Example 2:
myRope = ropeCreate [veh1, [0, 0, -2], veh2, [0, 0, 0], 10];
Example 3:
Free end rope (Alt Syntax):
myRope = ropeCreate [vehicle player, [0, 0, 0], 10];
Example 4:
A rope with a hook on the end:
myRope = ropeCreate [heli, "slingload0", player, [0, 0, 2], 20, [], ["RopeEnd", [0, 0, -1]]];
Example 5:
Since 2.14:
myRope = ropeCreate [vehicle player, [0, 0, 0], 10, nil, nil, nil, 50];

Additional Information

See also:
Arma 3: Ropes ropeDestroy ropeDetach ropes ropeSegments

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Tajin - c
Posted on Nov 08, 2014 - 14:57 (UTC)
Doesn't work well for towing vehicles on the ground.
Their wheels don't turn freely and have a LOT of friction. You'll most likely end up flipping the vehicle over if you try to tow it.

Also note that ropes can be destroyed/cut by shooting at them.
Edit: see setTowParent since Arma 3 logo black.png2.06!
Feint - c
Posted on Jan 04, 2015 - 03:24 (UTC)
Pay special attention to what is your fromObject and what is your toObject as this will have an impact on the physics of the rope.

For example: If you want to tow an Assault CRRC from a heavier Speedboat Minigun, attach two boats together with a rope. If you drive the Speedboat Minigun and set the CRRC as the fromObject, the rope will have almost no elasticity and the CRRC will yank around as you tow it. However, if you set the CRRC as the toObject, the rope will have more elasticity and will be a little friendlier for the CRRC when you are towing it.
Sa-Matra - c
Posted on May 22, 2024 - 04:20 (UTC)
Following simulations are considered transports by that transport config list:
"motorcycle" "car" "carx" "tankx" "airplanex" "helicopterrtd" "shipx" "submarinex" "paraglide" "parachute"
There could be more but unlisted there, but these should cover majority of the vehicles in all mods.