[1.0] Auto Seller - (v2.0.4.2) (13-12-2019)

Started by Supes, July 14, 2015, 05:03:35 PM

Previous topic - Next topic

Litcube

All of the kevlar helmets were 100% health.  Quality ranged from good to superior.

Litcube

For whatever it's worth, it's working again.  Either it's because of a quit/reload, or because I remade the rule itself, I'm not sure.

Supes

Np, I'll still work on replicating the bug though.

It might be because of a rule overlap (recreating the rule would put it at the bottom of the list, so it executes last).


Litcube

So the rules aren't independent of themselves?  I assumed that autoseller just goes down the list from top to bottom selling according to the rules.

Supes

they are independent, improved stacking creates a secondary list for items that are valid for that rule, it then sets or pivots(reduces sell/buy amount in case of lack of silver, so silver and items are not lost) the trade amount before moving to the next rule.  in the case of 'any' type rules, it goes over each of the thingsdefs in that category (and subcategories if allowed) using the values either on the main rule or advanced rule if present, and skipped if advanced rule excludes the item.

not to worry though, I'm mainly speculating whether there was an overlap from an 'any' rule, where it might have been set/pivoted after it's been set.

Supes

#170
I think I found it, to do with tracking multiple stacks (definitely not an overlap).  also, I've added additional code for items that have multiple categories, so cheese should work now.  Hopefully sync messages should appear be less now.

I've introduced AI Trade Reports, that will get after the AI trades with a ship or caravan, that way you will know what you've bought or sold.






1.1.1.7
AI Trade reports
AI tweaks and improvements
Fix for multi stacks not tracking
Fix for items that have multiple categories

Litcube

Nice!

Well done on the AI report.  Gonna update now.

lc-soz


Litcube

I'm getting this now, whenever my pawn sells automatically:

Pawn Emma threw exception while executing toil's finish action (0), curJob=JobDriver_AutoSell A=Thing_CommsConsole9154622: System.NullReferenceException: Object reference not set to an instance of an object
  at RWAutoSell.ASTrade+<>c.<SetTradables>b__10_5 (RimWorld.Tradeable el) [0x00000] in <filename unknown>:0
  at System.Linq.SortSequenceContext`2[RimWorld.Tradeable,System.String].Initialize (RimWorld.Tradeable[] elements) [0x00000] in <filename unknown>:0
  at System.Linq.QuickSort`1[RimWorld.Tradeable].PerformSort () [0x00000] in <filename unknown>:0
  at System.Linq.QuickSort`1+<Sort>c__Iterator21[RimWorld.Tradeable].MoveNext () [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[RimWorld.Tradeable,RWAutoSell.Defcountpair].MoveNext () [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.Count[Defcountpair] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
  at RWAutoSell.ASTrade.SetTradables (System.Collections.Generic.List`1& cachedTradeables, System.Collections.Generic.List`1& Bought, System.Collections.Generic.List`1& Sold, System.Int32& Currency) [0x00000] in <filename unknown>:0
  at RWAutoSell.ASTrade.CreateTrade (ITrader Ship, Verse.Pawn pawn, Boolean ShowReport) [0x00000] in <filename unknown>:0
  at RWAutoSell.ASTrade.TradeAllShips (Verse.Pawn pawn) [0x00000] in <filename unknown>:0
  at RWAutoSell.JobDriver_AutoSell.<MakeNewToils>b__4_2 () [0x00000] in <filename unknown>:0
  at Verse.AI.Toil.Cleanup () [0x00000] in <filename unknown>:0

Supes

#174
think I found the bug, because I sorted the information by category, furniture don't usually have a category, and they mess the sorting up. I had no sculptures in storage during testing so I didn't pickup on the error.  I've updated my links.

I may have to include you guys in the credits list for your help reporting bugs :)

atm the reports are more accuratly just notifications, summrised by Item type, I'll hopefully expand this later on into something more.

1.1.1.7b
Fix for Building type rules causing errors in reports

Supes

I've relaxed some of my loading code to see if that helps with one of the more random bugs. The bug is fairly difficult to track down due to the fact it doesn't appear every time, however I'm fairly certain it isn't a bug with the main trading algorthm.







1.1.1.8
Relaxed config loading events
Added 'Communication Hub' Room Def

Supes

Well the A16 update has caused me a coding nightmare, no part of my mod was left untouched, and the change to the map completely broke the way my mod saves and retrieves its rules.

So the biggest change I've made is that a Trading Printer will now need to be built in order to store these rules.  On the plus side, if you have multiple colonies, each with Trading Printers, the AutoSell overview window will now show tabs for each of these colonies.

you can also create shopping lists that you can take with your caravans (note that at the moment, Shopping Lists will apply rules only to what your caravan and the other faction is carrying, so doesn't account for what's back at the main base)

since this mod now changes the Caravan object (so it can show my version of the trade dialog), if you're using the Set-Up Camp Mod, load AutoSeller after it, and some reflection magic will make them work together.







1.1.2.0
RuleSets are now bound to certain objects
Trade Printer added
Shopping List added
Autosell tab changes for multiple colonies
Behaviour Dialog settings are separate for each colony
Modified CaravanMeeting Incident
Modified Caravan object
Added Compatibility for Set-Up Camp Mod (check load order)

dismar


Proximity_Microwave

Thank you very much Supes for all the work you put into this mod. I'm excited to try the update.

WoodyDaOcas

Looks great, thank you :)
Just found this out (as I started playing..) do you think it can be adapted for a caravan equipment settings ? Like, select pawns, select "basic stuff you want on every trip" kinda thing. Ty