OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: fleepee on 20 Sep 2008, 16:18:08

Title: problems with mp...
Post by: fleepee on 20 Sep 2008, 16:18:08
 >:(
Hi!
I have some problems in MP playing with that mission (http://www.ofpec.com/forum/index.php?topic=32131.0) ...
I'm using the "hostage" script, and client players can't make the "release" action scripts work well...
Can someone help me?
here is one of the script to set captive unit:
Code: [Select]
_hostage = _this select 0

removeAllWeapons _hostage
_hostage setCaptive true
_hostage switchMove "AmovPercMstpSsurWnonDnon"
_hostage setBehaviour "SAFE"
_hostage addAction ["release Karl", "hostages\set_freekarl.sqs"]
_hostage addEventHandler ["killed", {_this exec "hostages\set_dead.sqs"}]
_hostage disableAI "anim"

this one for the release:
Code: [Select]
_player = leader player
_hostage = _this select 0

?!(alive _hostage):exit
?!(alive _player):exit
_hostage enableAI "anim"
_hostage setCaptive false
_hostage playMove ""
_hostage setBehaviour "COMBAT"
_hostage removeAction 0
_hostage setrank "private"
[_hostage] join group _player
libre=true;
priso=false;
publicVariable "libre";
publicVariable "priso";
exit

The same for a "search" action:
Code: [Select]
player playMove "AinvPknlMstpSlayWrflDnon_medic";
player removeAction 0;
docupris=true;
docupaspris=false;
publicVariable "docupris";
publicVariable "docupapris";
exit

I have to do the actions (as the server) to have them working good and objectives to be updated
the mission is great (is it?), i wish it could be played online in mp...
Try the mission, tell me what kind of problem you encounter and if you have solutions...
Thanks a lot!!!
Fleepee

Title: Re: problems with mp...
Post by: Mr.Peanut on 20 Sep 2008, 20:26:12
How do you execute the hostage script, i.e. is it executed on all machines? Are you seeing the action but the action is not doing anything? The addAction must be done on all machines. The result of the addAction, your release script, is only executing on the machine of the player who used the action. Have the addAction publicVariable another boolean variable, say pvfreekarl, and add another trigger with Condition pvfreekarl to call your release script.
 
Title: Re: problems with mp...
Post by: fleepee on 20 Sep 2008, 20:50:15
I think you're right, the addaction script was certainly not executed on all machines...
I will try your suggestion! thanks! :good:

(If I do understand, I have to create a small script setting a variable to true, then "publicvariable" it, to have the release script executed on all machines by the way of a dedicated trigger...)
Title: Re: problems with mp...
Post by: Mr.Peanut on 21 Sep 2008, 01:54:41
Yes, you must do both of those things.  :yes: