Jump to content
RotaMafia

how do i get a chopper to wait untill it has been fully loaded before take off?..

Recommended Posts

Hello c",)

 

first of love this forum, it has really helped me a lot ! :don13:  . . .

well over to my first post in here. Or this is more of a question;

 

how do i get a chopper to wait untill it has been fully loaded before take off?..

"i meen not like if player is in, or if a spesific group is in. I only want a line to make the chopper wait untill every seat is full, or no more space in cargo."

 

Maybe somthing like: waitUntil {heli is full} AND {!isNull player}; or waitUntil {heli fullcargo} AND {!isNull player}; 

 

Please help me you see i have made a mission where you must contact, rescue and finally load rescued civilian units on to a waiting chopper.

"i started with a dream to count the rescued units onboard the heli, and then give score fore each. But seeing as this was a bit over my skill level i choose to have it only take of when fully loaded and the give a static score.

I am using simple shop by HoverGuy i was hoping to give money for each rescued civilian loaded."

 

Hope you are the right person to help me, i have really searched everywhere :down: . . .

Best regards RotaMafia.:don11:

 

Share this post


Link to post
Share on other sites
waitUntil{ { isNull ( _x select 0 ) }count fullCrew[ heli, "cargo", true ] isEqualTo 0 };

Wait until none of the cargo seats are null (_x select 0 (the object occupying the seat) is objNull if it is not occupied).

 

50 minutes ago, RotaMafia said:

i started with a dream to count the rescued units onboard the heli

Roughly the same

_numRescuedCivs = { !isNull ( _x select 0 ) && { side ( _x select 0 ) isEqualTo civilian } }count fullCrew[ heli, "cargo", true ];

Count all cargo spots in the heli that are not null and the occupant is side civilian.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you @Larrow, You are a true legendc", )

The Commands works like a charm ! :don12: have really struggled with this one, True Newbie :)

 

Since i am on the topic of being a newbie at scripting, how would i go about getting these lines: 

 [50,0] call HG_fnc_addOrSubCash; AND [25,0] call HG_fnc_addOrSubXP;  to run for each _numRescuedCivs? :dontgetit:

 

Also seeing as I am on a roll, of questions.. Are there a easy why do display how many that was rescued to the player/players?... 

- If this was too many questions, thats no problem :f: You have helped me plenty already ! :don15: Thanx Again, RotaMafia c", )

 

Share this post


Link to post
Share on other sites

Use a forEach loop.

https://community.bistudio.com/wiki/forEach

{
	[50, 0] call HG_fnc_addOrSubCash;
	[25, 0] call HG_fnc_addOrSubXP;
} forEach (fullCrew [heli, "cargo", true]);

I'm not sure what those functions look like... Maybe you will need to pass the unit to them? In that case, something like:

{
	[_x, 50, 0] call HG_fnc_addOrSubCash;
	[_x, 25, 0] call HG_fnc_addOrSubXP;
} forEach (fullCrew [heli, "cargo", true]);

You'll need to modify your function though, unless it already has that. Inside the function, use the passed unit when adding XP/cash.

  • Like 1

Share this post


Link to post
Share on other sites

Woww !  # Why i Love Bohemia, Arma 3 and its community.... :don13:

 

Thanx @HazJc", )

 

{ [50, 0] call HG_fnc_addOrSubCash; [25, 0] call HG_fnc_addOrSubXP; } forEach (fullCrew [heli, "cargo", true]); 

 

Works perfectly ! :don16:

 

With Larrow and your help this become even better then i thought ! :drinking2: 

 

Much more then a game, this is a full-blown hobby :don8:

Can't wait till Laws of War, bet it will be perfect with this play goal, in different ways ! :don13:

Thank you both, so many nights i have wished i knew some one how also enjoy this, and maybe could help me, with just a push in the right direction :dontgetit: Recommend all stuck i the same position, just ask ! :exclamation: 

This is clearly a very helpfull and friendly community ! :f: 

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

×