Jump to content

[MOD] CompleX3s [CPX3]


Laserzwei

Recommended Posts

@Sinistrem Yo, I had that problem earlier in Laserzwei's mod and we had hashed it out together discovering that deleting the root block of the ship once it became a station (which translates to deleting the root block of the station itself) is what messes up the way the complex manager recognises the station.

That really messes up the complex management! Don't do it. Think before you build.

 

So long as you don't delete the root block of the station you can essentially have cube's (Station root blocks) attached to poles (complex station links) as your complex with cargo bays and whatever you want slapped on.

You can always attach blocks to an complex.

But don't delete the root block or one of the 5x5x5 red Trinium Armor Blocks. (You can delete an armor block, but that will remove the one single factory associated with it. Avoid deleting your rootblock.)

 

Also keep in mind there is a wiki:

wiki

and it says what to do when an complex gets damaged.

Link to comment
Share on other sites

  • Replies 95
  • Created
  • Last Reply

Top Posters In This Topic

What you wrote in Wiki can also happen to ships. One time all weapons of my ship got removed into inventory when repairing the ship... I cant say for sure, but I think it is the same issue.

 

This issue also happened once to a friend when he merged 2 cargo blocks of the complex. He lost most of his factories.

Link to comment
Share on other sites

So, uh, is it just me or are there no places in the mod where a complex actually requests traders or even refers to the config file for enabling traders?

 

Got kinda worried and looked into it after checking config files and still having zero traders come to the complex after hours of waiting.

Link to comment
Share on other sites

updated to 0.87b

[Changes]

  - A non harmful bug removed where

  "Received an invoke script message the wrong sector. Coordinates: xxx:yyy"

  would be printed into client-log

  - added an optional download to let NPC-Freighters trade with complexes

It would seem the trader functionality is an optional download you have to enable (?). I couldn't find this optional download on the main page, though.
Link to comment
Share on other sites

  • 2 weeks later...

http://prntscr.com/i95qd8

 

could not execute function 'synchTradingLists' in '"mods/complexMod/scripts/entity/merchants/complexFactory.lua"':

invalid argument 'nil' at stack position 1, expected 'Player'

stack traceback:

in function invokeClientFunction

data/scripts/lib/complextradingmanager.lua:195: in function ?

Setting state to invalid.

 

Tried with asteroid stations.

Tried with normal stations.

 

Checked crew,power,production,storage and did not modify any blocks or delete any blocks.

 

Dragged and dropped mod into data and mods folders. Avorion/data Avorion/Mods

 

Version 0.90c

Link to comment
Share on other sites

http://prntscr.com/i95qd8

 

could not execute function 'synchTradingLists' in '"mods/complexMod/scripts/entity/merchants/complexFactory.lua"':

invalid argument 'nil' at stack position 1, expected 'Player'

stack traceback:

in function invokeClientFunction

data/scripts/lib/complextradingmanager.lua:195: in function ?

Setting state to invalid.

 

Tried with asteroid stations.

Tried with normal stations.

 

Checked crew,power,production,storage and did not modify any blocks or delete any blocks.

 

Dragged and dropped mod into data and mods folders. Avorion/data Avorion/Mods

 

Version 0.90c

I don't know what you did, but you did something very very wrong:

In 0.90c, in the function "synchTradingLists",  the function " invokeClientFunction" is NOT called. Hence the shown error can not occur.

Furthermore line 195 is literally just  "end". This can't throw the shown error either.

 

Link to comment
Share on other sites

traders don't seem to buy/sell products at complexes on our server - is that wanted or a bug on our server?

Traders trade with complexes in the default configuration.

-make sure /mods/complexMod/config/config.lua has traders enabled.

-look in your server logs, if something crashed

- check if /data/scripts/sector/traders.lua has

if not pcall(require, "mods/complexMod/scripts/sector/traders") then print("Failed to load tradermodule of ComplexMod") end

in line 169 (bottom)

 

This mod seems like it is no longer functional at all in terms of getting AI traders to trade with it.  I've had it and a few normal stations in a system with ships going to/from the normal stations, but NOT the complex.

 

Having save issue as Alanthier - NPC traders service single stations in a sector but not complex hubs.

 

Tried both GitHub and direct download links from the forum (0.90c), but on both I can't seem to find line 169 in the `/data/scripts/sector/traders.lua` file. My file terminates on line 115.

 

Can confirm that `config.enableNPCTrading = true` in my `\mods\complexMod\config\complex.lua` (NOT config.lua). If I rename `complex.lua` to `config.lua` I get mod loading errors so I believe the filename is correct.

 

Great mod by the way irrespective of my current issue. I would love to see how I can fix my NPC traders for the cherry on the cake.

Link to comment
Share on other sites

Try the following:

Get the vanilla /lib/tradingutility.lua and save it somewhere else

Install the mod

Overwrite /lib/tradingutility.lua with the vanilla one you just held back

Add at the top of the scripts-list the following line:

"mods/complexMod/scripts/entity/merchants/complexFactory.lua"

report back, if it helped (at least 15 min. are required in an empty sector , +5min for every other station)

Link to comment
Share on other sites

I have tried the following :

 

Uninstalled Avorion from Steam

Navigated to the install directory and manually deleted it (clearing up any leftover uninstall artifacts (the mod folders were still installed))

 

Installed Avorion from Steam

 

Created a copy of data/scripts/lib/tradingutility.lua called tradingutility.lua.original.backup

 

Installed the mod

 

Created a copy of data/scripts/lib/tradingutility.lua called tradingutility.lua.complexMod.backup

 

Copied the original tradingutility.lua back over the top of the modded tradingutility.lua

 

Edited the tradingultility.lua lines 26 and 27 (added comma and reference to complexFactory.lua script):

 

local scripts =
{
    "/consumer.lua",
    "/seller.lua",
    "/turretfactoryseller.lua",
    "/factory.lua",
    "/highfactory.lua",
    "/basefactory.lua",
    "/midfactory.lua",
    "/lowfactory.lua",
    "/tradingpost.lua",
    "/planetarytradingpost.lua",
    "/casino.lua",
    "/habitat.lua",
    "/biotope.lua",
    "mods/complexMod/scripts/entity/merchants/complexFactory.lua"
}

 

Booted up the game.

 

Confirmed no script errors in the console and that my existing platinum/gold mine was still trading (selling) with NPC traders. NPC trader faction relations are 'Excellent' but over 11 jumps to the nearest occupied faction territory station.

 

Jumped to an empty sector next door.

 

Spawned in a ship using /run Entity():addScript("lib/entitydbg.lua")

 

Founded a Solar Panel plant. Edited build to use the Modular Station :

http://steamcommunity.com/sharedfiles/filedetails/?id=1178447686

 

As soon as the station was founded, a warning was written to the console :

Warning: Couldn't add script from stream: index is already taken

 

Station started production of energy cells as expected.

 

Spawned in another ship and founded a Scrap Metal factory. Got the same warning in the console as above.

 

Used the Complex Manager on the Solar Panel plant to merge stations. UI of Complex Manager seems ok, production rate and goods for sale detected successfully. The combined station produces resources up to the assigned limit. The Buy/Sell Goods menu is correctly populated too, with the correct stock.

 

Sat idle in sector with the complex station. Endured a couple of pirate attacks. Received notifications that the mine in the adjacent sector was still trading (selling) with NPCs.

 

No traders have since visited the new empty sector with the complex station.

 

Is there a way I can up the logging level to the console to try and get more information for you ?

 

 

Notes :

I am using an existing galaxy that I backed up before installing the mod - no complex stations exist, just the mine.

The complex station does not have a full compliment of crew and is suffering normal damage over time due to lack of maintenance.

The complex station does not have a captain.

The station is set up inside of the barrier at [-32,40]

The sector was initially completely empty of all entities. No asteroids, no wrecks, no containers etc.

Can confirm that the config still has 'config.enableNPCTrading = true'

I have tried removing all existing docks from the merged complex station, exited build mode, entered build mode again and reapplied a single dock.

 

Aside :

Config file has the version 'config.version = "[0.90b] "' (yes there is an extra space in there it seems) - confirmed this matches what is on GitHub.

Looking at the logs when the station is constructed :

<${good} Trader ${size}> Complex Construction begins.
<> Paid 5.529.000 credits to found a factory.
Warning: Couldn't add script from stream: index is already taken

 

After adding 'config.debuglvl = 5' to complex.lua I am able to see the messages of (amongst other data) which I presume means the mod is scanning products correctly :

[CPX3][0.90b] sync of ProductionData
[CPX3][0.90b] new Productiondata 1 Solar Power Plant S
[CPX3][0.90b] new Productiondata 2 Scrap Metal Trader Class II
[CPX3][0.90b] Updating ListDataPanel

 

 

Link to comment
Share on other sites

Edited the tradingultility.lua lines 26 and 27 (added comma and reference to complexFactory.lua script):

The moment I realized, you know what you're doing.

 

Notes :

1) I am using an existing galaxy that I backed up before installing the mod - no complex stations exist, just the mine.

2) The complex station does not have a full compliment of crew and is suffering normal damage over time due to lack of maintenance.

3) The complex station does not have a captain.

4) The station is set up inside of the barrier at [-32,40]

5) The sector was initially completely empty of all entities. No asteroids, no wrecks, no containers etc.

6) Can confirm that the config still has 'config.enableNPCTrading = true'

7) I have tried removing all existing docks from the merged complex station, exited build mode, entered build mode again and reapplied a single dock.

(...)

8 ) Looking at the logs when the station is constructed :

    Warning: Couldn't add script from stream: index is already taken

 

1-4) should not matter.

5) I'm not 100% certain, but the sector has to have the script :

"data/scripts/sector/traders.lua"

From a rough look at the sector generator-files the following sector-types support traders (or you could add the script yourself):

  • asteroidfieldminer
  • colony
  • factoryfield
  • gates
  • loneconsumer
  • lonescrapyard
  • loneshipyard
  • lonetrader
  • lonetradingpost
  • lonewormhole
  • miningfield
  • neutralzone
  • basefactories
  • lowfactories
  • midfactories
  • highfactories

 

6) while following my little guide, you made that obsolete

7) there is a vanilla script that periodicly adds those back (called "(...)/entity/regrowdocks.lua")

 

8 ) That always happens due to the mod adding that script twice, from both ends (client and server). Otherwise things would go out of synch, since the Multi-Thrading-Upgrade

 

Also I accidentally changed a little bit of code in 0.90c, which would prevent traders from spawning.

So I put the correct  /data/scripts/lib/tradingutility.lua as an attachment here

tradingutility.zip

Link to comment
Share on other sites

Well judging on an a -very- quick initial test of downloading the updated mod from GitHub and dirtily smashing them into the /data and /mods folders, it looks like you fixed it!

 

I'll do more thorough testing though.

 

Issues :

1) I have immediately noticed is that complex's do not have the `Buy/Sell Goods` menu item until one of the other menu options is chosen on the complex first. This resets each time you enter a new sector it seems. Doesn't seem breaking at the moment, I've had traders sell to complex's that I've not opened the menu for when jumping into the sector.

 

2) There is no chat notification that your complex's are buying or selling any items from traders. However there is a resource change notification and faction status change notification on the right of the screen when the complex's buy and sell.

 

2a update) There -is- a chat notification of complex station buy/sells if you are out-of-sector, but conversely there is -no- resource or faction notification on the right side of the screen.

 

3) I've had a couple of empty trade ships dock with a complex that does not buy goods. This complex has max stock of energy cells, yet zero stock of both other sellable items, warheads and scrap metal.

 

4) Existing complex's built before installing the mod do not seem to trade. This however could be because both existing 'old' complex's in my game are built in empty sectors and you've addressed this in your previous post.

 

5) Extending on 4) In an empty sector with an 'old' mine and an 'old' complex, the mine trades but the complex does not. This seems to indicate that the script 'traders.lua' is present(?). The complex is old however and existed before updating the mod.

 

 

I'll let you know if I encounter any breaking bugs and I might put a pull-request in for item 2) above if I get time to investigate more.

 

Cheers for fixing it so fast ! :)

 

Link to comment
Share on other sites

2a update) There -is- a chat notification of complex station buy/sells if you are out-of-sector, but conversely there is -no- resource or faction notification on the right side of the screen.
As far as I know, this is how Out-of-Sector sales work in vanilla behaviour, too.

 

2) There is no chat notification that your complex's are buying or selling any items from traders. However there is a resource change notification and faction status change notification on the right of the screen when the complex's buy and sell.
I'm curious about this, because I noticed that Alliances exhibit the exact same behaviour: no log in the Economy chat, but a notification on the right-hand side of the screen of a change in resources. I would love, love, for the Economy chat to be properly updated for Alliances also, so if this issue for this mod gets resolved, I'm guessing we'll be a step closer to that bugfix, too.
Link to comment
Share on other sites

Well judging on an a -very- quick initial test of downloading the updated mod from GitHub and dirtily smashing them into the /data and /mods folders, it looks like you fixed it!

 

I'll do more thorough testing though.

 

Issues :

1) I have immediately noticed is that complex's do not have the `Buy/Sell Goods` menu item until one of the other menu options is chosen on the complex first. This resets each time you enter a new sector it seems. Doesn't seem breaking at the moment, I've had traders sell to complex's that I've not opened the menu for when jumping into the sector.

 

2) There is no chat notification that your complex's are buying or selling any items from traders. However there is a resource change notification and faction status change notification on the right of the screen when the complex's buy and sell.

 

2a update) There -is- a chat notification of complex station buy/sells if you are out-of-sector, but conversely there is -no- resource or faction notification on the right side of the screen.

 

3) I've had a couple of empty trade ships dock with a complex that does not buy goods. This complex has max stock of energy cells, yet zero stock of both other sellable items, warheads and scrap metal.

 

4) Existing complex's built before installing the mod do not seem to trade. This however could be because both existing 'old' complex's in my game are built in empty sectors and you've addressed this in your previous post.

 

5) Extending on 4) In an empty sector with an 'old' mine and an 'old' complex, the mine trades but the complex does not. This seems to indicate that the script 'traders.lua' is present(?). The complex is old however and existed before updating the mod.

 

 

I'll let you know if I encounter any breaking bugs and I might put a pull-request in for item 2) above if I get time to investigate more.

 

Cheers for fixing it so fast ! :)

 

1) I noticed it too, while testing yesterday. Nothing big to worry about though

2-3) are vanilla behaviour. The complex mod just registers into the selection-list. No further changes to traders are made

4) I thought about manually adding that script, when a complex gets build and it's not present for the sector yet.

5) Mines are technically factories as well. And factories have their own trader script running in addition to the sector-wide one (which the complex mod uses)

Link to comment
Share on other sites

Thanks for the Mod and making npc traders work again. I tried to figure out how exactly the npc trade spawning works, maybe you have some insight. As I see it there are 3 reasons to built stations. Get Mats for turret building, get mats for manual trading for free and passivly generate money from npc traders. For passive money the complex seem to be actually worse than single stations in some situations as they only spawn as many traders as a single station would. This would mean that its better to only sell the most valuable stuff so the cargo ships dont waste their trip on energy cells, water etc. Or is it dependent on the amount of different ressources you sell?

Link to comment
Share on other sites

Thanks for the Mod and making npc traders work again. I tried to figure out how exactly the npc trade spawning works, maybe you have some insight. As I see it there are 3 reasons to built stations. Get Mats for turret building, get mats for manual trading for free and passivly generate money from npc traders. For passive money the complex seem to be actually worse than single stations in some situations as they only spawn as many traders as a single station would. This would mean that its better to only sell the most valuable stuff so the cargo ships dont waste their trip on energy cells, water etc. Or is it dependent on the amount of different ressources you sell?

 

There are 2 different ways  Traders spawn:

1) via the discussed Sector-script: traders.lua

2) Factories - and only factories - have a 2nd mechanic that allows them to spawn more traders:

In the config menu you can tell your factory to request and sell goods to traders. This mechanic will spawn additional traders. iirc this is independant of the contents of the sector and happens in /lib/tradingutility.lua (it is also dependand on the price margin)

 

Complexes for Money were ment to produce high tech goods that can be sold at many places:

Processors: guaranteed at every repair-station and some tradingposts

Mining robots, Anti-Grav Unit, Fusion generator, Drill: At many mines around the Galaxy

War Robots, Body Armor, Vehicle, electromagn. Charge ... etc. : At Militarty Outposts

Edit:

The complex mod is not updated for 0.16.x.

It is also undergoing a lot of behind the scenes changes, which will take a lot of time, so don't expect any fixes, when something breaks

Link to comment
Share on other sites

  • 4 years later...

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...