Jump to content
ClimberBill

Two Helis takeoff after loaded, not working on Dedicated Server

Recommended Posts

I know that this has been asked before and I have tried everything that I found. My problem is that I'm not using waypoints, I'm using the unitplay for my flight path. I don't want to use a radio activation. I want to use the Condition field of a trigger or task. 

This is the code I have in Condition.

{_x in H1} count (units group player) == {alive _x} count (units group player);

This works when testing in editor both in SP & MP, but does not work on the dedicated server. What happens is the takeoff without waiting to be loaded. I have also tried....

if (isServer) then
{
{_x in H1} count (units group player) == {alive _x} count (units group player);
};

When using the (isServer) they don't take off but when I get on the chopper it does not activate. 

Let me also add that I"m using two choppers and need to wait till both choppers are loaded before they can takeoff. For this I have a trigger for each chopper with the above code. Then I have another trigger with this code in the Condition...

triggerActivated H1Loaded && triggerActivated H2Loaded && triggerActivated EngineStart;

The EngineStart trigger is activated as the players move to the chopper. I then have two more triggers for the sqf's that have the flight path info. 


Again this all works in SP & MP it the editor but DOES NOT work on the dedicated server. Any help would be great, thanks in advance.

Share this post


Link to post
Share on other sites

Player on dedicated is objNull.

 

Edit: too late

Edited by Lucullus
  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, ClimberBill said:

 That is good info and I thank you, but do you have a fix that will make this work.

maybe ...

 

not tested:

_index = thisList findIf {isPlayer _x};
if(_index < 0) then {false} else 
{
 _player = thisList select _index;
 {_x in H1} count (units group _player) == {alive _x} count (units group _player)
};

EDIT: correction for player not in thisList added 

  • Like 1

Share this post


Link to post
Share on other sites
20 minutes ago, sarogahtyp said:

maybe ...

 

not tested:


_index = thisList findIf {isPlayer _x};
if(_index < 0) then {false} else 
{
 _player = thisList select _index;
 {_x in H1} count (units group _player) == {alive _x} count (units group _player)
};

EDIT: correction for player not in thisList added 

I tested the first post you had before you edited it and that did not work.  The trigger did not fire.  I will test your edit version and see if that works.

 

Share this post


Link to post
Share on other sites
43 minutes ago, sarogahtyp said:

maybe ...

 

not tested:


_index = thisList findIf {isPlayer _x};
if(_index < 0) then {false} else 
{
 _player = thisList select _index;
 {_x in H1} count (units group _player) == {alive _x} count (units group _player)
};

EDIT: correction for player not in thisList added 

I tried the edited version and still does not fire the trigger.  

This is what I have in the Condition Field of the trigger:
 

_index = thisList findIf {isPlayer _x};
if(_index < 0) then {false} else
{
_player = thisList select _index;
{_x in H1} count (units group _player) == {alive _x} count (units group _player);
};

Plus I have a Hint to let me know if the trigger fired. The hint is not coming up and when I check the debug console the trigger is false.

Share this post


Link to post
Share on other sites

any error in .rpt file? I can't see a mistake actually.

Share this post


Link to post
Share on other sites
7 minutes ago, sarogahtyp said:

any error in .rpt file? I can't see a mistake actually.

No errors that I can find.

Share this post


Link to post
Share on other sites

Give your playable units a variable name such as: P01.
Replace "player" with the "P01" and you have the solution.
The server doesn´t know player but P01.

{_x in H1} count (units group P01) == {alive _x} count (units group P01);

Player is a command that points to an object and works only on clients or client-server, not on dedicated-server.

 

It would be better to give the different groups a name, for example: G01.

 

Edit: ... and welcome to the Arma MP Universe, there are a lot of stumbling blocks left ...

Edited by Lucullus
  • Thanks 1

Share this post


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

Give your playable units a variable name such as: P01.
Replace "player" with the "P01" and you have the solution.
The server doesn´t know player but P01.


{_x in H1} count (units group P01) == {alive _x} count (units group P01);

Player is a command that points to an object and works only on clients or client-server, not on dedicated-server.

 

It would be better to give the different groups a name, for example: G01.

 

I will give it a try and let you know if it works.  I have already given the groups names as well as the players.

 

Share this post


Link to post
Share on other sites

Using the variable name for the player worked, thanks for the help. I will need to test this with other players on the server to see if it will still work and not just trigger with the leader. I'm hoping that the chopper waits till all units of the group are loaded before taking off.

 

I also tried naming the group first and it did not work, It might be that I was the only player on the server.

Share this post


Link to post
Share on other sites

Several played groups?
Are you waiting for 2 played groups in helo or the first one on board? In MP, what is your goal?

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

Several played groups?
Are you waiting for 2 played groups in helo or the first one on board? In MP, what is your goal?

The idea that Lucullus had with giving the player a variable name and use that in the place of Player worked.

 

{_x in H1} count (units group P01) == {alive _x} count (units group P01);

 

To answer your question, this is the scenario.

 

After the briefing, the players will head to the choppers for ingress to the LZ.  There are three groups, (VittlesLead, Vittles1, Vittles2) VittlesLead and Vittles1 will get on H1 and Vittles2 will get on H2.  After they board the choppers then the sqf's are called with execVM "XXXX.sqf" in the OnAct Field of the a trigger.  The choppers are not using waypoints put calling an sqf with the flight path using unitCapture.

 

I have four triggers; EngineStart, H1Loaded, H2Loaded, and H1H2TO.  The EngineStart trigger does just that starts the engines as when the players run through the area trigger on their way to the chopper.

 

Trigger H1Loaded has this code in the Con Field  

{_x in H1} count (units group Vittles1) == {alive _x} count (units group Vittles1);

Trigger H2Loaded has this code in the Con Field

{_x in H2} count (units group Vittles2) == {alive _x} count (units group Vittles2);

Trigger H1H2TO has this code in the Con Field

triggerActivated H1Loaded && triggerActivated H2Loaded && triggerActivated EngineStart;

Trigger H1H2TO has this in the OnAct Field

execVM "wp1.sqf";
execVM "wp2.sqf";

The above code is working as of now with just one player on the server.  I still need to test with more players and will update after doing so.

 

I hope this is enough info for you and answers your question.

Share this post


Link to post
Share on other sites

So, no JIP? all players are present at start? AI units on groups?

Share this post


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

So, no JIP? all players are present at start? AI units on groups?

Yes no JIP and no AI in groups.

Share this post


Link to post
Share on other sites

so you just have to check:

count allPlayers > 0 && ({alive _x} count allPlayers == {alive _x and {_x in H1 or _x in H2}} count allPlayers)

 

 

  • Thanks 1

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

×