Jump to content

Traders not spawning when out of sector


DoorsMonster

Recommended Posts

HI!

 

I have a noble mine that belongs to an alliance I created. This mine produces gold/platinum when I am in or out the sector without problems. But the issue is that, even when the mine has full stock, I'm under 5 sectors loaded at the same time, and my mine is configured to sell stuff to npcs and also request buyers, traders do not spawn if I am out of the sector.

I checked the traders.lua script, and the idea seems to be to not spawn a trading ship anymore, but doing the transaction directly, and that is not happening.

Please, correct me if I am wrong, but trading out of the sector should work since 0.12, right?

 

UPDATE:

 

Problem: Trading ships are not trading with stations while player is out of a sector, probably because AI gets stuck in a step of the process.

 

Steps to reproduce:

 

[*]Build any station, producer+consumer stations prefered (e.g. solar panel factory)

[*]Make sure you meet the production requeriments (i.e. add enough assembly blocks *v0.15 learned the hard way*)

[*]Add enough crew

[*]Wait for a trader to spawn to trade with your station (buyer/seller fails with both)

[*]Leave the sector thinking that everything will run fine

[*]Wait FOREVER (<- this is the BUG) for the trading ship paying you for the goods it is supposedly buying

[*]Jump back to the sector to see what's wrong

[*]Boom, transaction done!

[*]Repeat

 

Current galaxy/station set up:

 

  • New galaxy v0.15.*
  • Random/Not random spawn sector
  • I built an accelerator factory on creative mode to test
  • I added a huge amount of assembly blocks just to be sure

 

I narrowed the problem:

 

I already checked the scripts involved in the trading process for both cases in-sector and out-of-sector and I think I found the script that's causing this issue:

 

entity/ai/dock.lua

 



69    if DockAI.dockStage == 2 then
70        -- once the ship is at the dock, wait
71>>    if station:isDocked(ship) then
72            ai:setPassive()
73            return true
74        end

 

The problem is in the 71 line of code, the function station:isDocked(ship) seems to require that the player is present in the sector to run. That's the point where the AI get's stuck until I jump back to the sector to witness the trade (and in the exact moment I'm in the sector, the moneyTransfer is done). For some reason the server can't check if a ship is docked with a station if I'm out the sector.

 

What I think it's happening:

 

NPC trader spawns to trade with my station, choose a free dock, and fly towards to it. I jump out of the sector in that moment. Once the NPC ship reaches the light path, it becomes passive and waits for the tractor beam to pull it. But then, the ship should wait until it gets pulled enough, and it tries to check if it isDocked(ship) but this function never returns. This situation causes that the server can't spawn any other traders because the station is occupied (including the immediate traders that, in theory, should address this issue when out-of-sector) and the ECONOMY FREEZES.

 

Sorry for extending this much, but this is a really annoying bug which I specially hate because I wish I could make a big empire that could pay my crew and ships and everything, instead I just can't leave my station alone or it becomes useless.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...