Jump to content
fin_soldier

How to get AI to Sling Load

Recommended Posts

Hello,

 

Well the question is quite simple as above, and I have yet to found a solution.

It seems like the system is broken because I've tried these "solutions" below without success:

 

I tried this:

nul =  H1 setslingload Veh1;

And this:

B0PIWA1.jpg

 

I'm running the game completely vanilla, and I'm not sure how to get it working.

I simply want the helicopter to initiate with the cargo loaded from the gecko.

 

I appreciate the help, so thank you in advance! 🙂

Share this post


Link to post
Share on other sites

Hello,

I don't have any module, any edited waypoint, just an (old but working) code like this:

 

One helo named:  redHelo1

4 markers:

mk0 which is the initial point for approaching the object to be hooked, so not too close.

mk1 , the marker on position of the cargo to sling

mk2, the marker where to drop the cargo

mk3, a marker to move for slinging back the cargo (initial point like mk0 but on return ticket)

1 cargo: cargo1 (any type), on mk1
 

0 = [] spawn {
  while {count waypoints group redhelo1 >0} do {
    deleteWaypoint (waypoints group redhelo1 select 0)
  };
  private "_wp";
  while {alive redHelo1} do {
    waituntil {sleep 2; count waypoints group redHelo1 == 0};
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk0",0];
    _wp setWaypointType "move";
    waituntil {getPosATL redhelo1 select 2 > 10};
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk1",0];
    _wp setWaypointType "MOVE";
    _wp setWaypointSpeed "LIMITED";
    _wp setWaypointStatements ["true","redhelo1 land 'get in'"];
    waituntil {getPosATL redhelo1 select 2 < 3};
    redHelo1 setSlingLoad cargo1;
    redhelo1 land "none";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk2",0];
    _wp setWaypointSpeed "NORMAL";
    _wp setWaypointType "unhook";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk3",0];
    _wp setWaypointType "move";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk2",0];
    _wp setWaypointType "MOVE";
    _wp setWaypointSpeed "LIMITED";
    _wp setWaypointStatements ["true","redhelo1 land 'get in'" ];
    waituntil {getPosATL redhelo1 select 2 > 10};
    waituntil {getPosATL redhelo1 select 2 < 3};
    redHelo1 setSlingLoad cargo1;
    redHelo1 land "NONE";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk1",0];
    _wp setWaypointSpeed "NORMAL";
    _wp setWaypointType "unhook";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk0",0];
    _wp setWaypointType "SAD";
    waitUntil {sleep 2; waypointtype [group redHelo1, currentWaypoint group redhelo1] == "SAD"};
    while {count waypoints group redhelo1 >0} do {
      deleteWaypoint (waypoints group redhelo1 select 0)
    };
  };
};



That's for the principle. You can multiply helos but make sure they will not collide. You can multiply cargos in one way before sling loading back them but you need to plan offsets for the pattern (offset on objects / mk0 must be set on unhook positions (mk2 as reference). Same in other way.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
10 hours ago, pierremgi said:

Hello,

I don't have any module, any edited waypoint, just an (old but working) code like this:

 

One helo named:  redHelo1

4 markers:

mk0 which is the initial point for approaching the object to be hooked, so not too close.

mk1 , the marker on position of the cargo to sling

mk2, the marker where to drop the cargo

 mk3, a marker to move for slinging back the cargo (initial point like mk0 but on return ticket)

1 cargo: cargo1 (any type), on mk1
 


0 = [] spawn {
  while {count waypoints group redhelo1 >0} do {
    deleteWaypoint (waypoints group redhelo1 select 0)
  };
  private "_wp";
  while {alive redHelo1} do {
    waituntil {sleep 2; count waypoints group redHelo1 == 0};
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk0",0];
    _wp setWaypointType "move";
    waituntil {getPosATL redhelo1 select 2 > 10};
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk1",0];
    _wp setWaypointType "MOVE";
    _wp setWaypointSpeed "LIMITED";
    _wp setWaypointStatements ["true","redhelo1 land 'get in'"];
    waituntil {getPosATL redhelo1 select 2 < 3};
    redHelo1 setSlingLoad cargo1;
    redhelo1 land "none";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk2",0];
    _wp setWaypointSpeed "NORMAL";
    _wp setWaypointType "unhook";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk3",0];
    _wp setWaypointType "move";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk2",0];
    _wp setWaypointType "MOVE";
    _wp setWaypointSpeed "LIMITED";
    _wp setWaypointStatements ["true","redhelo1 land 'get in'" ];
    waituntil {getPosATL redhelo1 select 2 > 10};
    waituntil {getPosATL redhelo1 select 2 < 3};
    redHelo1 setSlingLoad cargo1;
    redHelo1 land "NONE";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk1",0];
    _wp setWaypointSpeed "NORMAL";
    _wp setWaypointType "unhook";
    _wp = group redHelo1 addWaypoint [getMarkerPos "mk0",0];
    _wp setWaypointType "SAD";
    waitUntil {sleep 2; waypointtype [group redHelo1, currentWaypoint group redhelo1] == "SAD"};
    while {count waypoints group redhelo1 >0} do {
      deleteWaypoint (waypoints group redhelo1 select 0)
    };
  };
};



That's for the principle. You can multiply helos but make sure they will not collide. You can multiply cargos in one way before sling loading back them but you need to plan offsets for the pattern (offset on objects / mk0 must be set on unhook positions (mk2 as reference). Same in other way.

 

Thank you, I'll test this out later today. 

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

×