Jarno458 / SatisfactoryArchipelagoMod

A Satisfactory mod for the Archipelago Multiworld, disigned to be compatiable with the Satisfactory Mod Loader
https://ficsit.app/mod/Archipelago
Other
3 stars 0 forks source link

Fix generation issues with SpecailRange options #93

Closed Jarno458 closed 1 month ago

Jarno458 commented 3 months ago

Using percentage rolling for special named options causes generation to fail

  # Ship these Space Elevator packages to finish  
  final_elevator_tier:

    disabled: 0 # equivalent to 0
    one package (tiers 1-2): 50 # equivalent to 1
    two packages (tiers 1-4): 25 # equivalent to 2
    three packages (tiers 1-6): 0 # equivalent to 3
    four packages (tiers 7-8): 0 # equivalent to 4

  # Sink an amount of items totalling this amount of points to finish.
  # In the base game, it takes 208 coupons to unlock every unique crafting recipe, or 1813 coupons to purchase every non-producible item.
  # Use the TFIT mod or the Satisfactory wiki to find out how many points items are worth.
  # If you have Free Samples enabled, consider setting this higher so that you can't reach the goal just by sinking your Free Samples.
  final_resource_sink_points:
    disabled: 0
    50 coupons (~2M points): 0
    100 coupons (~18M points): 0
    150 coupons (~61M points): 0
    200 coupons (~145M points): 0
    250 coupons (~284M points): 50
    300 coupons (~493M points): 0
    350 coupons (~784M points): 0
    400 coupons (~1,2B points): 0
    450 coupons (~1,7B points): 0
    500 coupons (~2B points): 0
    550 coupons (~3B points): 0
    600 coupons (~4B points): 0
    650 coupons (~5B points): 0
    700 coupons (~6B points): 0
    750 coupons (~8B points): 0
    800 coupons (~9B points): 0
    850 coupons (~11B points): 0
    900 coupons (~13B points): 0
    950 coupons (~16B points): 0
    1000 coupons (~18B points): 0

Causes:

Uncaught exception
Traceback (most recent call last):
  File "T:\Git\Archipelago\Generate.py", line 425, in handle_option
    player_option = option.from_any(get_choice(option_key, game_weights))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "T:\Git\Archipelago\Options.py", line 702, in from_any
    return cls.from_text(str(data))
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "T:\Git\Archipelago\Options.py", line 734, in from_text
    return super().from_text(text)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "T:\Git\Archipelago\Options.py", line 657, in from_text
    return cls(int(text))
               ^^^^^^^^^
ValueError: invalid literal for int() with base 10: '250 coupons (~284m points)'