Jump to content
_SCAR

addMissionEventHandler not fired on dedicated server

Recommended Posts

The following:

private _eventHandle = addMissionEventHandler ["Ended", {
    // log
    "Mission End trigger activated, saving all UCM data." call SCAR_UCM_fnc_log;
}];

Works perfectly on local server (single & multiplayer), but not on dedicated.

Any ideas?

Share this post


Link to post
Share on other sites

Where are you executing this? Are there any if statements? What does SCAR_UCM_fnc_log do?

  • Like 1

Share this post


Link to post
Share on other sites

I'm executing it sever side only, no other statements besides what you see, the function only outputs do diag_log.

Share this post


Link to post
Share on other sites

So diag_log works on the server when executed upon it (e.g. _var remoteExec ["diag_log",2]) therefore the problem seems to be elsewhere. 

34 minutes ago, _SCAR said:

I'm executing it sever side only

Can you post the code which executes it and what kind of script it is (initServer.sqf, init.sqf, etc)? Another thing to bear in mind is, that the missionEventhandler only fires when the mission is ended with "trigger of type 'End', endMission command, BIS_fnc_endMission function or ENDMISSION cheat" (see BIKI).

Share this post


Link to post
Share on other sites

I think (no BI documentation):

 

- MEH fires where it runs. if on server only >> no player (client) knows about it.

- So, of course something like "entitykilled" is a "public" condition, so where ever the entity die, the MEH on server is activated on and server runs the code.

 

Same in your case for "ended", i guess

- But, as said, the code is "local" (I mean: runs only on PCs knowing the MEH... like addaction).

That means:

- if you run effect global EG commands that will do the job everywhere (setdamage... ),

- if you run effect  local ones EL (as hint) that works only where the MEH runs.

 

The question here could be: has dedicated server a debriefing /end mission screen as players have?

  • Like 2

Share this post


Link to post
Share on other sites

This is not a problem with the eventHandler, it just depends on how/where the "endMission" command is given, since that one only has local effects.

-> https://community.bistudio.com/wiki/endMission

 

Also, there is a serversetting "persistent = 1", that allows a mission to keep running without any players in it.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you all for the help.

 

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

×