Aquatics bug or Oolite bug?
I regularly see military manta rays flying but never realised there was a bug in it until today when I noticed an Aphid flying with scanscass military, and an "escort" role but flying on its own while rejected by a mother.
What happens: The military manta ray has as scanclass CLASS_MILITARY defined in shipdata. It also has a role of interceptor. However, the populator checks scanclass when adding police. When there is nothing defined is gets CLASS_POLICE but when it has a scanclass, the one in shipdata is inherited. In this case CLASS_MILITARY and the role is forced to "police".
Than the populator continues and generates an escort number for later wingman addition.
On update time this escort number leads to a "setUpEscorts" command by which the escorts are actually set up. And here things start to go wrong. When "isPolice" is true it calls ships of type "wingman" but when false it calls ships of type "escort". "isPolice" is determined by scanclass. For this manta ship it is CLASS_MILITARY thus false and escorts with role "escort" are added.
So far so good. Than on play we have escorts with role "escort" and a mother with a role "police". And it is hard coded that police only accepts "wingman" as escort. All escorts fall apart now.
This means it always will go wrong with police escorts when the scannclass is not police.
I see three places to correct this:
1) in the populator by always setting CLASS_POLICE for police ships.
2) in the escort-mother check. not only looking for role police but also for scannclass. (this probably will get messy as also wingman have CLASS_POLICE)
3) redefining isPolice to not only CLASS_POLICE but also role "police".
Of this is 1) probably easiest implemented. Allowing other scanclasses than CLASS_POLICE for police roles causes troubles anyhow so don't allow it.
Bug with aquatis military ray
Moderators: winston, another_commander, Getafix
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Bug with aquatis military ray
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Can I point out that the Military Manta Ray from Aquatics shouldn't actually have any escorts, at least from its shipdata.plist (it has no escorts key set)? Not that this affects the possibility of this scenario happening with a military scanclass ship that may have escorts.
This problem in part came about due to the misunderstanding that "military" isn't actually a standard in-game role (like "police" or "trader") even though we have a scanclass for it. I included the interceptor and police roles simply to get it into the game.
Might an option 4) be to introduce the standard role, to be similar to that of "police" but to have standard escorts rather than wingmen?
Aquatics is on my "to do list" for a revisit, in part to sort this ship out. So input on this one will be appreciated as to what roles/scanclass to give it.
This problem in part came about due to the misunderstanding that "military" isn't actually a standard in-game role (like "police" or "trader") even though we have a scanclass for it. I included the interceptor and police roles simply to get it into the game.
Might an option 4) be to introduce the standard role, to be similar to that of "police" but to have standard escorts rather than wingmen?
Aquatics is on my "to do list" for a revisit, in part to sort this ship out. So input on this one will be appreciated as to what roles/scanclass to give it.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
I know, but it is hard coded that for ships with role police or interceptor the escortcount in shipdata is ignored and the populator adds escorts on its own.Thargoid wrote:Can I point out that the Military Manta Ray from Aquatics shouldn't actually have any escorts, at least from its shipdata.plist (it has no escorts key set)? Not that this affects the possibility of this scenario happening with a military scanclass ship that may have escorts.
Look for the police in oolite itself. They also have no escorts defined and still get wingman as escort.
UPS-Courier & DeepSpacePirates & others at the box and some older versions