A trader caravan usually consists of a trader, several carriers/packed animals, many guards, and maybe their prisoners. I'm making a JoyGiver for their people such that they should drop some silvers if one of their people followed the corresponding JobDriver.
This would involve 2 key parts:
1)How to check if the caravan has enough silvers(say, larger than k).
2)How to select the pawns with a certain combined total amount of silvers, and make them drop the silvers.
Unfortunately, I don't have many ideas on how to get these things done.
I wrote something like these:
IEnumerable<Pawn> guests = myColonistPawn.map.mapPawns.AllPawnsSpawned.Except(x=>x.Faction==null ||x.Faction==Faction.OfPlayer)
guests=guests.Where(x=>x.trader!=null && x.trader.Goods!=null)
Then,I'm lost... :'(
You can assign how much silver you want a caravan to carry, the def file is inside the "TraderKindDefs" there you can determine how much silver a trader would have
Well, what I asked is how to make them drop certain amount of silvers.. It's true one can determine how much silver they would have, but I'm coding c# and try to make them drop a desired number of silvers when members of a caravan perform some jobs in my colony.