[1.3] [KV] Adjustable Trade Ships [ModSync RW]

Started by Kiame, April 25, 2018, 12:42:15 AM

Previous topic - Next topic

Kiame


Kiame

Easy enough to fix the error but the mod no longer works. Something changed under the hood and I'll need to do a deeper dive. I'll hopefully have this fixed tomorrow (Saturday)

Kiame

#32
[1.0] Update
The underlying game code that handles trade routes changed. It no longer used Mean Time Between events to track trade ships and instead uses an On/Off Cycle

New settings:
On Days - The number of days orbital traders can appear on
Off Days - The number of days orbital traders will not appear on
Min Instances - Minimum number of of orbital traders that will happen over the On/Off cycle
Max Instances - Maximum number of orbital traders that will happen over the On/Off cycle

Don't be thrown off by the 'days' word. Under the hood, if i'm understanding it correctly, it's used as a percent chance the event will happen. Roughly speaking...
On Days = 7
Off Days = 8
There's a 47% chance over a 15 day period that a trade ship will spawn at any time (this is very rough and there's a lot more to the calculation but this hopefully gets the concept across). Over those 15 days there will be only 1 trade ship.


Notes:
-The easiest way to increase trade ship frequency is to increase the minimum and maximum instances per period of days. 100/100 will spawn the max (4) trade ships very quickly
-The easiest way to decrease trade ships is increase the On Days and Off Days. 1000 & 1000 will basically mean there will be 1 ship sometime in 2000 game days.


Ally Interaction have also changed and I have removed those settings for the time being.

NeoSono


Canute

Any new week a new discovery challenge for Kiame. :-)

Kiame

I found number inputs were a little harder than I liked. They've been improved. I'll probably hold off on releasing a new version though until I have ally interactions in

Syrchalis

It gives a null reference error if you want to start a game with HugsLib quickstart so essentially it disables the feature, because the map won't load.
For mod support visit the steam pages of my mods, Github or if necessary, write me a PM on Discord. Usually you will find the best help in #troubleshooting in the RimWorld discord.

Diedel

Quote from: Syrchalis on July 29, 2018, 03:01:29 PM
It gives a null reference error if you want to start a game with HugsLib quickstart so essentially it disables the feature, because the map won't load.

I think it changed yet again, now it is only <numIncidentsRange>1</numIncidentsRange> instead of min/max instances, the on/off days seems the same.

Kiame

#38
Quote from: Diedel on July 29, 2018, 03:08:52 PM
Quote from: Syrchalis on July 29, 2018, 03:01:29 PM
It gives a null reference error if you want to start a game with HugsLib quickstart so essentially it disables the feature, because the map won't load.

I think it changed yet again, now it is only <numIncidentsRange>1</numIncidentsRange> instead of min/max instances, the on/off days seems the same.

numIncidentsRange is a FloatRange. numIncidentsRange of 1 translated to a constant of FloatRange.One which is Min and Max of 1.

Kiame

Quote from: Syrchalis on July 29, 2018, 03:01:29 PM
It gives a null reference error if you want to start a game with HugsLib quickstart so essentially it disables the feature, because the map won't load.

Just tested w/ quickload and it worked on my side. Can you give me the NPE you got and i'll take a look?

Syrchalis

Very odd, it works now, but it hadn't before. Thought it might be related to not having loaded a game before but that wasn't it. Maybe one has to set the options to anything (or at least open them to create a config file?).
For mod support visit the steam pages of my mods, Github or if necessary, write me a PM on Discord. Usually you will find the best help in #troubleshooting in the RimWorld discord.

Kiame

I hopefully caught those edge cases. Of anyone else has an error pls include the error  :)

xion1088



So if I set it up like this, will I get at least 2 trade ships every day. expect one day, for a period of 15 days? Does another period start after that one is finished?

Kiame

heh i need to fix the second min instances to max instances
Your setting there means over each 15 day period 2 to 4 ships will show up where 1 day none will have a chance to show up

xion1088

I see, any way to make it so every "On" day at least 2 ships show up? Like min ships per "On" day and max ships per "On" day.