Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LADX: Add "boots controls" option #2085

Merged
merged 12 commits into from
Apr 14, 2024

Conversation

zig-for
Copy link
Collaborator

@zig-for zig-for commented Aug 6, 2023

What is this fixing or adding?

Adds options for boots controls (open to better names...quick boots?)

class BootsControls(Choice):
    """
    Adds additional button to activate Pegasus Boots (does nothing if you haven't picked up your boots!)
    [Vanilla] Nothing changes, you have to equip the boots to use them
    [Bracelet] Holding down the button for the bracelet also activates boots (somewhat like Link to the Past)
    [Press A] Holding down A activates boots
    [Press B] Holding down B activates boots
    """
    option_vanilla = 0
    option_bracelet = 1
    option_press_a = 2
    option_press_b = 3

How was this tested?

Beyond the work done in the development (incl the better part of a day trying to figure out how to fit it all in LADX's original controls handler, was seriously short one byte), genned a seed and played around some. Feels good.

If this makes graphical changes, please attach screenshots.

Look ma, no boots equipped.
image

@zig-for zig-for changed the title Add boots controls LADX: Add "boots controls" option Aug 8, 2023
@ThePhar ThePhar added the is: enhancement Issues requesting new features or pull requests implementing new features. label Aug 16, 2023
worlds/ladx/Options.py Show resolved Hide resolved
@zig-for zig-for requested a review from ThePhar December 3, 2023 00:23
@zig-for
Copy link
Collaborator Author

zig-for commented Dec 3, 2023

Actually - don't merge this, it has a bug in multiworld gen, will fix

@Eijebong
Copy link

Eijebong commented Dec 3, 2023

We ran into this today:

Uncaught exception
Traceback (most recent call last):
  File "/home/eijebong/code/ap_emerald/Generate.py", line 653, in <module>
    multiworld = main()
                 ^^^^^^
  File "/home/eijebong/code/ap_emerald/Generate.py", line 239, in main
    return callback(erargs, seed)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/Main.py", line 418, in main
    future.result()
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/AutoWorld.py", line 140, in call_single
    raise e
  File "/home/eijebong/code/ap_emerald/worlds/AutoWorld.py", line 133, in call_single
    ret = _timed_call(method, *args, multiworld=multiworld, player=player)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/AutoWorld.py", line 119, in _timed_call
    ret = method(*args)
          ^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/ladx/__init__.py", line 474, in generate_output
    rom = generator.generateRom(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/ladx/LADXR/generator.py", line 247, in generateRom
    patches.core.addBootsControls(rom, ap_settings['boots_controls'])
  File "/home/eijebong/code/ap_emerald/worlds/ladx/LADXR/patches/core.py", line 559, in addBootsControls
    assembler.const(c, v)
  File "/home/eijebong/code/ap_emerald/worlds/ladx/LADXR/assembler.py", line 760, in const
    assert name not in CONST_MAP
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError
Exception in <bound method LinksAwakeningWorld.generate_output of <worlds.ladx.LinksAwakeningWorld object at 0x7f221346c210>> for player 13, named ThirstlaDX.
Traceback (most recent call last):
  File "/home/eijebong/code/ap_emerald/Generate.py", line 653, in <module>
    multiworld = main()
                 ^^^^^^
  File "/home/eijebong/code/ap_emerald/Generate.py", line 239, in main
    return callback(erargs, seed)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/Main.py", line 418, in main
    future.result()
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/AutoWorld.py", line 140, in call_single
    raise e
  File "/home/eijebong/code/ap_emerald/worlds/AutoWorld.py", line 133, in call_single
    ret = _timed_call(method, *args, multiworld=multiworld, player=player)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/AutoWorld.py", line 119, in _timed_call
    ret = method(*args)
          ^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/ladx/__init__.py", line 474, in generate_output
    rom = generator.generateRom(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eijebong/code/ap_emerald/worlds/ladx/LADXR/generator.py", line 247, in generateRom
    patches.core.addBootsControls(rom, ap_settings['boots_controls'])
  File "/home/eijebong/code/ap_emerald/worlds/ladx/LADXR/patches/core.py", line 559, in addBootsControls
    assembler.const(c, v)
  File "/home/eijebong/code/ap_emerald/worlds/ladx/LADXR/assembler.py", line 760, in const
    assert name not in CONST_MAP
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError
Exception in <bound method LinksAwakeningWorld.generate_output of <worlds.ladx.LinksAwakeningWorld object at 0x7f221346c210>> for player 13, named ThirstlaDX.

Might be the bug you were talking about. Bug only present with 2 people running LADX with the boots option on.

@ThePhar
Copy link
Member

ThePhar commented Dec 3, 2023

Actually - don't merge this, it has a bug in multiworld gen, will fix

I'd recommend making this PR as Draft then for now.

@zig-for
Copy link
Collaborator Author

zig-for commented Dec 4, 2023 via email

@zig-for
Copy link
Collaborator Author

zig-for commented Dec 6, 2023 via email

@ScipioWright ScipioWright added the waiting-on: author Issue/PR is waiting for feedback or changes from its author. label Feb 16, 2024
@zig-for
Copy link
Collaborator Author

zig-for commented Mar 26, 2024

Hey this is actually not waiting on author please merge it

@Exempt-Medic Exempt-Medic added waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. and removed waiting-on: author Issue/PR is waiting for feedback or changes from its author. labels Apr 5, 2024
@@ -757,7 +757,7 @@ def getLabels(self) -> ItemsView[str, int]:

def const(name: str, value: int) -> None:
name = name.upper()
assert name not in CONST_MAP
assert name not in CONST_MAP or CONST_MAP[name] == value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert name not in CONST_MAP or CONST_MAP[name] == value
assert name not in CONST_MAP or CONST_MAP[name] == value, "I'd recommend putting a message here, so that you get more than a mere AssertionError on webhost."

@Berserker66 Berserker66 merged commit ca5c0d9 into ArchipelagoMW:main Apr 14, 2024
15 checks passed
EmilyV99 pushed a commit to EmilyV99/Archipelago that referenced this pull request Apr 15, 2024
EmilyV99 pushed a commit to EmilyV99/Archipelago that referenced this pull request Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants