Page MenuHomeFeedback Tracker

attachTo command inconsistencies (When attaching units to some objects like chairs)
Closed, ResolvedPublic

Description

When using the attachTo command on different objects (I tried A3's default chair objects) you get inconsistent directions on the attached unit that does not correlate (on a predictable manner) to the direction of object the unit is being attached to. (Tested on chairs placed on a 3 story building so don't know the same thing happens at ground level).

Details

Severity
Minor
Resolution
Not A Bug
Reproducibility
Always
Operating System
Windows 10 x64
Category
Engine
Steps To Reproduce

Place a building with accessible rooftop and place several chairs, for example "Land_ChairPlastic_F" (Most chairs I tested exhibit the issue), on said rooftop and have each chair point at different directions for example: North, South, West etc.

Place a playable unit and start the mission. Approach any of the chairs, open the debut console and run the following: player attachTo [cursorTarget,[0,0,-0.5]];

Lets say that first chair is pointing north, and after the player is attached to it the player unit ends up facing east.
Now if you approach another chair (that is the same class as the other one) and that chair is facing east then if the player is attached to it the player unit should end up facing south (Because the attach command on the first chair did a +90 degrees for the attached player) but instead the player ends up facing west or any other direction that has no correlation to the behavior shown on the first chair after the player unit was attached to it.

Additional Information

This creates a situation were it is impossible to script a solution that would have the player unit facing at the correct direction given the direction of the chairs that player unit is being attach to.

Scripted Example:

_unit attachTo [_chair,[0,0,-0.5]];
_faceDir = (getdir _unit);

call {
if (typeOf _chair in ["Land_ChairWood_F","Land_CampingChair_V2_F","Land_CampingChair_V2_white_F"]) exitWith {_faceDir = (getdir _unit) +90; _unit setdir _faceDir;};
if (typeOf _chair in ["Land_ChairPlastic_F"]) exitWith {_faceDir = (getdir _unit) +10; _unit setdir _faceDir;};
if (typeOf _chair in ["Land_ArmChair_01_F"]) exitWith {_faceDir = (getdir _unit) +0; _unit setdir _faceDir;};
};

The previous script will set the player unit on the right direction as long as the chairs are pointing north. As soon as the mission maker makes the chairs face random directions then the script fails to set the player unit to the right direction due to that attach to inconsistence.

PS: The previous script works perfectly on those chairs (The player unit is always properly aligned) when not using the attachTo command.

I can provide a DEMO mission if needed.

Event Timeline

LSValmont created this task.Jun 8 2022, 5:06 AM
LSValmont updated the task description. (Show Details)
LSValmont updated the task description. (Show Details)Jun 8 2022, 4:00 PM
h- added a subscriber: h-.Jun 8 2022, 6:05 PM
dedmen closed this task as Resolved.Jun 8 2022, 7:09 PM
dedmen claimed this task.
dedmen changed Resolution from Open to Not A Bug.