OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Mandoble on 26 Aug 2007, 01:15:33

Title: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 26 Aug 2007, 01:15:33
In case you need long range chopper trips and accurate landings anywhere whitout using any invisible or visible helipads  ;)

Mando Heliroute ArmA (http://www.ofpec.com/ed_depot/index.php?action=details&id=389)

What probles does solve this script?
- If you give a destination really far away, ArmA engine stalls trying to solve the path and the chooper will refuse to move.
- If you order a chopper to land at destination, it will land anywhere except where you want it to land, much less on building roofs or between streets.

EDIT: Updated to v1.1
- The chopper dont wait till rotor is completely stopped before ending the script now.

EDIT: Updated to v1.2
- The chopper will stay where indicated even after assigning soldiers to it as cargo. The chopper will not try to move to pick them up and will stay in its current position waiting for the cargo.
- The script now stores the route states into an internal vehicle variable name mando_heliroute with the following possible values: "busy" (the chopper is executing the route), "damaged" (chopper damaged or pilot dead, the route is finished) and "waiting" (the route is finished and the chopper is ready for new routes).
- Added more instructions to the script header.
Title: Re: Mando Heliroute ArmA
Post by: ARMAVIDZ on 26 Aug 2007, 02:41:25
 :clap: :clap: :clap: :clap: OMG that was fast!

Checkin it out right now! Thank you!
-----------------------------------
Edit:
Works like a charm!!! The chopper lands in the tightest spots! Even high up on un-even terrain! That's awesome Mandoble! Expect to see it in the movies I do!!! Very much appreciated! :cool2:

I noticed when you place the dest game logics on some items like the water tower (  ::) I had to lol ) I think the modeltoWorld doesn't include the pointy tip of the tower LOL!

I have two questions:
1. [heli1,[getPos dest2],50, true]execVM"mando_heliroute_arma.sqf"; - Is the '50' in the string the speed?
2. Not complaining in the least: Do you think there might be a way to get Soldier1 to board the chopper faster?

Edit#2
Sorry about the double-post. Still new to these forums and never seen the 'remove' button before. It's fixed now  :good: That's so awesome Mandoble, thank you!!! I'll give it another wirl!
Title: Re: Mando Heliroute ArmA
Post by: Mandoble on 26 Aug 2007, 11:38:35
Please, dont double post.

50 is the desired flying height along the route, you may check the parameters meanings in the header of the script.
I modified the script so it doesnt wait till rotor is completely stopped now, new version ready at first post. So the soldier will board the chopper much faster  ;)
Title: Re: Mando Heliroute ArmA
Post by: Willus_Killus on 28 Aug 2007, 11:47:21
we love u mando!  :clap:
Title: Re: Mando Heliroute ArmA
Post by: MattiusRochelle on 30 Aug 2007, 15:43:53
Mando this is great too  :D

Could you also convert your "Ghost Scripts" from the forest mission to ArmA as i want to spook people in my upcoming night mission  :scratch: just wondering if you could do it?
Title: Re: Mando Heliroute ArmA
Post by: Mr.Peanut on 30 Aug 2007, 15:53:23
Mando is away on holiday for awhile.
Title: Re: Mando Heliroute ArmA
Post by: MattiusRochelle on 30 Aug 2007, 16:34:51
doh.  >:(

I guess i will try all my tricks in the box to get it too work.
Title: Re: Mando Heliroute ArmA
Post by: Mandoble on 01 Sep 2007, 00:48:37
Updated to v1.2
- The chopper will stay where indicated even after assigning soldiers to it as cargo. The chopper will not try to move to pick them up and will stay in its current position waiting for the cargo.
- The script now stores the route states into an internal vehicle variable name mando_heliroute with the following possible values: "busy" (the chopper is executing the route), "damaged" (chopper damaged or pilot dead, the route is finished) and "waiting" (the route is finished and the chopper is ready for new routes).
- Added more instructions to the script header.
Title: Re: Mando Heliroute ArmA
Post by: JasonO on 01 Sep 2007, 12:20:48
Thanks Mandoble this is superb. Also, hope you enjoyed your holiday.  :good:
Title: Re: Mando Heliroute ArmA
Post by: MattiusRochelle on 01 Sep 2007, 20:13:18
Wow very nice stuff, your like my scripting god  :clap: :good:
Title: Re: Mando Heliroute ArmA
Post by: Mandoble on 01 Sep 2007, 21:25:46
hahha your scripting God is creating some ghosts for you now  ;)
Title: Re: Mando Heliroute ArmA
Post by: MattiusRochelle on 05 Sep 2007, 12:54:36
hahha your scripting God is creating some ghosts for you now  ;)

Thats got to be the best news ive ever heard. My mission will be scary for the players..

The mission is going to have a haunted woods, while the main objective is some arty posts, the russians seem on edge and at the end you discover the reason why.. its a great mission these scripts will finalise it :P  :D
Title: Re: Mando Heliroute ArmA
Post by: Zarele on 07 Sep 2007, 21:56:20
Well i loved you other scrips so i'm  gone love this one, if i can dowload it. Is the link broken or am i doing something wrong? I keep getting transferd to the ofpec index.
Title: Re: Mando Heliroute ArmA
Post by: Mandoble on 07 Sep 2007, 22:21:40
it works well for me, just click over  mando_heliroute_v1_2.Sara.zip and you should get it.
Title: Re: Mando Heliroute ArmA
Post by: Zarele on 08 Sep 2007, 00:07:10
then it must be me. I get transferd to the homepage, and if i follow a link from you i get the script for ofp but its 0kb. Damn you infurnal internet
Title: Re: Mando Heliroute ArmA
Post by: Mandoble on 08 Sep 2007, 00:27:19
removed old link
Title: Re: Mando Heliroute ArmA
Post by: Zarele 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?

Title: Re: Mando Heliroute ArmA
Post by: Mandoble 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  ;)
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Manzilla 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

Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble 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?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Manzilla 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Manzilla on 06 Feb 2008, 22:15:11
That's all I needed. I get it now. Thanks
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Wolfrug 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Manzilla on 06 Feb 2008, 22:27:07

Awesome, I'm trying this out right now. Thanks a lot Wolfrug.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Wolfrug 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Manzilla 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: CharlieReddog 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: CharlieReddog 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.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 07 Feb 2008, 23:32:21
Personally, I'm not that fussed about "on the button" landings, as long as it's in the ball park +/-5 mtrs for example.

But I am. This script is just and only for quite accurate landings, anything else can be solved with dynamic waypoints and moving invisible helipads.

Title: Re: (Accepted) Mando Heliroute ArmA
Post by: trooper.ryan on 26 Feb 2008, 07:22:21
I've got a weird bug(?) going on that has me stumped.

heli1 will fly over the gamelogic "dest1" and continue on heading for 3 grids.  Then it will very slowly turn back and slowly fly back and land on the marker.

Any ideas what could be causing this behaviour?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 26 Feb 2008, 07:45:48
Has heli1 got into combat mode, see the enemy or things like that?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: trooper.ryan on 26 Feb 2008, 09:36:55
Yup, it goes into combat mode.  Could I insert _heli setbehaviour "SAFE" into a loop somewhere to solve the problem?


EDIT:  Mostly solved by the below post, thanks!  Heli1 still flys past the LZ and takes a while to turn around, but now its only by a few hundred meters so the wait isnt as bad.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 26 Feb 2008, 10:58:49
You may add the following to the init field of the chopper:
Code: [Select]
this setCombatMode "BLUE";this setBehaviour "CARELESS"
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: sharkattack on 06 Apr 2008, 11:09:54
having problems with rooftop insertion

i have a mission set up which uses the script to insert a team onto hotel roof
it works a treat everytime ... untill we play on dedi server then  the chopper lands short of the logic
( at the point were normally the chopper begins its final approach ..)

obviously im doing something wrong ... here is how i have it set up ...

the chopper ( bh)  starts on the ground  with pilot on board 
it waits until all the player group (tm1) are onboard

trigger
condition
({_x in bh} count units tm1 == count units tm1)

then the script is executed

activation
nul= [] execVM "insert.sqf"

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

_scr = [bh,[getPos dest2],50, true]execVM"mando_heliroute_arma.sqf";
Sleep 2;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};

like i say works perfectly until hosted on dedicated server ..

any help  will be appreciated
a wonderfull script  :good:
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 06 Apr 2008, 11:46:22
Trigger's code is executed everywhere, so you are executing that insert.sqf script multiple times. Try adding the following to the beginning of the insert.sqf.

Code: [Select]
if (!local bh) exitWith {};
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: sharkattack on 06 Apr 2008, 13:06:05
will do mate
thanks  very much

edit
====

still landing short of logic marker on dedicated server     :(

edit2
====

works ok if i make the insertion a cutscence/intro  but this isnt how i want it set up

please help ... i love this  script ..top class

edit 3
====

attached a short demo  ... thanks  mandoble   :good:
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 08 Apr 2008, 00:58:03
In your demo the locality of the chopper changes during flight in a dedi server. This is an issue I'll try to solve.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: sharkattack on 08 Apr 2008, 19:25:19
many thanks mate  for your time .. :good:

looking forward to update
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Ironman on 19 May 2008, 02:27:15
This causes a "Error, Generic Error in Expression"

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

heli1 setVariable ["mando_heliroute", "free"];

I pretty much copied and past and this is ALWAYS the problem. My UH-60 is named heli1. and this code is in the init.sqs

Help would be much appreciated.

It still works the way I want it to. But, I do not want this dam error lol...
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 19 May 2008, 09:50:06
That is sqf code, not sqs, and you are running it into init.SQS, not init.SQF.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mille on 22 Jul 2008, 18:20:08
Mando what there is if I want to use two three helicopters then what it is necessary to write it init.sqf because he handles only one there.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 22 Jul 2008, 18:57:33
Each instance of the script takes care of a single chopper, but you may execute the script as many times as you want for different choppers. If you want to process them in parallel, I mean to check if the route is finished, etc, use the [] spawn {code} command and in the code block place the code to control the routes.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mille on 22 Jul 2008, 21:38:02
I say thank you for the fast answer Mandoble how I am not that trouble only a sqf master I do not know it the [] spawn {code} command if you would be able to write a sample down I say thanks for it.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 22 Jul 2008, 21:45:05
I mean the code that handles that single chopper in the demo may run in paralel, so you can execute more things in the init.sqf.
This is the code present in the demo:
Code: [Select]
titleText["Some soldiers are waiting for us inside Bagango stronghold", "PLAIN DOWN"];
[]spawn
{
   _scr = [heli1,[getPos dest1],50, true]execVM"mando_heliroute_arma.sqf";
   Sleep 1;
   waitUntil {heli1 getVariable "mando_heliroute" != "busy"};

   {_x assignAsCargo heli1} forEach units group soldier1;
   units group soldier1 orderGetIn true;
   waitUntil {{_x in heli1} count units group soldier1 == count units group soldier1};
   titleText["We'll bring them to Vallejos's hotel", "PLAIN DOWN"];

   _scr = [heli1,[getPos dest2],50, true]execVM"mando_heliroute_arma.sqf";
   Sleep 2;
   waitUntil {heli1 getVariable "mando_heliroute" != "busy"};

   {_x action ["GETOUT", heli1];unassignVehicle _x} forEach units group soldier1;
   Sleep 4;
   titleText["And now a long travel to Rahmadi", "PLAIN DOWN"];

   _scr = [heli1,[getPos dest3],50, true]execVM"mando_heliroute_arma.sqf";
   Sleep 2;
   waitUntil {heli1 getVariable "mando_heliroute" != "busy"};
   heli1 setVariable ["mando_heliroute", "free"];

   player action ["GETOUT", heli1];
   titleText["T H E   E N D ", "PLAIN"];
};

// Add here the code for a second chopper, if you do with spawn command you will be able to add more choppers below at will.

And dont forget to read what spawn (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=s#783) command does.

Now, if you have scripting questions, feel free to use the general editing and scripting forum to ask there.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mille on 23 Jul 2008, 06:06:51
I say thank you for it I start taking the help already now. :)
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Aplion on 07 Sep 2008, 17:12:35
Problem solved.

Sorry for the post.

Aplion
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Ironman on 18 Nov 2008, 21:21:23
Does the code have to be executed from the init.sqf?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 18 Nov 2008, 23:40:39
Not required, but init.sqf is always a good place to setup things like chopper routes.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Ironman on 22 Nov 2008, 10:23:16
on a dedi server I got a whaaa whaa about a local variable... any ideas?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 22 Nov 2008, 22:40:16
Probably you are executing the script there where the chopper is not local.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Ironman on 30 Nov 2008, 18:18:22
Hello again. So I am using this script on AVGANI. I have combatmode = Blue and setBehaviour = "careless" but the AI still want to land on the side of buildings and on a fence even though my choppers' markers are on the road to land. Would inserting a invisible H help them land on the road where they are suppose to?

The mission is in the MP beta/review board. It is called Desperate Defence.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 30 Nov 2008, 23:50:56
It is probably a locality problem, the script only takes fine control of the chopper when landing if the chopper is local where the script is executed.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Ironman on 01 Dec 2008, 06:13:03
I have gotten Spooners help on this matter before when they weren't localized a hint message appeared.... There is no hint msg now. They just simply do not land where I want them to. One chopper is off about 15m and the other about 7m. No errors on the dedi server log. No errors in game...


This is in the choppers init field:
heli1
Code: [Select]
if (local this) then { iron = [this] execVM "route1.sqf" }; this setBehaviour "Careless"; this setCombatMode "BLUE";
heli2
Code: [Select]
if (local this) then { iron = [this] execVM "route2.sqf" }; this setBehaviour "Careless"; this setCombatMode "BLUE";

If you download the mission and put it up on a dedi you will see this problem too... They land but not where I want them too which is on a street with buildings and walls close by it. When I run the mission on my local server they land exactly where I want them to.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 01 Dec 2008, 08:54:30
That means that the locality of the chopper is changing after the script is executed. Try to test the same scenary on SP, where the locality is always fixed.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Ironman on 01 Dec 2008, 20:13:03
Ok it works when there are no enemy around. But, if they are shot at they go beserk.... is there a way to force land them at that spot?

Also, if you can provide an example of what you are talking about with locality because obviously I showed you the scribbet of making it local. So, if there is something else you mean please provide an example.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 02 Dec 2008, 01:52:15
For the first problem, the chopper needs to reach a destination where the fine landing code takes control over it. If the chopper doesnt reach that destination because it is fleeing away or fighting, the accurate landing code is not executed.

About the locality, for example, if you start inside a chopper piloed by AI, the first second of the mission the chopper is local to the server, after this, the chopper is local to the player (cargo) inside.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Ironman on 02 Dec 2008, 06:05:05
this is a exfil that I am trying to do. Like in your demo I believe you has a soldier named "soldier1" and you made his whole group get in the little bird. This is what I am trying to accomplish.... with AI flying of course.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: VanhA on 10 Mar 2009, 13:37:20
Hello.
I've used this script before and I'm working on a small scale stealth mission to capture & escort an officer.
In this case I was wondering could I somehow add it as "onMapSingleClick" function so that clicking moves the desired game logic on players current position?
I've never used the mapclick before so I'm a bit unsure how to proceed... :whistle:

I need an Mi17 to come when I have chosen the location via radio/mapclick.
(I could use just synched waypoints and commands but I've found them unreliable in hostile territory + I prefer not to have waypoints for players)

VanhA
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 10 Mar 2009, 22:01:46
Of course you can, but this is more a general scripting question than one specifically related to the heliroute script. So, probably, the general scripting board is a better place to discuss about onmapsingleclick questions.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Shadow.D. ^BOB^ on 17 Apr 2009, 01:16:41
Hey Mandoble, you mentioned previously about the choppers not entering the "script execution" for fine landings once they spot an enemy or get fired upon.  Is there a way to force the chopper to enter the scripted, controlled state earlier?  Also where is the speed in which the scripted flight takes place.

Thanks.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Snake Man on 21 May 2009, 11:11:24
I have helicopter (VTE huey or BIS UH60 it wont make any difference) starting in air, has squad onboard with {_x moveincargo... and from the helos init line I run:
Code: [Select]
handle = [helo1,[getPos landingzone],100, true] execVM "mando_heliroute_arma.sqf";Where helo1 is the heloname, landingzone is a gamelogic named exactly like that.

When I start the mission in MP (local server for tests), helicopter starts to fly towards gamelogic landingzone with correct FlyInHeight and gets "Busy" variable. When it reaches the gamelogic... it just stays Busy and continues to fly without landing (this is where I usually stop my test run).

What did I do wrong?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 21 May 2009, 14:35:15
I suspect the locality of your chopper changes just a bit after the mission starts. So that when the script is executed the chopper is local to the server and few seconds later its locality changes to one of the players. This like that can break the control of the script, as the script requires to be executed there where the chopper is local and to have the chopper still local when the landing procesure starts.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Snake Man on 21 May 2009, 17:25:16
I'm MP newbie, learning at great rate though. But if I go to multiplayer menu, click NEW to create new server and run the mission there without any other players and I'm as server host are the only one boarded to the helo... aren't that local to me/init line then?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 21 May 2009, 18:15:38
It depends, if you create a server instance, and then you join the server, your PC is actually hosting two games, the server and the client with you as a player. Of course, this is true if you are instantiating a dedi server. When I've experienced the effect you are describing the reason has been always an "on-the-fly" locality change. In fact, if everything were local to you, then it should work exactly as if it were directly executed from the editor, and I assume you heliroute works well tested from the editor.

You can do the following in the init.sqf, just for testing:
Code: [Select]
// Your moveinCargo here, for example
Sleep 10;
if (local helo1) then
{
   handle = [helo1,[getPos landingzone],100, true] execVM "mando_heliroute_arma.sqf";

   while {true} do
   {
      if (!local helo1) then
      {
         helo1 setDamage 1;
      };
      Sleep 5;
   };
};

If the chopper gets destroyed it means the locality change is happening there.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Snake Man on 21 May 2009, 19:06:52
Helo wont get destroyed, so apparently it doesn't change the locality.
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 21 May 2009, 20:09:29
Then I have no idea, I assume you are using mando_heliroute_arma.sqf v1.3 and that everything works fine tested from the editor, right?
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Snake Man on 21 May 2009, 22:04:18
Uh no, its v1.2 and I even think I downloaded it from the ofpec link there. Did you mistype the version number one point THREE or?

Downloaded it from here which says 1.2 http://www.ofpec.com/ed_depot/index.php?action=details&id=389

And no for editor only too. I'll test it there next but I'm sure it works. I just cant figure out whats bugging in my MP setup :)
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Mandoble on 22 May 2009, 00:09:25
 :blink: You are right, public version seems to be 1.2 while mine is 1.3  :scratch:
Anyway 1.2 was working fine, now I need to find out what's new in my 1.3  :D
Title: Re: (Accepted) Mando Heliroute ArmA
Post by: Snake Man on 22 May 2009, 01:44:44
I did the exact same server test on the default mission found in the release zip, it works just fine. So dunno really what was bugging in my mission.