Jump to content

Recommended Posts

So, i'm pretty new in the Arma 3 Mission edeting and scripting, or at least for Multiplayer.
My problem is, that in my Singleplayer Missions i could just use BIS_fnc_typeText2 and everything worked just fine, but now I'm trying to do this and other Stuff like Hints etc. in a Multiplayer Mission, but it only is Shown to Host or when i put it on my Linux Root Server, to no one.
All the triggers Work just how I want them to, New Tasks get Assigned and everything that has to be done by Server (like let NPC eject via script and stuff like this) work also. Only Issue I have is that Hint's and BIS_fnc_typeText2 etc. are not shown to the Players except host if launched local.

What i did is Adding eventhandlers that get active if you kill the Guy you have to Start the Actual Mission.
 

this addEventHandler ["killed", {[] exec "Missionflow.sqs"}];

The Code below is executed, but hints and Stuff is only shown to host.

<Missionflow.sqs>

[[["Bluefor", "align = 'center' size = '0.7'", "#0000FF"], ["", "<br/>"], ["Im Anflug für ''Para-Drop''", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2;

~30
[[["OPFOR", "align = 'center' size = '0.7'", "#FF0000"], ["", "<br/>"], ["Im Gebiet", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2;
~110 
[[["WARNUNG", "align = 'center' size = '0.7'", "#FF0000"], ["", "<br/>"], ["Jets im Anflug", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2;
~120
[[["EVAC", "align = 'center' size = '0.7'", "#FF0000"], ["", "<br/>"], ["Ist unterwegs", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2;
hintSilent "Achten sie auf Feinde"; 

And all this is only shown to Host, i dont know what to do about this, how am I getting this to work in Multiplayer so all are seeing this.

 

What I also tried is giving the Playable Characters Variable Names (a to d) and then did this:

this addEventHandler ["killed", {[a] exec "Missionflow.sqs"}];
this addEventHandler ["killed", {[b] exec "Missionflow.sqs"}];
this addEventHandler ["killed", {[c] exec "Missionflow.sqs"}];
this addEventHandler ["killed", {[d] exec "Missionflow.sqs"}];

I also tried adding a trigger and set Trigger owner to the Guy you have to kill, and set Activation on not Present, which works for ingame modules to become active very good for me.
And in "On Activation" i put:

[] exec "Missionflow.sqs";
// and also again with the Player Variables
[a] exec "Missionflow.sqs";
[b] exec "Missionflow.sqs";
[c] exec "Missionflow.sqs";
[d] exec "Missionflow.sqs";

Hope someone can Help me, didn't found anything that seems to work for me so I'm asking here now.

Share this post


Link to post
Share on other sites

Try and give the Guy a variable name then write your eventhandler statement in the mission init script

Guy addEventHandler ["killed", {[] exec "Missionflow.sqs"}];

I hope this helps

Share this post


Link to post
Share on other sites
48 minutes ago, Nikander said:

Try and give the Guy a variable name then write your eventhandler statement in the mission init script


Guy addEventHandler ["killed", {[] exec "Missionflow.sqs"}];

I hope this helps

Still, the script get executed, but the Text is still only visible for Host, or nobody if on my Server..

Share this post


Link to post
Share on other sites

Event handlers are generally local to the owner of the object. So an ai is local to the server machine / (or host)
If you want the contents of an eventhandler to run on all machines you need to remoteExec to all machines.


Sent from my SM-G935F using Tapatalk

  • Like 1

Share this post


Link to post
Share on other sites

Guy addEventHandler ["killed", {{[] exec "Missionflow.sqs"} remoteExec ["BIS_fnc_call"]; }];
I think my syntax is correct - on mobile so correct it if not.
This will fire on the machine Guy is local (ie: host / server) and run the code on every machine via remoteExec.

Sent from my SM-G935F using Tapatalk

Share this post


Link to post
Share on other sites

To keep it simple, you might also want to try using a trigger (instead of addEventHandler) in your mission init

private _trg = createTrigger ["EmptyDetector", [0, 0, 0], false];
_trg setTriggerStatements [
		"!alive Guy",
		"[] exec 'Missionflow.sqs'",
		""
];

 

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, DangerousDiz said:

Event handlers are generally local to the owner of the object. So an ai is local to the server machine / (or host)
If you want the contents of an eventhandler to run on all machines you need to remoteExec to all machines.


Sent from my SM-G935F using Tapatalk
 

The reason why you can find a  MPEH MPKIlled.

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, DangerousDiz said:

Guy addEventHandler ["killed", {{[] exec "Missionflow.sqs"} remoteExec ["BIS_fnc_call"]; }];
I think my syntax is correct - on mobile so correct it if not.
This will fire on the machine Guy is local (ie: host / server) and run the code on every machine via remoteExec.

Sent from my SM-G935F using Tapatalk
 

Thank you, it's working now just how i wanted it to.
Just have to rewrite some scripts to prevent Errors, probably not necessary, but i want to be safe.

 

 

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

×