KoffeinFlummi / AGM

Authentic Gameplay Modification for A3 | THIS PROJECT IS NO LONGER BEING WORKED ON. ALL ISSUES AND PULL REQUESTS WILL BE IGNORED.
Other
125 stars 84 forks source link

playerside vs side player #1989

Closed senshi-x closed 9 years ago

senshi-x commented 9 years ago

It looks like AGM dislikes people switching their side. If a CIV unit switches side using the "join EAST side's group" solution, this results in a disparity between the results of playerside (returns CIV) and side player (returns EAST).

I noticed it so far in the player interaction menu, where the "hostile" options remain (send civilians away, frisk, etc.) as well as no nametags being displayed for the player..

PabstMirror commented 9 years ago
[side player, side (group player), playerside, [player] call AGM_core_fnc_playerside] =
[CIV, CIV, CIV, CIV]

After joining east: [EAST,EAST,CIV,EAST]

AGM is working on ZEUS compatibily (where controlled unit != player) so we use AGM_player

playerside is accessing something in the engine that I don't know how to replicate using just AGM_player

I also checked getNumber (configFile >> "CfgVehicles" >> (typeOf player) >> "side") But I can start a civilian in a east group (have to edit sqm) and playerside is east whereas "side" is 3.

I could try something like: _x setVariable ["AGM_side", (group _x), true]; at mission start.

senshi-x commented 9 years ago

What exactly are you saying? That the AGM-internal way to identify playerside (which seems to be AGM_core_fnc_playerside) already should identify sides similar to side player? Because that's contrary to what I experienced.

In my case we run a Zeus mission where Zeus starts as a CIV, but can switch to whatever side he pleases manually, as well as reassign other players on-the-fly. This is done by a straightforward _newgroup = createGroup East; [player] join _newgroup;. As a couple of scripts are side-dependent (e.g. kit selection), I have to rely on side player in the if-checks, but my scripts then work fine. However, if Zeus switches to WEST, he does not see the nametags of his WEST buddies, nor can he use the interactions that same-side players can. So my guess is AGM uses playerside somewhere instead of side player, as apparently Zeus is still identified as being CIV.

commy2 commented 9 years ago

Neither playerSide nor side player are reliable commands to return the actual side of the currently controlled unit. We use side group AGM_player.

commy2 commented 9 years ago

Also _newgroup = createGroup East; [player] join _newgroup; doesn't work with remote controlled units a.k.a. zeus.

senshi-x commented 9 years ago

I do not refer to remote-controlled units, _newgroup = createGroup East; [player] join _newgroup; is used so Zeus himself can change sides.

I think this issue might be moot now. With the ArmA 1.38 update, the process no longer works as described above. Oddly, side player and playerside now return the same ("CIV"), even after switching to EAST. Only side group agm_player returns "EAST". What a mess.

Also, after switching sides I now get the appropiate interaction options. It looks like 1.38 changed this, and the described issue was only present in 1.36. Were you using the dev branch or 1.38RC before, by any chance?

commy2 commented 9 years ago

Nope 1.36. 1.38 now. We didn't change anything. Also, if side group agm_player returns "EAST" then you ARE on side east. As I said, neither playerSide nor side player are reliable commands. I guess something in that mission is seriously broken.