Get the side or faction of a unit
Posted: 10 Mar 2016, 18:03
Hello everyone,
I am trying to develop a level editor that should work with most games created through SpringRTS engine. For this, I would like to sort the different units of the mod by faction/side. I got them all using UnitDefs, but there does not seem to be a field where I can get the side of a unit.
I saw that it is possible to get the side of an instance of a unit using Spring.GetTeamInfo along with Spring.GetUnitTeam, but this is only related to the team as chosen in the lobby and not to the unit itself.
So, here's my question : is there a way to get the side of a unit ?
For instance, in Kernel Panic 4.1, this piece of information is stored in the .fbi files located in the units folder (which is different for BA 7.50), but it does not seem accessible by a widget, and as I already said, I need to do something that can be used with most Spring mods.
Thanks in advance for your answers.
I am trying to develop a level editor that should work with most games created through SpringRTS engine. For this, I would like to sort the different units of the mod by faction/side. I got them all using UnitDefs, but there does not seem to be a field where I can get the side of a unit.
I saw that it is possible to get the side of an instance of a unit using Spring.GetTeamInfo along with Spring.GetUnitTeam, but this is only related to the team as chosen in the lobby and not to the unit itself.
So, here's my question : is there a way to get the side of a unit ?
For instance, in Kernel Panic 4.1, this piece of information is stored in the .fbi files located in the units folder (which is different for BA 7.50), but it does not seem accessible by a widget, and as I already said, I need to do something that can be used with most Spring mods.
Thanks in advance for your answers.