Ради вашего удобства наш сайт использует cookies! Узнать больше! Мы используем cookies

Simple Loot Box

This mod does not do anything on its own. It is more like a framework for other modders to make loot boxes with only XML-level modding knowledge. The idea and basic design of the loot box are originally from the mod LootBoxes - Rimworld Surprise Mechanics by OniJechto. The original mod scans through the game's defs and sets a mathematical curve to pick potential prizes based on their market values. This might not work very well for a heavily-modded game where hundreds of thousands of modded items may exist, and some may even have strict restrictions. Also, it does not include pawns as rewards. So, I rewrote the mod to allow a smaller pool of prizes and added many more functionalities to make the loot box more immersive and enjoyable. Incompatibilities? The only mod that might cause problems is Real Faction Guest, because it changes how the pawn generation is handled. If you need help making a loot box or want me to add more functions to this mod, you can leave a comment. I will see if I can do something. Language support: All strings in the code have been replaced with translation keys. The languages folder includes examples keyed in English and Simplified Chinese. This is a mod requested by NHUX, made by Verniy709. If you want to know how to make a loot box, please refer to the examples. These examples include all functions you might need to create a lootbox with different items, pawns, and themes. [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3479904886]https://steamcommunity.com/sharedfiles/filedetails/?id=3479904886[/url] Available parameters for loot boxes: CompProperties_LootBox lootBoxOpenSound: The sound effect played when entering the loot box opening screen. lootBoxSpinningSound: The sound effect played during the spinning. lootBoxBackgroundMusicSound: Background music for the loot box opening window. lootBoxBackgroundTexturePath: Background image for the loot box window. lootBoxOpenCost: The item required to open the loot box. It can be silver, a custom key, or any other item. lootBoxOpenCostCount: The number of items required to open the loot box. CompProperties_LootBox - lootBoxThingDef thingDef : The defName of items that can be obtained from the loot box. count: The quantity of the item to be generated. weight: The generation weight of this reward. stuff: If this item is stuffable, it will use the stuff specified here. quality: If the item has quality, it will use the specified quality here. effecterDef: An optional effect to play when this reward is generated. lootBoxFinalizingRewardSound: The sound effect played when this reward is selected. isHidden: Whether this item should be hidden from the visible reward list. If you want to surprise the player, set this to true. CompProperties_LootBox - lootBoxPawnKindDef pawnKindDef: The defName of a pawn that can be obtained from the loot box. count: The number of pawns to be generated. weight: The generation weight of this reward. effecterDef: An optional effect to play when this reward is generated. lootBoxFinalizingRewardSound: The sound effect played when this reward is selected. isHostile: Whether the generated pawn is hostile to the player. isHidden: Whether this item should be hidden from the visible reward list. If you want to surprise the player, set this to true. CompProperties_SpawnLootBox - lootBoxList thingDef: The loot box's defName, added to the global drop list for killing creatures; if you have a custom key item, consider adding it here as well. chance: The drop chance of this loot box after killing a creature. lootBoxSpawnGroup: To spawn a loot box every designated day in the game map(daysBetweenLootBoxSpawns), assign it to a lootBoxSpawnGroup. All loot boxes in the same group share the chance to spawn, based on their assigned weightInGroup. weightInGroup: The generation weight of this loot box in its group daysBetweenLootBoxSpawns: The frequency of spawning the loot box. daysBetweenLootBoxSpawns = 7, meaning spawn of a such a lootbox every 7 days in the game. All loot boxes in the same lootBoxSpawnGroup should have the same daysBetweenLootBoxSpawns