Jump to content
Sign in to follow this  
RomanLord

Mission that ends after 1 minute in MP.. but in SP it works fine.. HELP!

Recommended Posts

Hello all

finnaly I got to create my first mission.

Basically I have 4 mandatory tasks to complete before ending the mission. The 5th is not mandatory.

I used some triggers to have, when all the tasks are completed, a radio chat with custom sound, a nuke explosion, a camera script and then the end with debriefing.

The problem is that in SP or hosted in MP on my computer, it works fine.

As soon I put the mission on a dedicated server, every time it ends after about 60 seconds, showing the debriefing.

I suppose is a problem of global/public variables but I cannot figure how to solve this.

I put here the triggers that I have in theri "execution" order, hope you can help.

First trigger:

Activation: None - One time - Present

Type: None

Condition:

obj_0 && obj_1 && obj_2 && obj_3 && obj_4;

On Activation:

logicaradio globalChat "HQ: Victor, this is HQ. Good job you accomplished your mission, but our satellites just spotted what can be a missile launch directed on our outpost. You have to evacuate immediately. Out"; playSound "Dialogo10"; finale_music = true; publicVariable "finale_music";

------------------------------------------------------------------------------------------------

Second trigger:

Activation: None - One time - Present

Type: None

Condition:

finale_music;

On Activation:

playMusic "Harvest_Red"; 1 fadeMusic 1; nukelaunch1 = true; publicVariable "nukelaunch1";

------------------------------------------------------------------------------------------------

Third trigger:

Activation: None - One time - Present

Type: None

Timer: 10 seconds (elapsed time)

Condition:

obj_0 && obj_1 && obj_2 && obj_3 && obj_4 && nukelaunch1;

On Activation:

[] exec "nuke\nukelaunch.sqs"; player say "incoming";finale_camera = true; publicVariable "finale_camera";

------------------------------------------------------------------------------------------------

Forth trigger:

Activation: None - One time - Present

Type: None

Timer: 10 seconds (elapsed time)

Condition:

finale_camera;

On Activation:

finemissione = true; publicVariable "finemissione"; []exec "outro.sqs";

------------------------------------------------------------------------------------------------

Fifth trigger:

Activation: None - One time - Present

Type: END1

Timer: 20 seconds (elapsed time)

Condition:

obj_0 && obj_1 && obj_2 && obj_3 && obj_4 && finemissione;

On Activation:

endMission "END1";

------------------------------------------------------------------------------------------------

My init.sqf

waitUntil {!isNull player};
waitUntil {player == player};

sleep 0.5;

"area1" setMarkerAlpha 0;
"area3" setMarkerAlpha 0;
"area4" setMarkerAlpha 0;
"Kinsella" setMarkerAlpha 0;
ACE_NoStaminaEffects = true;

[] execVM "briefing.sqf";
sleep 0.1;

//Initialise revive script (this next line is needed for revive script)
server execVM "revive_init.sqf";

sleep 0.5;

call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";

Where I'm wrong? Hope you can solve this out... I'm really disappointed to have invested so much time in this mission and now it works really fine in SP or on my hosted server, but not on dedicated one...

If you want here is the downloadable PBO...

http://www.alphaweb.it/Priceless%20Life.isladuala.zip

Edited by RomanLord

Share this post


Link to post
Share on other sites

Do you ever specifically initialize obj_0 and friends as 'false' when the game is starting? I don't see why it should make any difference in SP/MP but it might be worth making sure that any variables you are using are defined on every computer they might be referenced on.

Are there any scripts where you're checking whether the computer it's running on is the server or not?

server execVM "revive_init.sqf";

What is this supposed to do? The community wiki has no entry for "server". Is this something you're defining elsewhere? If this code is supposed to run on the server, I'm not sure it will since the init is waiting for player to become active which AFAIK will never happen on a dedicated server (player is always null?).

So that might be something else to look into -- whether a needed script is waiting for/expecting "player" to exist?

Share this post


Link to post
Share on other sites
Do you ever specifically initialize obj_0 and friends as 'false' when the game is starting?

First of all, thanks for your reply

About intializing the obj_0 and others: no. There is a way I have to do it or I simply wrote obj_0=false and so on in the init.sqf?

(as I said is my first mission)

Are there any scripts where you're checking whether the computer it's running on is the server or not?

What you means? What I have to check?

What is this supposed to do? The community wiki has no entry for "server". Is this something you're defining elsewhere? If this code is supposed to run on the server, I'm not sure it will since the init is waiting for player to become active which AFAIK will never happen on a dedicated server (player is always null?).

This is the call to the Norrin's Revive Script. In this case "Server" is the name of a GameLogic on the map, as specified in the norrin script.

Share this post


Link to post
Share on other sites

(obj_0) && (obj_1) && (obj_2) && (obj_3) && (obj_4) && (finemissione);

Tried that formatting? Parenthesis occasionally fix things. And btw unless you're testing in MP editor you will not experience end sequences etc.

And as Roman said, place a game logic on the map and name it "Server". Also place the REQUIRE CBA game logic down for good measure.

Edited by rexehuk

Share this post


Link to post
Share on other sites
(obj_0) && (obj_1) && (obj_2) && (obj_3) && (obj_4) && (finemissione);

Tried that formatting? Parenthesis occasionally fix things. And btw unless you're testing in MP editor you will not experience end sequences etc.

And as Roman said, place a game logic on the map and name it "Server". Also place the REQUIRE CBA game logic down for good measure.

I did what you said, (parenthesis and require_cba gamelogic) and now seems to work :yay:

would be nice to know "WHY"...

Thanks for all! After completing it and testing it with my team mates, I will give this mission out to anyone wants to play it :D

Share this post


Link to post
Share on other sites

Different parts of the game run on different computers in MP. This page on the wiki has a pretty concise listing: http://community.bistudio.com/wiki/Locality_in_Multiplayer

I'm guessing that some part of your script is either not being run at all by the server, or is running somewhere it somehow doesn't have a "correct" view of the world. e.g. I don't think the code in your init script is ever run server-side, because it'll be waiting forever for "player" to be defined (since there's no "player" on a dedicated server).

Similarly the code which tells the AI what to do will probably have no effect when run on the other client machines, since AI-lead squads are only local to the server. But it varies by command and on the wiki you'll see most commands have icons indicating whether they work on only local or all objects, and whether the result of the command is broadcast over the network.

If nothing stands out as being a possible culprit, it might be worthwhile creating a simple subset of your mission to test that things work how you're expecting, i.e. triggers are properly activated and so on.

For initialising variables, yes the init script is fine. Normally it shouldn't matter since an undefined variable will generally be interpreted as "false" any time you try to reference it, but it never hurts to be sure.

Does the way the mission ends give you any clues? Is it playing the whole sequence or going straight to the briefing? Might give some idea...

How are obj_1 and friends set to true? Perhaps they're being triggered prematurely.

Share this post


Link to post
Share on other sites

Glad to hear it worked... Nice to know I'm still on the ball after 72 hours without sleep :bounce3:

As for the "Why", I have no answer other than the way the Arma 2 engine must handle such a statement.

Share this post


Link to post
Share on other sites

Strange... maybe because they're uninitialised and putting them in ()'s causes it to evaluate it in a different way? I'm really surprised that that's the fix for it. (Did you test independently if it was the require CBA gamelogic that fixed it?)

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
Sign in to follow this  

×