BentoBoxWorld/Upgrades

Upgrading from a high island level

MarkusLee626 opened this issue · 8 comments

Description

Describe the bug

When an island is already above the minimum level of a tier, it jumps to that tier directly. For instance if tier 1 has a 100 minimum level and tier 2 has a 200 minimum level, a 300 level island will directly jump to tier 2 even though they haven't completed tier 1.

Steps to reproduce the behavior

  1. Create an island with 300 levels.
  2. Install Upgrade addon.
  3. Type /is upgrade.
  4. /is upgrade shows tier 2 instead of tier 1.

Expected behavior

If they haven't bought upgrades in tier 1 yet, they should start from tier 1 regardless of their island level being above another tier's minimum level.

Environment

Output of /bbox version (Mandatory)
12.07 16:18:27 [Server] Server thread/INFO Running SPIGOT 1.15.2.
12.07 16:18:27 [Server] Server thread/INFO BentoBox version: 1.13.1
12.07 16:18:27 [Server] Server thread/INFO Database: JSON
12.07 16:18:27 [Server] Server thread/INFO Loaded Game Worlds:
12.07 16:18:27 [Server] Server thread/INFO bskyblock_world (BSkyBlock): Overworld, Nether, The End
12.07 16:18:27 [Server] Server thread/INFO Loaded Addons:
12.07 16:18:27 [Server] Server thread/INFO Biomes 1.7.0 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO BSkyBlock 1.13.1 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO Challenges 0.8.2 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO ControlPanel 1.7.0 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO DimensionalTrees 1.6.0 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO Level 2.0.0 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO Limits 1.12.1 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO MagicCobblestoneGenerator 1.7.0.2 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO Upgrades 0.2.0-SNAPSHOT-b57 (ENABLED)
12.07 16:18:27 [Server] Server thread/INFO Warps 1.9.5 (ENABLED)

Plugins (Optional)

_______

Additional context (Optional)

I can't replicate it.

And I don't even see how it would be possible. Since it doesn't look for island level to select tier.

Can you show me your config file ?

Here's my config file. The island that I tested on had an island level of 22082. I installed the addon and it showed me tier 5 right away. Forgot to mention that the starting limit for spawners is 25, with the upgrades meant to upgrade up to 50. Screenshot attached as well.

# Config file for Upgrades addon

# Disabled Game Mode Addons
# IslandUpgrades will not work in these game modes
disabled-gamemodes: []

# Range Upgrade Default Tiers
# Each tier must contain:
#      max-level: Upgrade level up to which tier apply
#      upgrade-range: How much block is added to the range with each upgrade
#
# Each tier can contain:
#      island-min-level: Minimum level required to upgrade (if level addon is provided)
#      vault-cost: Money cost of upgrade
#      permission-level: Is the level of permission needed to upgrade
#         permission: "[GAMEMODE].upgrades.[UPGRADE].[LEVEL]"
#             Exemple for bskyblock with range-upgrade with a permission level of 2
#                 "bskyblock.upgrades.range-upgrade.2"
#
# Note: for upgrade-range, island-min-level and vault-cost:
#      Mathematical expression can be used (+,-,*,/,^,(,))
#      Mathematical function can be used (sqrt,sin,cost,tan)
#      Special value can be used:
#         [level] : Is the actual level for this upgrade
#         [islandLevel] : Is the islandLevel from level addon !!!!Can be 0!!!!
#         [numberPlayer] : Is the number of players in team
#
# Caution: You should always check that at max level, your players won't attain max range for island
# Permission upgrade name: rangeupgrade
#range-upgrade:
#  tier1:
#    max-level: 5
#    upgrade: "5"
#    island-min-level: "2"
#    vault-cost: "[level]*100"
#  tier2:
#    max-level: 10
#    upgrade: "3"
#    island-min-level: "4"
#    vault-cost: "[level]*[numberPlayer]*200"

# Permission upgrade name: limitsupgrade-[BLOCK]    -> In lower case
block-limits-upgrade:
  SPAWNER:
    # Permission upgrade name: limitsupgrade-hopper
    tier1:
      max-level: 5
      upgrade: "1"
      island-min-level: "1000"
      vault-cost: "[level]*100000"
    tier2:
      max-level: 5
      upgrade: "1"
      island-min-level: "5000"
      vault-cost: "500000+([level]*100000)"
    tier3:
      max-level: 5
      upgrade: "1"
      island-min-level: "10000"
      vault-cost: "[level]*1000000"
    tier4:
      max-level: 5
      upgrade: "1"
      island-min-level: "15000"
      vault-cost: "5000000+([numberPlayer]*500000)+([level]*1000000)"
    tier5:
      max-level: 5
      upgrade: "1"
      island-min-level: "20000"
      vault-cost: "([level]*10000000)+([numberPlayer]*1000000)"

# Permission upgrade name: limitsupgrade-[ENTITY]    -> In lower case
# entity-limits-upgrade:
  # CHICKEN:
    # # Permission upgrade name: limitsupgrade-chicken
    # tier1:
      # max-level: 2
      # upgrade: "1"
      # island-min-level: "2"
      # vault-cost: "[level]*100"
    # tier2:
      # max-level: 5
      # upgrade: "1"
      # island-min-level: "4"
      # vault-cost: "([level]-2)*[numberPlayer]*700"
      # permission-level: 3

# For the command section:
#     [player] : is the name of the player
#     [level] : is the level of the upgrade
# Permission upgrade name: command-[NAME]       -> In lower case + NAME != name:
# command-upgrade:
  # lambda-upgrade:
    # # Permission upgrade name: command-lambda-upgrade
    # name: "Lambda upgrade"
    # tier1:
      # max-level: 1
      # island-min-level: "2"
      # vault-cost: "[level]*100"
      # console: true
      # command:
        # - "say [player] has upgrade his lambda to level [level]"
    # tier2:
      # max-level: 2
      # island-min-level: "2"
      # vault-cost: "[level]*200"
      # console: true
      # command: 
        # - "say [player] has upgrade his lambda to level [level]"
        # - "say [player] has attained max"

# GameMode differences
# List any tiers that you want to add
# You can overwrite a tier by using the same name
#gamemodes:
#  BSkyBlock:

    # range-upgrade:
      # tier3:
        # max-level: 15
        # upgrade: "5"
        # island-min-level: "6"
        # vault-cost: "[level]*[numberPlayer]*500"

    # block-limits-upgrade:
      # HOPPER:
        # tier1:
          # max-level: 2
          # upgrade: "1"
          # island-min-level: "2"
          # vault-cost: "[level]*200"

    # entity-limits-upgrade:
      # CHICKEN:
        # tier1:
          # max-level: 2
          # upgrade: "1"
          # island-min-level: "2"
          # vault-cost: "[level]*200"

    # command-upgrade:
      # lambda-upgrade:
        # tier2:
          # max-level: 2
          # island-min-level: "2"
          # vault-cost: "[level]*200"
          # console: true
          # command:
            # - "say [player] has upgrade his lambda to level [level]"
            # - "say [player] has attained max on BSkyBlock"

# entity-icon:
  # CHICKEN: CHICKEN_SPAWN_EGG

# command-icon:
  # lambda-upgrade: GRASS

image

The problem is the max level. They are all the same.

The upgrade work with a level. It starts at 0 and each tier has a max level.
So if you have the first tier with a max level of 2, then you will need to buy 2 times the upgrade to get to the 2nd tier.

The problem here is that you used the same max level for each tier, so it doesn't know which one to pick.

I'm confused. So the max level is supposed to add up over the tiers? Taking this case for example where the spawner limit is meant to start at 25 and increasing at 5 levels every tier up to 50, are the max-levels for each tier then 5, 10, 15, 20, 25 respectively?

No, that's more like tier are adding up to level, The use of tier is to change the parameters when you reach a given level.

For example, an upgrade that increase by 5 the numbers of spawner on each upgrade, and when you buy it 5 times (level 5) you get to another tier where you get only 1 increase by upgrades and maybe more expensive.

You could technically have only one tier that goes up to level 15 for example. And so you could buy 15 times the upgrade

Hmm, I'm sorry but I think I'm confusing island level with the upgrade level. Are they meant to be the same thing? All I want to do is that people are allowed to upgrade their islands to fit more spawners, increasing 1 limit every time they buy an upgrade. Right now in the limits addon I have it set to 25 spawners, and the maximum I want people to go is 50. My understanding of the config was that "max-level" is the number of upgrades they can buy in that tier, "upgrade" is the number of spawners it will add per upgrade and "island-min-level" is the minimum island level before they can buy an upgrade in that tier. I set each tier to increase the price more every tier.

If you want to get to 50 by adding 5 by 5.
And with this config, you would need to set the max level to:
tier1: 5
tier2: 10
tier3: 15
tier4: 20
tier5: 25

The things is that level of the upgrade isn't reset between tiers. So when you start tier2, you are already level 5, so max level for tier2 need to be 10.

Got it. Thanks. Sorry for the false bug report.