Page MenuHomeFeedback Tracker

Remove hardcoding of options on "_gear" parameter from BIS_fnc_ambientAnimCombat
Reviewed, WishlistPublic

Description

Currently the function "BIS_fnc_ambientAnimCombat" forwards its _gear parameter to "BIS_fnc_ambientAnim", but "ambientAnimCombat" has an array of options that the mission designer is limited to and will not proceed unless an "acceptable" choice is defined.

Since all the "ambientAnimCombat" does is forward that param to "ambientAnim" there is no need to hardcode such limitations into "ambientAnimCombat", especially since "ambientAnim" already deals with "unknown gear" gracefully.

Details

Legacy ID
987444904
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. Open editor on Stratis
  2. Place down player as BLUFOR > Men > Rifleman
  3. Place down another unit as BLUFOR > Men > Rifleman and give him a name "soldier1"
  4. Preview
  5. Pause and enter in the debug console: "[soldier1, "STAND", "UNDEFINED_GEAR"] call BIS_fnc_ambientAnim;" then click on "Local exec"
  6. Observe that the unit will play animations and the "ambientAnim" will handle the unspecific "UNDEFINED_GEAR" string gracefully
  7. Pause and restart the mission
  8. Pause and enter in the debug console: "[soldier1, "STAND", "UNDEFINED_GEAR"] call BIS_fnc_ambientAnimCombat;" then click on "Local exec"
  9. Observe that this time "ambientAnimCombat" will complain that "UNDEFINED_GEAR" is unacceptable
Additional Information

This kind of hardcoding, even tho not necessary as "ambientAnim" is done well in a manner that will not break even if an unknown string is passed in, should really be done in "ambientAnim" instead of "amibientAnimCombat".

Hardcoding this in "ambientAnimCombat" also makes for unmaintainable code, and the best example is currently that "ambientAnim" can take a "ASIS" parameter for gear which will result in the script not touching the gear, but "ambientAnimCombat" will not let you use "ASIS", even tho it's acceptable for "ambientAnim" and "ambientAnimCombat" does nothing else with it to warrant such a hardcoded restriction.

Event Timeline

Sniperwolf572 edited Additional Information. (Show Details)
Sniperwolf572 set Category to Scripting.
Sniperwolf572 set Reproducibility to Always.
Sniperwolf572 set Severity to None.
Sniperwolf572 set Resolution to Open.
Sniperwolf572 set Legacy ID to 987444904.May 7 2016, 3:53 PM
Sniperwolf572 added a subscriber: Sniperwolf572.

While this has been altered to include the "ASIS" parameter in one of the recent updates, the check itself in the "Combat" version is not necessary due to the reasons mentioned in the ticket.