Jump to content
Theo1143

Detach and check if object is being attached? (Heli slingloading)

Recommended Posts

So long story short I'm setting up a mission whereby the player has to drop off some objects at a location.

Now the problem i'm running into is that whenever the object gets dropped off by the player it could very easily be picked up and the object would still be complete.

I also don't wanna set up to many conditions since it is just such a small thing...

 

So therefore did I came up with a solution to remove the object being lift-able together with disabling the simulation. (while having the trigger low enough so it requires you to put it on the ground and on a 3sec timout)

(vehicle player) enableRopeAttach false;

Which works perfectly but it will still looks ugly when you fly away so I wanna detach the box also on this way.

Only thing that I did find was this which does the opposite of what I need it to do:...

_success = heli1 setSlingLoad veh1;

Is there a way of detaching the slingload ropes from the heli while the player is flying it with a code?

And is there a way of checking if a sudden object is attached to the heli with a trigger condition preferably?

 

 

 

Edit: Solved

 

If object cargo1 is being attached to the slingload of heli1 shoot trigger:

cargo1 == getSlingLoad heli1

Attach sling-load ropes from heli1 to object cargo1:

_success = heli1 setSlingLoad cargo1;

Detach ALL sling-load ropes from the vehicle heli1:

_success = heli1 setSlingLoad objNull;

 

Share this post


Link to post
Share on other sites

To detach the sling load with a script:  (old way doesn't seem to work anymore, this one does)

_success = heli1 setSlingLoad objNull;

So that problem has been solved, now only remains the condition to check if an object has been attached to a heli.

So for example when Heli1 attaches the Object AmmoBox1 the trigger will shoot.

 

Anyone knows a way of doing this?

Share this post


Link to post
Share on other sites

There is a nifty command to get all the objects being slingloaded by a vehicle: ropeAttachedObjects

 

So in a trigger condition that detects you pickup up any kind of cargo:

!isNull getSlingLoad heli1

And in a trigger condition that detects you pickup up cargo1 object:

cargo1 == getSlingLoad heli1

 

You do want the enableRopeAttach to be put on the cargo object after it has been dropped where it needs to go, otherwise it can indeed by stolen again!

So where you call your detach script add some extra stuff:

heli1 setSlingLoad objNull; cargo1 allowRopeAttach false;

 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 7-10-2017 at 11:37 PM, Sgt. Dennenboom said:

There is a nifty command to get all the objects being slingloaded by a vehicle: ropeAttachedObjects

 

So in a trigger condition that detects you pickup up any kind of cargo:


!isNull getSlingLoad heli1

And in a trigger condition that detects you pickup up cargo1 object:


cargo1 == getSlingLoad heli1

 

You do want the enableRopeAttach to be put on the cargo object after it has been dropped where it needs to go, otherwise it can indeed by stolen again!

So where you call your detach script add some extra stuff:


heli1 setSlingLoad objNull; cargo1 allowRopeAttach false;

 

 

Yeah i'm not a scripter myself, already found ropeAttachedObjects but didn't got any wiser out of it.

cargo1 == getSlingLoad heli1

Is exactly where I was looking for, Thanks a lot

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

×