Jump to content
Sign in to follow this  
maddogx

Rope attachment scripting basics

Recommended Posts

Here is how I believe the length of ropes are controlled.

RopeUnwind

To change the length of a rope, use the ropeUnwind command:

Description:

ropeUnwind [ropeObject,Speed,Desired Length,(Relative)];

  • RopeObject points to the rope itself. After creation it can be referenced in other script commands.
  • Speed. Number . Sets how fast the length will change.
  • Desired Length Number. How long to make the new length.
  • (Relative) Boolean. If set to true, Desired length defines how much longer or shorter to make the rope relative to it's current length.

Simple usage example:

ropeUnwind [ myrope,1,10,true];

This will make the rope object myrope 10m longer.

ropeUnwind [ myrope,1,10,false];

This will make the rope myrope 10m long.

Share this post


Link to post
Share on other sites

Is it possible to start the mission with rope attached to the helicopter and no cargo? How would one specify the length of the rope? I've been able to get a 150 feet line a few times by using: (heli1 distance cargo1) < 45

It would be a bit more realistic to have to start with the rope empy, although it doesn't behave very well empty when its 150 feet.

Share this post


Link to post
Share on other sites

Here is how I believe objects can be atached to ropes.

RopeAttachto

To attach created rope to an object, use the ropeAttachto command:

Description:

[object,position] ropeattachto ropeObject;

  • ObjectThe object you want to connect to the end of the rope.
  • position. Where on the object to attach the rope to. May have other options such as mempoints?
  • ropeObject Rope object created using the alternative syntax.

Simple usage example:

Using the alternate syntax to create a rope below will create a rope 30m long with 10 segments the true means it will unroll. Attached to myheli.

myRope = ropecreate [myheli ,"slingload0",10,30,true];

[mycargo,[0,0,0]] ropeAttachTo myRope ;

This will connect the rope myrope to the mycargo object at it's [0,0,0] point.

Below place in an initialization field of a helicopter place an object nearby named mycargo.

Will create a rope which will unroll out of the helicopter, then after ten seconds will attach to the object mycargo.

si1 = [this] spawn
{
_plane = _this select 0;
_myRope = ropecreate [_plane ,"slingload0",10,30,true];
sleep 10;
[mycargo,[0,0,0]] ropeAttachTo _myRope ;


};

RopeCut

To cut a rope, use the ropeCut command:

Description:

ropeCut [ropeObject,number];

  • ropeObject Rope object that has been created.
  • number. Where to cut the rope in metres from the helicopter.

Simple usage example:

ropeCut [myrope,10];

Will cut a rope named myrope leaving 10 metres attached to the helicopter.

Note these are just the aspects I have gotten to work. Other syntax options may be possible.

Edited by blakeace

Share this post


Link to post
Share on other sites

Just to save confusion from Blakeace post

myRope = ropecreate [myheli ,"slingload0",10,30,true];
ropeCut [my_rope,10];

above should be

ropeCut [myrope,10];
< change is my_rope to myrope for variable name of rope consitency in example

Share this post


Link to post
Share on other sites
Just to save confusion from Blakeace post...

...change is my_rope to myrope for variable name of rope consitency in example

Good spot thanks :)

Post corrected.

Share this post


Link to post
Share on other sites

I'm stuck, I was trying to have mission start with a 150 ft longline attached to cargo and a shutdown heli. I can get it to work with your example but I can't figure out how to specify where to attach the rope on heli1.

I've tried this, but the rope won't attach when the mission starts:

my_rope = ropecreate [heli1,[0, 1.3, -1.65], "cargo1",46,20,true]; [cargo1,[0,0,0]] ropeAttachTo my_rope;

I can get it to work if I just omit the [0,1.3, -1.65] (which btw is a good position for the light heli) but it attaches near the main rotor. Also I found that 46 is what specifies the distance not the 20.

Share this post


Link to post
Share on other sites
I'm stuck, I was trying to have mission start with a 150 ft longline attached to cargo and a shutdown heli. I can get it to work with your example but I can't figure out how to specify where to attach the rope on heli1.

I've tried this, but the rope won't attach when the mission starts:

I can get it to work if I just omit the [0,1.3, -1.65] (which btw is a good position for the light heli) but it attaches near the main rotor. Also I found that 46 is what specifies the distance not the 20.

Try "slingload0" it's a memposition for sling loading. An example here http://community.bistudio.com/wiki/ropeCreate which is where I got it from. Works well with all three standard types.

Ah makes sense now why my rope wasn't increasing in length :)

Share this post


Link to post
Share on other sites

@blakeace: Thanks for the info on RopeAttachTo and RopeCut. :)

I've qoted your explanation in the first post.

Share this post


Link to post
Share on other sites

Ok, got it finally. This seems to work good for a helicopter and slingload already attached and both sitting on the ground. The line is 150 ft (46 meters).

my_rope = ropeCreate[heli1, 'slingload0', cargo1, [0, 1, 0], 20,46] ;

It seems you had the line length in the correct area but something was missing so it was bumped back. The only problem is the attach position coordinates of the cargo don't seem to do anything.

Edited by LeftSkidLow

Share this post


Link to post
Share on other sites
@blakeace: Thanks for the info on RopeAttachTo and RopeCut. :)

I've qoted your explanation in the first post.

No worries, I also added RopeUnwind two posts prior to those, you may wish to add that as well to keep everything together?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×