acemod / ACE3

Open-source realism mod for Arma 3
https://ace3.acemod.org
Other
1k stars 735 forks source link

Problems with using ACE FRIES with BI respawn #6862

Closed markooff closed 2 months ago

markooff commented 5 years ago

Arma 3 Version: 1.90 (stable) CBA Version: 3.9.1 (stable) ACE3 Version: 3.12.5 (stable)

Mods:

- CBA_A3
- ace
- TFAR
- RHS USAF, AFRF, GREF
- CUP Core, maps
- Enchanced Movements

Description:

// rewritted from previously closed ticket https://github.com/acemod/ACE3/issues/4072#issuecomment-471826623 I've just tried using of the method with the ["", "initPost", ace_fastroping_fnc_equipFRIES, nil, nil, true] call CBA_fnc_addClassEventHandler; in my init.sqf file , but I've got a strange effect

Or, maybe , am I wrong ?

Steps to reproduce:

Where did the issue occur?

Additional information:

RPT log file: // there is NO rpt file

markooff commented 5 years ago

In addition - info : The adding of FRIES module works only before the helicopter is deleted - because it has a phraze : [this] call ace_fastroping_fnc_equipFRIES; in his init field - and it works well (but only once). After the helicopter respawn - the situation is as I described above ... I think about some stupid errors in the invocations of CBA_fnc_addClassEventHandler - but there are any of them, because I've checked this invocation in CBA github exapmles - and it is correct. So the question is - why the FRIES module behaves that way ?

commy2 commented 5 years ago

When using the CBA_fnc_addClassEventHandler method, you have to also delete the init box line.

commy2 commented 5 years ago

equipFRIES has global effcts. You have placed the code in an init box or added the InitPost class event handler on every machine (init.sqf). Those script instance are executed on every machine. Both are wrong, because you must not execute commands and functions with global effects on every machine. The function must only be executed on one machine.

commy2 commented 5 years ago

If you want to use the init.sqf method, then you have to delete the init box entry of the vehicle in the editor and place this into init.sqf:

// init.sqf
if (isServer) then {
    ["<classname_helicopter>", "initPost", {
        params ["_heli"];
        _heli call ace_fastroping_fnc_equipFRIES;
    }, nil, nil, true] call CBA_fnc_addClassEventHandler;
};

I don't think any of this has changed in the last few years.

markooff commented 5 years ago

OK, I've tested the method , You described above, (I've cleaned up the init field of the helicopter and pasted the code from above to my init.sqf. Then I've started the mission in the MP environment) But it produced the same effect, i.e. everything worked well until the respawn of the helicopter. Then in spite of the visually effect of adding visible FRIES mechanism , there were no possibilities to use it . You can take a look of the two screens I've made during tests (both were taken AFTER helicopter has respawned) : http://markooff.net/obrazki/ACE3/bugs_and_features/FRIES_problem/Arma3_x64_2019-03-13_14-48-17-89.jpg http://markooff.net/obrazki/ACE3/bugs_and_features/FRIES_problem/Arma3_x64_2019-03-13_14-48-35-23.jpg And here there are screens taken at the start of the mission (I have to restart mission from scratch) just after the first spawn of my character (before the helicopter was destroyed and respawned) : http://markooff.net/obrazki/ACE3/bugs_and_features/FRIES_problem/Arma3_x64_2019-03-13_14-57-31-36.jpg http://markooff.net/obrazki/ACE3/bugs_and_features/FRIES_problem/Arma3_x64_2019-03-13_14-57-38-67.jpg There is - how it should work normally - you should to have a possibility to use the FRIES mechanism with ACE_interaction_menu as a normal playing character just from inside the heli....

commy2 commented 5 years ago

Please upload an RPT file.

markooff commented 5 years ago

Here You've got ! :) Arma3_x64_2019-03-13_20-26-52.zip

commy2 commented 5 years ago

I checked the vehicle respawn module and BI broke it completely.

This is what they do:

            //--- Copy all variables across from the old vehicle to the new one
            {
                _newVeh setVariable [_x, _veh getVariable _x];
            }
            forEach allVariables _veh;

They copy all variables from the wreck to the new vehicle now. This breaks pretty much every script on the respawned vehicles.

My advice is to drop the vehicle respawn module.

markooff commented 5 years ago

OK, I understand it , but - what should I use instead of the original BI veh_respawn module - for proper respawn the helicopter with all functionalities it has - and other machines/cars/vehicles on the whole map ( as you can probably see - this little mission is only 'script testing' one for a greater project [Manhunt] which I'm still working on ) ? What do You suggest ?

commy2 commented 5 years ago

The only thing you can do is to script this yourself using a Killed event handler and createVehicle.

markooff commented 5 years ago

I understand, to make it more clear - could I use an Event Scripting options and fields in Enhanced Eden mod (which I use normally) ? Is it right ? Or I should only add to the init field of the Helicopter script when I use event handler Killed as a condition and a createVehicle as a function (of course with proper invocation and parameters) ? And after that - the deleteVehicle (old vehicle) ...

commy2 commented 5 years ago

I think either would work, but I have never used Enhanced Eden.

markooff commented 5 years ago

Thank You , very much for a quick and essential help in my problem. I'll do it by myself . And , of course I'll write if the 3den Enhanced Event Scripting module can do the job also . If in the future I have a question connected with this issue , I will ask You :)

markooff commented 5 years ago

@commy2 - if I may ask You for a bit help - I have another question :

I've searched the solutions or advices for that problem but I've finded nothing special about it ..

commy2 commented 5 years ago

That's off topic to this issue. You'd be better of discussing this on the ACE Slack.

The performance impact of an Init event script depends entirely on the function you execute. For ace_fastroping_fnc_equipFRIES it is negligible. For ace_medical_fnc_init it is, in my opinion, not (and this is entirely because of the relatively huge number of setVariable public uses).

The impact of the event handler itself is negligible and so is adding the events at the mission start (init.sqf).

markooff commented 5 years ago

Thank You for the answer, @commy2 Of course - I've meant the commands/features like : ace_draggable, ace_carryable, ace_cargo_space, ace_cargo_size and so on. Not the whole frameworks (like ace_medical framework ) I need to make these changes to complete my own 'logistic system' (for use by my own Group ) which they will be the parts of.

OK, I've registered on ACE3 Slack . but which channel should be good enough to continue this conversation ?

commy2 commented 5 years ago

Reopen, because the issue persists.

Only on topic replies below this post please.

markooff commented 5 years ago

I have some new informations in this issue . During our sewere tests of PGM logistic system ( http://pgm.armaonline.pl/forum/viewtopic.php?f=53&t=532&p=7605&sid=73305a03e7d39854d13c5704e41ec0cc#p7605 ) I've found that this problem ONLY affects helicopter classes of UH-1 and similiar. But it looks like it NOT affects other classes - such as CH-53 CH-47 and so on . After helicopters of these classes are destroy and they are respawned (using standard BI respawn/vehicle module ) the FRIES mechanism not only seems to working well , but it REALLY WORKS WELL ....

So, maybe it isn't a trully problem of BI-respawn-bug ... ?

commy2 commented 5 years ago

It is. They are copying all variables from the wreck to the respawned object. Even variables from ACE that don't belong on the respawned object. This is probably some misguided attempt to fix issues they have with something else, but it is insanely stupid if you know anything about programming, because it breaks pretty much every script.

All vehicles created by the BI Respawn Module after 1.90 are compromised and behave unexpectedly. There is no point in finding patterns by trial and error here. The only solution is to revert the change in the BI respawn module - or to avoid using it.

markooff commented 5 years ago

OK, so, I think about the solution for an ordinary players/mission-makers - which may help them to avoid such problems with vehicle respawning . What do you think about the possibility for creating an extra respawn module in the ACE3 mod addon structure ?

I hope if You (as the ACE3DevTeam) can handle it - it will be much more better than any BI solutions that sort. Safe and fully customisable ....

Whigital commented 2 years ago

Could the FRIES variables be wiped from the destroyed chopper with a handleKilled function as with many other modules ?

It's just a workaround, but should work ....

commy2 commented 2 years ago

Won't help. The variables are copied over by a scheduled BI script. Don't use the vehicle respawn module. It is as simple as that. By copying random variables, BI broke it, and they have no intention to fix it, because they lack awareness of this being a problem, not only for this feature, but for anything in general.

markooff commented 2 years ago

Information from the last ...few months of using FRIES (im my mod also ) - and a kinda solution of this is - that all problems with ropes and using them CAN be solved manually - when You first (using the Zeus menu) remove FRIES from the previously configured vehicle completely AND THEN add it once again !

Now all FRIES functions should work properly ....