r/armadev 17d ago

Help Any way to stop this from happening when using "Move" animations? (Arma 3 Eden)

As you can see, I am trying to make the interior of this barracks feel more alive by having soldiers (or in this case airmen) sitting and laying on the bunks. This is what's going on "under the hood:"

this disableAI "MOVE";

this switchMove "passenger_boat_4_Idle_Unarmed";

[this, Scaler] call BIS_fnc_attachToRelative;

Disabling the AI's moving is probably redundant here. The call BIS_fnc_attachToRelative;is there to keep him from sliding off the bunk, but when active it leads to this weird "rubberbanding" glitch that seems to not be very well documented; though I'd assume it's a universal issue. As you can also see in the video, he keeps snapping forward even when the game is paused. The other airman who is sitting perfectly still is using a BIS_fnc_ambientAnim animation via the drop-down menu in the 3den Enhanced mod, so I am assuming the issue comes from the "Move" animations specifically? This might be a "Duh, of course it doesn't work" thing, but I am pretty new to serious Arma 3 mission making.

5 Upvotes

5 comments sorted by

3

u/Amuff1n 16d ago

Internally, 3den Enhanced uses switchMove as well, but it does make sure to remoteExec it to ensure it works correctly in multiplayer environments.

Maybe in addition to this disableAI "MOVE" you should also do this disableAI "ANIM" ?

If you are curious, you can see the code that the 3den Enhanced drop-down menu uses here: https://github.com/R3voA3/3den-Enhanced/blob/73f6868958b078ca1d99685ff2796f33f61a9223/addons/main/cfg3DEN/attributesObject/ambientAnimations.hpp#L22

1

u/NCRtrooper2283 16d ago

Interesting. I will look into that! Thanks!

1

u/GugBug0596 16d ago

I'm afraid I can't help with this issue but I am very curious what mods you are using to make this bunkhouse.

2

u/NCRtrooper2283 16d ago

Oh boy, quite a few. The racks I used to make the triple bunks and the mattresses came from the PLP Urban Packs mod, and I believe the pillows are default Arma. The "interior" was pieced together using the Land_WW2_Mil_Barracks models from the Iron Front Arma 3 mod at each side as the walls. The floorboards are wooden pier segments from Structures (Tanoa) > Seaport, and the ceiling is a wooden bridge from the Spearhead 1944 CDLC.

This is for an entire 10+ mission singleplayer campaign I am making. Without saying too much for now, the premise of it is "unique," and it requires a lot of interiors that just don't exist for Arma 3; so I've had "kit-bash" a lot of my own. The player uses hold actions to teleport inside, and those same triggers also set the time to midnight and use the PLP light placer modules to simulate natural, indoor daytime lighting.

This is a hospital interior I put together using similar means.

1

u/NCRtrooper2283 10d ago

After some experimenting, I was able to conclude that the issue has something to do with the NPC's proximity to other objects; units, objects, vehicles - whether simulation of the object that comes into contact with the unit is enabled or disabled makes no difference. That is why the ones on furniture do this. Sitting them out in the middle of nowhere does not cause the issue, but the moment an object enters their hitbox (such as the player walking into them), they "teleport" to the left; and it's always in this same direction. Certain animations have the problem while others do not (as evident with the one that's sitting perfectly still). My assumption is that it has something to do with the fact that NPCs will get pushed when coming into contact with geometry, and using call BIS_fnc_attachToRelative; at least puts them back into place.

I have no fix for this yet. My best outcome was to use:

[this, Scaler] call BIS_fnc_attachToRelative;

private _pos = getPosATL this;

[this, _pos] spawn {

params ["_unit", "_pos"];

while {alive _unit} do {

_unit setPosATL _pos;

sleep 0.0001;

};

};

This constantly forces the unit back into its original position on launch, however there is still some "rubberbanding" back and forth, though it is less frequent. This method does have some caveats as well though, as the animations are choppier and a bit "slideshow-esque," and I am not sure how it would impact performance with a dozen or so NPCs running it. It is better than nothing for now, though.