OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: bardosy on 03 Sep 2009, 17:33:26

Title: 1stAid sync to created unit?
Post by: bardosy on 03 Sep 2009, 17:33:26
How can I syncronize a sript created unit/group to the Firstaid module?


EDIT:
I found syncronizeObjectsAdd, but
Code: [Select]
leader grp_name syncronizeObjectsAdd [firstaidmodul_name]wont work.
Title: Re: 1stAid sync to created unit?
Post by: SaOk on 03 Sep 2009, 18:34:24
I had the same problem last week but I managed to find solution - Adding these three lines enable all three "first aid"-modules for the group (You may still need to place the modules on map):

Code: [Select]
nul=[groupname] execVM "\ca\Modules\AIS\data\scripts\IS.sqf";
nul=[groupname] execVM "\ca\Modules\BC\data\scripts\BC.sqf";
nul =[groupname,leader groupname,true] execVM  "\ca\Modules\FA\data\scripts\FA.sqf";

Title: Re: 1stAid sync to created unit?
Post by: Inkompetent on 03 Sep 2009, 21:04:35
Nice find! Note though that the First Aid Simulation module and First Aid Module shouldn't be used together. Just one or the other.
Title: Re: 1stAid sync to created unit?
Post by: Le_CuLtO on 04 Sep 2009, 07:41:57
Quote
nul=[groupname] execVM "\ca\Modules\AIS\data\scripts\IS.sqf";
nul=[groupname] execVM "\ca\Modules\BC\data\scripts\BC.sqf";
nul =[groupname,leader groupname,true] execVM  "\ca\Modules\FA\data\scripts\FA.sqf";

nice !
where do you exec that code ?
on the server, players who are in the group ? (I want to use this on a pvp mission)
Title: Re: 1stAid sync to created unit?
Post by: SaOk on 04 Sep 2009, 11:23:22
I have no experience on MP scripting but I only exec(ed) those three lines once (in FSMscript) for each group. I think you can exec it from anywhere (triggers/sqs/sqf) but if it requires the modules placed on map (and they work same way as ambiet modules with startup time) then the init.sqf and unit-initbox could be too early.

Here is the orginal post where I found the lines for MP:
http://forums.bistudio.com/showpost.php?p=1396448&postcount=10

I followed the same root with pboview and found the scripts for SP.
Title: Re: 1stAid sync to created unit?
Post by: bardosy on 04 Sep 2009, 11:24:31
Thank you SaOK!!! It was a huge help!