miners are not pirate victims

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

Moderators: winston, another_commander, Getafix

Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: miners are not pirate victims

Post by Switeck »

Eric Walch wrote:
This calls for a new AI command: setTargetToRandomStation. When used it makes a list with all stations within 'desiredRange' that are no carriers and allow npc traffic. Than it selects a random one from that list. I just wrote and tested it with a modified route1traderAI and a desired range of 500 000. Looks good, does not affect clean traders but makes it happen that offender 'traders' regularly dock other stations like rock hermits or constores.
(it also needed the new command setTargetToLastStation to re-find the station he was heading for after a waypoint or attack action.)

Needs a bit more testing though.
A better description would be an AI command to go to secondary stations.

This would rule out the main station and carriers (as they're not true stations).
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: miners are not pirate victims

Post by Eric Walch »

Switeck wrote:
A better description would be an AI command to go to secondary stations.

This would rule out the main station and carriers (as they're not true stations).
Problem with carriers is that there is no official difference in the code between carriers and stations. The ship-key 'is_carrier' only defines something as station. The only characteristic for differentiating I now use is max_speed. When zero it's a true station, when > 0 it is treated as a carrier. But this is not foolproof as there might be stations around that have no "max_flight_speed" defined, and than it will default to 160.

I now updated trunk with the new route1traderAI so pirates with bounty that try to sell there loot have a big chance to go to another station than the main one.

I also noticed that we had the "setTargetToNearestFriendlyStation" that was never documented in the wiki and in the oolite change-log it was not explained what it really does. Maybe that one should be redefined to only go for non-carriers that allow npc traffic.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: miners are not pirate victims

Post by Switeck »

I didn't see any mention of "has_npc_traffic" for Rock Hermits, so those seem a likely docking station for "full" pirates.
If carrier types disallowed npc traffic via "has_npc_traffic", a further distinction for them might not be necessary.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: miners are not pirate victims

Post by Kaks »

HMM, has_npc_traffic means "this station allows NPCs to dock and undock". Sending a pirate to try and dock with something that doesn't allow it to dock seems 'slightly' counterintuitive to me! ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: miners are not pirate victims

Post by Switeck »

So does the lack of a "has_npc_traffic = true;" line mean the station/carrier will not have random npc ships docking with it?
And if so, is that what's wanted in this case?
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: miners are not pirate victims

Post by Svengali »

Switeck wrote:
So does the lack of a "has_npc_traffic = true;" line mean the station/carrier will not have random npc ships docking with it?
No. Default is true (see [EliteWiki] documentation).
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: miners are not pirate victims

Post by Switeck »

The documentation only talks about launching random traders.
Docking and launching may be handled differently.
Post Reply