Jump to content
Sign in to follow this  
1para{god-father}

Resynchronize Module

Recommended Posts

Hi Guys,

Anyone point me in the right direction I need to resync a vehicle with a Module when it respawns, had no luck so far

I am using Tophe v1.7 Respawn script

Would I have to put it in the Vehicle respawn script ?

Modulename synchronizeObjectsAdd vehiclename

Cheers

Share this post


Link to post
Share on other sites

I also need this.

For me i'm gonna try:

player synchronizeObjectsAdd ["First Aid: Simulation","First Aid: Action","First Aid: Battle Clearance"];

---------- Post added at 08:39 AM ---------- Previous post was at 08:35 AM ----------

Well i was really dumb. It is expecting object so we should use class names of the modules.

Share this post


Link to post
Share on other sites

some modules can only be synched properly at mission start.

name the modules and:

modulename synchronizeObjectsAdd [objectname];

Share this post


Link to post
Share on other sites
some modules can only be synched properly at mission start.

name the modules and:

modulename synchronizeObjectsAdd [objectname];

Noooooooo.... How about First Aid action, battlefield clearance and first aid simulation? Can those be resynched after respawn??? I'm screwed if they can't.... :(

Share this post


Link to post
Share on other sites

You could try recreating the modules.

In a respawn EH do something like:

{
 (_x createvehiclelocal [1,1,1]) synchronizeObjectsAdd playableunits;
} foreach ["FirstAidSystem","AlternativeInjurySimulation","BattleFieldClearance"];

If it's a long mission, then you probably want to start deleting old modules at some point.

Share this post


Link to post
Share on other sites

Does not work for me.

---------- Post added at 09:50 AM ---------- Previous post was at 09:48 AM ----------

That will probably work Shuko but for me it is a MPMission and there will be maybe 30 or even more respawns. I guess that will make the mission crazy

Edited by CarlosTex
First post was reply to Demonized not Shuko

Share this post


Link to post
Share on other sites

I just need it for the ULB module which is attached to the little bird:- so when the little bird respawns I need it to Sync again.

So where is the best place for me to do that ?

Thanks

Share this post


Link to post
Share on other sites

I think i'll be better creating a script where wounded player will loop through an injured animation until he is healed by a medic.

Share this post


Link to post
Share on other sites

i sucessfully got several modules working again with spawned units as long as they are added to the synch within few frames of unit and module creation, when i worked on my preset loadouts with body model change script.

this meaning, creating a unit/units, then creating said modules, like first aid etc, then synching them before doing anything else.

and it will work mid mission, but again, this depends on the module, some can, others cannot, i have not to this date found or tested all modules to which can do what.

best possible workaround is to unpbo the modules, and recreate them to accept mid mission input, but again, there is probably a reason for why they did not have this feature at the release so be prepared for heavy work, or simply, screw it and recreate effects yourself using a custom script.

Recreating how for example firstaid/wounded etc modules works, is pretty easy when you got the roadmap of the complete module.

just used damage eventhandlers, allowdammage, playmove, addaction,setdammage, etc...

i myslef have no experience in fsm´s but i asume this is what the modules use to have max performance compared to workload.

There are several guides about on fsm´s, but if you have some scripting knowledge, create the scripts and in the future, convert them to fsm´s if its resource hungry.

Share this post


Link to post
Share on other sites

I just wanted a simple script. if damage is bigger than 0.8 the wounded unit would play a looping animation until he was healed by a medic. While this is happening every minute he would getdamage 0.02 to simulate bleeding. Every time he would get additional damage there could be a side chat message like MEDIC!!

I tried but i failed.

Share this post


Link to post
Share on other sites

You don't need to re-sync the first aid module after respawn. It should work without re-syncing.

However, it will become occasionally bugged and healing won't work, and with respawn it will also occasionally leave the player as captive, making enemies never attack him at all. Re-syncing the module will not solve any of those issues though.

Share this post


Link to post
Share on other sites
You don't need to re-sync the first aid module after respawn. It should work without re-syncing.

However, it will become occasionally bugged and healing won't work, and with respawn it will also occasionally leave the player as captive, making enemies never attack him at all. Re-syncing the module will not solve any of those issues though.

are we talking of the same ingame vanilla Arma2 firstaid module?

afaik, they will not work unless synched to unit.

Edit: confirmed it, Arma2 vanilla firstaid modules needs to be synched to work.

Edited by Demonized

Share this post


Link to post
Share on other sites

Yes, they need to be synced at mission start, but not resynced on rsepawn. Resyncing on respawn doesn't seem to do anything at all.

Share this post


Link to post
Share on other sites
Yes, they need to be synced at mission start, but not resynced on rsepawn. Resyncing on respawn doesn't seem to do anything at all.

Yes that's true. And the problem with some modules us that they are only initialised at mission start. After a respawn they don't work.

Actually on the BIS Module Improvement Project thread you can see that the guys haven't been able to make FA Modules MP compatible yet.

Share this post


Link to post
Share on other sites

And I already gave you the answer.

---------- Post added at 11:38 AM ---------- Previous post was at 11:17 AM ----------

No need to place any FA modules in editor, no need to sync anything in editor. Works with JIPs and respawn.

SHK_FirstAidModules = [];
SHK_fnc_addFAModules = {
 private "_o";
 {
   _o = _x createvehiclelocal [1,1,1];
   _o synchronizeObjectsAdd playableunits;
   SHK_FirstAidModules set [count SHK_FirstAidModules, _o];
 } foreach ["FirstAidSystem","AlternativeInjurySimulation","BattleFieldClearance"];
};
SHK_fnc_remFAModules = {
 {
   deletevehicle _x;
 } foreach SHK_FirstAidModules;
};
SHK_fnc_readdFAModules = {
 call SHK_fnc_remFAModules;
 call SHK_fnc_addFAModules;
};

// Mission start, load modules first time.
call SHK_fnc_addFAModules;

// Readd modules after respawn.
if !isdedicated then {
 waituntil {!isnull player};
 player addeventhandler ["respawn",SHK_fnc_readdFAModules];
};

Share this post


Link to post
Share on other sites

All bow master Shuko. I will try that. Looks awesome.

---------- Post added at 10:04 AM ---------- Previous post was at 09:58 AM ----------

BTW. Should i call that script from a game logic? Init.sqf? Init line of the unit?

Share this post


Link to post
Share on other sites

I'd put it in a separate file and execvm from init.sqf.

Share this post


Link to post
Share on other sites

If you are sure it works then i'm certainly doing something wrong because it is not working for me.

Share this post


Link to post
Share on other sites

i know myself that for the 3 firstaid modules listed above by shuko works when created mid mission, seemed in my tests on changebody.sqf that you could have as many modules you want of these modules, but it was very important to create the units, create the modules, and imediatly synch them to work.

there was no need to delete the old modules, though not tested in a long time mision, only editor.

no double effects or nothing.

all good.

Share this post


Link to post
Share on other sites

Damn i can't get it to work. I like the BIS system so much. I need a schematic... lol

---------- Post added at 12:09 PM ---------- Previous post was at 11:12 AM ----------

Got it. I wasn't calling the script properly. Did it like this;

null = [] execVM "revivesystem.sqf";

and started working.

Shuko let me say, you never cease to amaze me. Back in the Flashpoint days when i first tried the FDF mod i saw how amazing work you done.

I read somewhere on FDF site that you plan on publishing FDF for Arma 2.

Do it!!! I'm sure it will be amazing.

Share this post


Link to post
Share on other sites

Shuko, does this actually avoid the occasional captive bug? If not, you might want to add a player setCative false; line.

Share this post


Link to post
Share on other sites

I honestly have no idea. I just wrote it, tested quickly on my dedi with 2 clients that jips and respawned units were able to give first aid. When/why does the captive bug appear?

Share this post


Link to post
Share on other sites

Shuko do you think your code would work also on spawned AI soldiers that join the player group?

Share this post


Link to post
Share on other sites

hm, don´t think so.

I joined a unit to the player group and called SHK_fnc_readdFAModules.

The First Aid action shows up but doesn´t respond.

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
Sign in to follow this  

×