Home   Help Search Login Register  

Author Topic: (Accepted) Mando Heliroute ArmA  (Read 20888 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute ArmA
« Reply #15 on: 08 Sep 2007, 00:27:19 »
removed old link
« Last Edit: 06 Feb 2008, 10:46:26 by Mandoble »

Offline Zarele

  • Members
  • *
  • I'm a llama!
Re: Mando Heliroute ArmA
« Reply #16 on: 10 Sep 2007, 21:24:44 »
Ok I got it and it looks nice in the demo. Problem is i cant get it to work proper with my mission. I want 2 groups to be extracted is that possible? On the same spot?

Cheerz

*edit
God i hate it when this happens.
I found out how.
You just add a new line : {_x assignAsCargo heli1} forEach units group player1; units group player1 orderGetIn true; for each group you want.

I still have difficultys with sleep. Does this stand for as to wait for each new destination? As is sleep2 for dest 2?

« Last Edit: 10 Sep 2007, 21:40:23 by Zarele »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute ArmA
« Reply #17 on: 10 Sep 2007, 22:28:26 »
If you want two or more groups to be extracted, order them to get in the chopper, wait until all of them are inboard and then execute the heliroute to get them to a safe area.

Code: [Select]
_scr = [heli1,[getPos dest1],50, true]execVM"mando_heliroute_arma.sqf";
Sleep 1;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};

the waitUntil will keep there while the chopper is "busy" with its current route. When it changes to anything different than busy the chopper route is finished, it is landed at destination or destroyed by enemy fire  ;)

Offline Manzilla

  • Members
  • *
Re: (Accepted) Mando Heliroute ArmA
« Reply #18 on: 06 Feb 2008, 05:19:53 »
I can't figure out these instructions. What do I put where, how, when, etc. in order to add this script to the SP mission I am making. The example mission doesn't help me a bit. Can some give me a quick step by step.... Let's Keep it simple.

If I want to make the only heli in my SP mission use Mando Heli Route, what do I do? I want to have the HWM Huey I placed in the editor be able to use this script, so I can tell one of my 3 ai teammates get in the Huey as pilot and take us where ever I damn well please, accurately??

I'm still a rookie mission maker but these instructions are so damn confusing. I've tried to ask Mandoble multiple times to explain how I use this and he blew me off. Someone please help out if you can. Thanks in advance


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: (Accepted) Mando Heliroute ArmA
« Reply #19 on: 06 Feb 2008, 10:52:38 »
The current script header with the instructions:
Code: [Select]
/*********************************
 mando_heliroute_arma.sqf v1.2
 August 2007 Mandoble
 
 Moves a chopper accurately to the desired destination point following the indicated route and land it if so indicated.

 Execute it there were the chopper is local.

 Syntax:
[chopper, route positions array, flying height, landing true/fasle] execVM "mando_heliroute_arma.sqf"

Route positions array is an array of at least one position that defines the route the chopper will follow.
Once it reaches the final destination it will land if landing parameter is set to true.

When the route is completed, the chopper will set its internal mando_heliroute variable to "waiting".
While the chopper is executing the route that variable is set to "busy" and, if the chopper is damaged or the pilot is killed, the variable is set to "damaged".

If you want to check when the route has been completed, you may do it this way:

Sleep 2;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};
if (heli1 getVariable "mando_heliroute" == "damaged") then
{
   hint "Chopper damaged or pilot dead, not available for more routes.";
}
else
{
   if (heli1 getVariable "mando_heliroute" == "waiting") then
   {
      hint "Chopper waiting for a new route.";
   };
};
**********************************/

Demo example init.sqf with first route
Code: [Select]
_scr = [heli1,[getPos dest1],50, true]execVM"mando_heliroute_arma.sqf";
Sleep 1;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};

In the previous case, heli1 chopper will fly from its current position to postion of dest1 (which is a gamelogic placed on the map), keeping a flying height of 50m and will land once the destination is reached.

The script updates a vehicle internal variable named "mando_heliroute". When this variable is different than "busy", the current route has been accomplished and the chopper is free to proceed with a new route.

Which parts are still unclear for you?

Offline Manzilla

  • Members
  • *
Re: (Accepted) Mando Heliroute ArmA
« Reply #20 on: 06 Feb 2008, 21:16:08 »
Not really any of that. For a mission making/editing noob none of that means a damn thing. What do I put on the map? What do I type and where in the gamelogic? Do I need to put anything in the Uh-1 parameters in the editor?

As I've said, I've never tried this shit in depth so a very basic tutorial would be useful. Like the one page quick setup guide that comes with DAC v2. Or like WolfRug has in his 1st post for RUG_BodyArmorv1.1.

You have know idea how useful it is for noob editors to have a quick walk-through accompanying the Scripts. Forgive my lack of knowledge, I'm just trying to learn how to use your scripts. Also to learn how to make my own missions, or edit others for my own use.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: (Accepted) Mando Heliroute ArmA
« Reply #21 on: 06 Feb 2008, 21:56:16 »
What do I put on the map?
A chopper with a name and markers or gamelogics to indicate route positions (the positions of these are what you need to use for the second argument of the script).

What do I type and where in the gamelogic?
None.

Do I need to put anything in the Uh-1 parameters in the editor?
None except the name, you may use markers too.

When you want that chopper to initiate a route, execute the script, that's all.
Code: [Select]
[myuh60, [getMarkerPos "mk_1",getMarkerPos "mk_2"], 40, true]execVM"mando_heliroute_arma.sqf"
Obviously I will not add with each script any manual explaining what is an array, marker, gamelogic, or how to execute scritps. You will find tutorials covering these as well as the COMREF for data types and script execution.

Offline Manzilla

  • Members
  • *
Re: (Accepted) Mando Heliroute ArmA
« Reply #22 on: 06 Feb 2008, 22:15:11 »
That's all I needed. I get it now. Thanks

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: (Accepted) Mando Heliroute ArmA
« Reply #23 on: 06 Feb 2008, 22:23:56 »
To let your teammates take you "wherever damn well you please" you can try something like this:


Create a trigger, which is activated Repeatedly.

Condition: ((expectedDestination huey1) select 0) != OldHueyDest
On Activation: logic1 setPos ((expectedDestination huey1) select 0); [huey1, [getpos logic1], 50, true] execVM "Mando_heliroute_arma.sqf"; OldHueyDest = ((expectedDestination huey1) select 0);

Somewhere (for instance in the initialization field of huey1) you should put something like: OldHueyDest = [0, 0, 0]
That way that global variable is also determined. :) The above is entirely untested, but -should- make it so that if an AI is in control of the chopper, and you give it an order to fly somewhere, the script should kick in and control huey1 to the location (and land).

 :good: G'luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Manzilla

  • Members
  • *
Re: (Accepted) Mando Heliroute ArmA
« Reply #24 on: 06 Feb 2008, 22:27:07 »

Awesome, I'm trying this out right now. Thanks a lot Wolfrug.
« Last Edit: 06 Feb 2008, 22:35:35 by Manzilla »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: (Accepted) Mando Heliroute ArmA
« Reply #25 on: 06 Feb 2008, 22:34:19 »
No need to quote the post in most cases, especially if you're replying directly to it with no replies in between ;)

Just a note: there needs to be a Game Logic unit (or equivalent) named "Logic1" someplace on the map for the above to work too, of course :D

Do tell if it works - not sure how much we're supposed to clutter up Mando's thread though.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Manzilla

  • Members
  • *
Re: (Accepted) Mando Heliroute ArmA
« Reply #26 on: 06 Feb 2008, 22:36:36 »
Sorry. Didn't mean to hit Quote. I'm not sure why I hit it this time. previous post modified.

Offline CharlieReddog

  • Members
  • *
Re: (Accepted) Mando Heliroute ArmA
« Reply #27 on: 07 Feb 2008, 22:24:34 »
I'm just getting back into scripting and ArmA now I have a rig worth playing the game on.  :good:

I have a script running from a radio trigger which prompts me for onmap click and repositions a marker where I clicked. I then use another radio trigger to run the following line
Code: [Select]
scr = [chop1,[getmarkerpos "pos"],50, true]execVM"mando_heliroute_arma.sqf";
This works fine, but it's likely that because the mission I'm working on is completely free flowing and there are multiple DAC spawned zones, I'm going to end up flying into an area I don't want to, or want to get out of fast.

I used to use Robino's chopscript which would allow interrupts during the flight to reposition or react to unseen threats. Is it possible to break into the "busy" state, and recalculate the flight path?

Cheers for this work, it's unbelievably good, just needs a couple of tweaks for my purposes.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: (Accepted) Mando Heliroute ArmA
« Reply #28 on: 07 Feb 2008, 22:36:16 »
That's a good idea. I'll try to implement this or the next weekend. What you will not be able to interrupt, except by destruction of the chopper, is the landing sequence.

Offline CharlieReddog

  • Members
  • *
Re: (Accepted) Mando Heliroute ArmA
« Reply #29 on: 07 Feb 2008, 23:20:28 »
I figured as much myself looking at the code but I'm not familiar with SQF yet.

Is there a way to speed up the landing? Personally, I'm not that fussed about "on the button" landings, as long as it's in the ball park +/-5 mtrs for example. Robino's chop script was a little faster at the landings, but his method of stopping involved the chopper sometimes bunny hopping across the screen :o.

One other thing I noticed and I'm not sure whether its a function of the way I'm running it, is just before it goes to land, it starts to flare out, and then suddenly looks like the script forces it to be level and flying much slower? Does that sound right? It looks a bit odd but it's infinitely better than what I had in OFP with Robino's stuff.