checkForShips is scanning different

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

checkForShips is scanning different

Post by Eric Walch »

The functionality of checkForShips has changed with the new role system of 1.70. This is wrong as it will affect existing OXP's.

It used to return the number of ships that had the requested role as primary role. Now it returns the number of ships that have this role in any of their roles. I would have liked this new situation more, but it means an other working of the role-system for existing OXP's.

The past half year I have an OXP installed that in flight scans all trader, pirate, police, hunter and escorts in the current system. With the new 1.70 I noticed a strong increase in these numbers. Regularly more than 40 pirates. On the other hand also more than 20 police and always morethan 10 hunters. Normally it was just 1 or 2 hunters. Looking in the populaters log I see these numbers are not added to the system. So when a ship now is added to the system as trader it is also found as hunter when this was one of his possible roles.

At least one mission of my current OXP can have problems with this. For the mission I add a bunch of ships with a trader-like AI. The only difference is that they also scan for cargo and scoop everything they find on their way to the station. Besides the private role I also gave them a trader(0.1) role. For the mission there is a standard check if there are zero ships in the system. If yes I add them, if no I assume this was a second launch after the mission start. (This is the standard way to do things). But now it can happen that the system adds him as trader, and my script finds him on the first launching by looking for his private role and thinks that he was already added.

What happens to me could happen to other oxp's. For some cases I would appreciate this way of scanning, but for compatibility sake as a separate command.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Fixed for 1.70.1 and trunk. (More flexible methods exist in JavaScript.)
Post Reply