Page MenuHomeFeedback Tracker

get3DENAttribute for a waypoints speedMode and formation properties returns values of incorrect type
Closed, ResolvedPublic

Description

When using get3DENAttribute on a waypoint to return the values of the "speedMode" and "formation" properties, the returned values are number, when it should be a string. The "behaviour" and "combatMode" properties are returned as a string.

According to the wiki, all of these properties should return as a string, which makes sense as setWaypointSpeed and setWaypointFormation require a string, not a number.

Edit: Further investigation shows the values are actually Scalars, not numbers. Doesn't really matter.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Eden Editor
Steps To Reproduce

Requires no mods

  1. Setup a mission in 3den with a unit and a waypoint, set the Behaviour, SpeedMode, Formation, and Combat Mode of the waypoint to whatever you want.
  2. Whilst having the waypoint selected, open the Debug console and execute the following code
_waypoint = (get3DENSelected "waypoint")#0;
[
_waypoint get3DENAttribute "behaviour",
_waypoint get3DENAttribute "speedMode",
_waypoint get3DENAttribute "formation",
_waypoint get3DENAttribute "combatMode"
]
  1. See that the returned values show behaviour and combatMode to be returned as a string, but speedMode and formation return as a number regardless of what the parameters on the waypoint are set to.


Event Timeline

Scofer created this task.Feb 12 2023, 8:39 PM
Scofer updated the task description. (Show Details)Feb 12 2023, 9:01 PM
dedmen closed this task as Resolved.Jul 5 2024, 4:37 PM
dedmen claimed this task.
dedmen added a subscriber: dedmen.

This seems to be intended.
Speed modes are Unchanged, Limited, Normal, Full
Formations are.. uh

case AI::FormNoChange:         return 0;
case AI::FormColumn:           return 4;
case AI::FormStaggeredColumn:  return 6;
case AI::FormWedge:            return 1;
case AI::FormEcholonLeft:      return 7;
case AI::FormEcholonRight:     return 8;
case AI::FormVee:              return 2;
case AI::FormLine:             return 3;
case AI::FormDiamond:          return 9;
case AI::FormFile:             return 5;
default:                       return 1;

For some reason they are weirdly reordered compared to what they should be. Someone intentionally wrote it like this so there must be some idea behind it.
I think its used for UI, and it needs the numbers to select the correct index of the UI element to show as active.
Thus we can't fix it. Both because its used for UI and backwards compat