Comrades in Arms Discussion Board

Full Version: addAction in MP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Since addAction is all local, I went looking how to get it working in multiplayer and found some stuff about MP Framework and public variables.

Trigger #1 Activation:
Quote:_myaction = (leader grpname) addAction ["Hello", "hello.sqf"]

hello.sqf
Quote:(leader grpname) removeAction _myaction;
publicVariable "myvarName"; myvarName=true;

Trigger #2 Condition:
Quote:myvarName

I realize in case the leader dies after getting the action and before activating, this goes fubar, but for a start, will this work?
This should work if the trigger's activation runs on all clients and the server, i.e. the condition is true everywhere.

I am not entirely sure how to interpret the argument locality TBH. It says that the arguments to this function must be local, and the effect is local. This would imply that if you e.g. add the action to the leader, it would only work were the leader is local, and the effect would also only be local, which can't really be the case since adding an action to an empty object would work too.

I suppose local argument is only applicable to the right side of the argument list in this case.
(04-13-2014, 11:45 AM)Alwarren link Wrote: [ -> ]This should work if the trigger's activation runs on all clients and the server, i.e. the condition is true everywhere.

Wouldn't the publicVariable command take care of that? What about using the MP framework in this case?
(04-13-2014, 01:46 PM)Outlawz7 link Wrote: [ -> ]Wouldn't the publicVariable command take care of that?

yeah, absolutely.