Starbound

Starbound

Upgradeable Lootbox (for modders)
This topic has been locked
swefpifh  [developer] 3 Jun, 2024 @ 2:42pm
Information to personalise your Loot Box
...
< >
Showing 1-4 of 4 comments
swefpifh  [developer] 3 Jun, 2024 @ 2:54pm 
⋮ rsRelicUpgradeStation.config INFORMATIONS
[Path : interface/rsRelicUpgradeStation/rsRelicUpgradeStation.config]

If you've added your own in-game currency, you'll be able to use it to upgrade your lootboxes.

The part of the file that interests you is this :
"upgradeCurrency": "rsRelicMoney",

The currency used for the mod is called ‘rsRelicMoney’. If you want to use the vanilla currency, replace the text with ‘pixel’. Or with the purple essences, replace the text with ‘essence’.

Exemple :

"upgradeCurrency": "pixel",

If you want to use your own currency, simply replace ‘rsRelicMoney’ with the item name of your own currency.
Last edited by swefpifh; 5 Jun, 2024 @ 4:55pm
swefpifh  [developer] 3 Jun, 2024 @ 3:01pm 
⋮ rsRelicUpgradeStation.config INFORMATIONS
[Path : interface/rsRelicUpgradeStation/rsRelicUpgradeStation.config]

Each upgrade level can be customised to define a price value.

The part of the file that interests you is this :
"upgradeCosts": { "upg1": 15, "upg2": 35, "upg3": 80 }

For example, to increase the lootbox to level, it will cost 15 of the configured currency. 35 for level 2 and 80 for level 3. You can change the values as you wish to define the upgrade prices yourself.

Exemple :

"upgradeCosts": { "upg1": 0, "upg2": 10, "upg3": 25 }

We can see that level 1 is free because it is set to 0. Then, to move on to level 2, it will cost 10. And 25 to continue to level 3.
Last edited by swefpifh; 5 Jun, 2024 @ 4:55pm
swefpifh  [developer] 3 Jun, 2024 @ 5:39pm 
⋮ YOURLOOTBOX.activeitem INFORMATIONS
[Path : items/relics/YOURLOOTBOX.activeitem]

We'll take a look at the ‘A2_relic’ lootbox to discuss the customisation options available.

A2_relic.activeitem
The part of the file that interests you is this :
{ "itemName": "A2_relic", "itemTags": ["upgradeableRelic"], "inventoryIcon": "relic_upg0.png", "image": "relic_upg0.png", "maxStack": 500, "rarity": "Common", "price": 20, "tooltipKind": "relicSystem2", "twoHanded": true, "shortdescription": "Relic A2", "category": "Improvement ^green;lvl 0^reset;", "description": "A festive relic. The more you upgrade it, the more items you'll have in your loots table.", "animation": "relics.animation", "animationCustom": {}, "scripts": ["relics.lua"], "fireTime": 0.5, "fireOffset": [1.0, 0.0], "poolFilePath": "/treasure/A2_relic.treasurepools", "builder": "/scripts/rsBuildRelics.lua", "upgradeLevel": 0, "treasure": { "pool": "A2_relic_upg0", "level": 1 }, "upgradeParameters": { "upg1": { "tooltipKind": "relicSystem3", "inventoryIcon": "relic_upg1.png", "rarity": "Uncommon", "price": 35, "category": "Improvement ^green;lvl 1^reset;", "upgradeLevel" : 1, "treasure": { "pool": "A2_relic_upg1", "level": 1 } }, "upg2": { "tooltipKind": "relicSystem4", "inventoryIcon": "relic_upg2.png", "rarity": "Rare", "price": 55, "category": "Improvement ^green;lvl 2^reset;", "upgradeLevel" : 2, "treasure": { "pool": "A2_relic_upg2", "level": 1 } }, "upg3": { "tooltipKind": "relicSystem5", "inventoryIcon": "relic_upg3.png", "rarity": "Legendary", "price": 80, "description": "^red;A festive relic. But one that can't be improved.^reset;", "category": "Improvement ^green;lvl 3^reset;", "upgradeLevel" : 3, "treasure": { "pool": "A2_relic_upg3", "level": 1 } } } }

TooltipKind
The text entered in this variable will define the visual preview on mouse-over. The number at the end of "relicSystem2" defines the number of items that your interface can display without visual problems. Here "2" allows two items to be displayed without any graphic problems.
In this mod, the limit is limited to 6 without display problems.

In "upgradeParameters", if you decide as above to note down the "tooltipKind" variable again: "relicSystem4" for example, this means that during your upgrade, the tooltip will be updated, here, for 4 items to be displayed.

UpgradeParameters
This is the section that will define the 3 possible upgrades to your lootbox. All the information added here will replace the information in the previous level.

For example, we can see that only UPG3 has a new "description" line:

"description": "^red;A festive relic. But one that can't be improved.^reset;",

This means that the first two enhancements will keep the basic information, and only the third enhancement will be updated.
Last edited by swefpifh; 4 Jun, 2024 @ 7:16am
swefpifh  [developer] 4 Jun, 2024 @ 8:48am 
⋮ rsRelicUpgradeStation.config INFORMATIONS
[Path : interface/rsRelicUpgradeStation/rsRelicUpgradeStation.config]

In order for Lootbox Relics to be displayed in the enhancement station interface, a specific Tag name is required.

The part of the file that interests you is this :
"upgradeItemTags": "upgradeableRelic",

The TAG used for the mod is ‘upgradeableRelic’. This Tag is linked to the itemTags variable in your YourLootbox.activeitem file. Here is the line to find:
‘itemTags’: [‘upgradeableRelic’],

Exemple :

YourUpgradeStation.config
"upgradeItemTags": "YourCustomTag",

YourLootbox.activeitem
‘itemTags’: [‘YourCustomTag’],
Last edited by swefpifh; 5 Jun, 2024 @ 4:55pm
< >
Showing 1-4 of 4 comments
Per page: 1530 50