Starbound

Starbound

Upgradeable Lootbox (for modders)
此主题已被锁定
swefpifh  [开发者] 2024 年 6 月 3 日 下午 2:42
Information to personalise your Loot Box
...
< >
正在显示第 1 - 4 条,共 4 条留言
swefpifh  [开发者] 2024 年 6 月 3 日 下午 2:54 
⋮ 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.
最后由 swefpifh 编辑于; 2024 年 6 月 5 日 下午 4:55
swefpifh  [开发者] 2024 年 6 月 3 日 下午 3:01 
⋮ 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.
最后由 swefpifh 编辑于; 2024 年 6 月 5 日 下午 4:55
swefpifh  [开发者] 2024 年 6 月 3 日 下午 5:39 
⋮ 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.
最后由 swefpifh 编辑于; 2024 年 6 月 4 日 上午 7:16
swefpifh  [开发者] 2024 年 6 月 4 日 上午 8:48 
⋮ 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’],
最后由 swefpifh 编辑于; 2024 年 6 月 5 日 下午 4:55
< >
正在显示第 1 - 4 条,共 4 条留言
每页显示数: 1530 50