Jump to content
cdn_limey

Spawn plane in flight using markers.

Recommended Posts

Hello Arma coommunity.

 

Was wondering if anyone knew of a script that would spawn 2 planes flying in formation from a marker placed on the map, to fly to another marker and then delete both the planes and the crew, then repeat the process every 10 minutes.

 

I`am putting together a mission and need a sort of continuous air flyby every 10 mins or so to buzz the area.

 

Thanks in advance

Share this post


Link to post
Share on other sites
9 minutes ago, cdn_limey said:

Hello Arma coommunity.

 

Was wondering if anyone knew of a script that would spawn 2 planes flying in formation from a marker placed on the map, to fly to another marker and then delete both the planes and the crew, then repeat the process every 10 minutes.

 

I`am putting together a mission and need a sort of continuous air flyby every 10 mins or so to buzz the area.

 

Thanks in advance

 

That's pretty easy, spawn a pilot then a plane in "FLY" state at the marker and move the pilot into it. Then give it the command move so it would fly to the next marker then on arrival kill the pilots and delete them as well as the plane. Easy

Share this post


Link to post
Share on other sites
Just now, cdn_limey said:

and how would you repeat that every 10 mins

 

 

put the script in a while{true} loop with a sleep 600 at the end.

Share this post


Link to post
Share on other sites
42 minutes ago, Grumpy Old Man said:

Check out BIS_fnc_ambientFlyby.

 

Cheers

 

Look at that, there is already a ready made function. Well gotta finish my mission file quick so I can start studying the rest.

  • Like 1

Share this post


Link to post
Share on other sites

Ok i have this in a game logic and works great, but how would i add the 600 loop to it for it to be continuous.

 

[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby; [[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;

 

Share this post


Link to post
Share on other sites
2 minutes ago, cdn_limey said:

Ok i have this in a game logic and works great, but how would i add the 600 loop to it for it to be continuous.

 

[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby; [[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;

 

3
while {true}{
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;

sleep 600;
};

 

Share this post


Link to post
Share on other sites

Just put that into the game logic and it throws an error

 

missing ;

Share this post


Link to post
Share on other sites

BK was missing a "do":

while {true} do {
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
sleep 600;
};

Out of good practice it's best to have full control over the loop:

TAG_flyBy = true;
TAG_flyByPause = false;

while {TAG_flyBy} do {

waitUntil {!TAG_flyByPause};
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
sleep 600;

};

This way you can pause planes from spawning when setting TAG_flyByPause to true, and completely exit the loop setting TAG_flyBy to false.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
11 hours ago, Grumpy Old Man said:

BK was missing a "do":


while {true} do {
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
sleep 600;
};

Out of good practice it's best to have full control over the loop:


TAG_flyBy = true;
TAG_flyByPause = false;

while {TAG_flyBy} do {

waitUntil {!TAG_flyByPause};
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
sleep 600;

};

This way you can pause planes from spawning when setting TAG_flyByPause to true, and completely exit the loop setting TAG_flyBy to false.

 

Cheers

 

ooooh for fucks sake. Cant i ever do something right?

 

Thanks Grumpy, again

  • Like 1

Share this post


Link to post
Share on other sites

Just tried both ways, and it comes up with a generic error message and freezes the game

 

[#] sleep 600;

 

};

 

 

As you can most proberly tell i am no good at this kind of thing

  • Like 1

Share this post


Link to post
Share on other sites

How did you execute it?

You'd need to spawn it:

TAG_flyBy = true;
TAG_flyByPause = false;

GOM_fnc_ambientAirLoop = {

	while {TAG_flyBy} do {

		waitUntil {!TAG_flyByPause};
	
		[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
		[[1585.55,7832.58,-185.97],[21257,20780,-37.453],140,"NORMAL","B_Plane_CAS_01_F",WEST] call BIS_fnc_ambientFlyby;
		
		_sleep = time + 600;

		waitUntil {time > _sleep OR !TAG_flyByPause OR !TAG_flyBy};

	};

};

_loop = [] spawn GOM_fnc_ambientAirLoop

 

Cheers

Share this post


Link to post
Share on other sites

I got this to work now thanks guys, was something i did my end that messed it up

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

×