From 89c15f5c16a23b2fff1cad19fdaf2f793462f78f Mon Sep 17 00:00:00 2001 From: massimilianodelliubaldini <8584296+massimilianodelliubaldini@users.noreply.github.com> Date: Sun, 12 May 2024 16:05:36 -0400 Subject: [PATCH] Jak 1: quick fix to settings. --- worlds/jakanddaxter/Client.py | 2 +- worlds/jakanddaxter/__init__.py | 14 +++++++++++++- worlds/jakanddaxter/docs/setup_en.md | 12 +++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/worlds/jakanddaxter/Client.py b/worlds/jakanddaxter/Client.py index 3b6e0f7bfe..b6e982a9e3 100644 --- a/worlds/jakanddaxter/Client.py +++ b/worlds/jakanddaxter/Client.py @@ -129,7 +129,7 @@ class JakAndDaxterContext(CommonContext): async def run_game(ctx: JakAndDaxterContext): exec_directory = "" try: - exec_directory = Utils.get_settings()["jakanddaxter_options"]["exec_directory"] + exec_directory = Utils.get_settings()["jakanddaxter_options"]["root_directory"] files_in_path = os.listdir(exec_directory) if ".git" in files_in_path: # Indicates the user is running from source, append expected subdirectory appropriately. diff --git a/worlds/jakanddaxter/__init__.py b/worlds/jakanddaxter/__init__.py index a7a32a76a7..75a87c9dbf 100644 --- a/worlds/jakanddaxter/__init__.py +++ b/worlds/jakanddaxter/__init__.py @@ -1,3 +1,6 @@ +import typing +import settings + from BaseClasses import Item, ItemClassification, Tutorial from .GameID import jak1_id, jak1_name from .JakAndDaxterOptions import JakAndDaxterOptions @@ -10,6 +13,14 @@ from ..AutoWorld import World, WebWorld from ..LauncherComponents import components, Component, launch_subprocess, Type +class JakAndDaxterSettings(settings.Group): + class RootDirectory(settings.UserFolderPath): + """Path to folder containing the ArchipelaGOAL mod.""" + description = "ArchipelaGOAL Root Directory" + + root_directory: RootDirectory = RootDirectory("D:/Files/Repositories/ArchipelaGOAL") + + class JakAndDaxterWebWorld(WebWorld): setup_en = Tutorial( "Multiworld Setup Guide", @@ -27,7 +38,7 @@ class JakAndDaxterWorld(World): """ Jak and Daxter: The Precursor Legacy is a 2001 action platformer developed by Naughty Dog for the PlayStation 2. The game follows the eponymous protagonists, a young boy named Jak - and his friend Daxter, who has been transformed into an "ottsel." With the help of Samos + and his friend Daxter, who has been transformed into an ottsel. With the help of Samos the Sage of Green Eco and his daughter Keira, the pair travel north in search of a cure for Daxter, discovering artifacts created by an ancient race known as the Precursors along the way. When the rogue sages Gol and Maia Acheron plan to flood the world with Dark Eco, they must stop their evil plan @@ -39,6 +50,7 @@ class JakAndDaxterWorld(World): required_client_version = (0, 4, 5) # Options + settings: typing.ClassVar[JakAndDaxterSettings] options_dataclass = JakAndDaxterOptions options: JakAndDaxterOptions diff --git a/worlds/jakanddaxter/docs/setup_en.md b/worlds/jakanddaxter/docs/setup_en.md index 102e5006eb..ce2b193677 100644 --- a/worlds/jakanddaxter/docs/setup_en.md +++ b/worlds/jakanddaxter/docs/setup_en.md @@ -35,10 +35,16 @@ At this time, the only supported method of setup is through Manual Compilation. ## Starting a Game - Open 3 Powershell windows. If you have VSCode, you can run 3 terminals to consolidate this process. - - In the first window, navigate to the Archipelago folder using `cd` and run `python ./Launcher.py`. + - In the first window, navigate to the Archipelago folder using `cd` and run `python ./Launcher.py --update_settings`. Then run it again without the `--update_settings` flag. - In the second window, navigate to the ArchipelaGOAL folder and run `task extract`. This will prompt you to tell the mod where to find your ISO file to dump its contents. When that is done, run `task repl`. - In the third window, navigate to the ArchipelaGOAL folder and run `task boot-game`. At this point, Jak should be standing outside Samos's hut. - - You can now close all these windows + - Once you confirm all those tasks succeeded, you can now close all these windows. +- Edit your host.yaml file and ensure these lines exist. And don't forget to specify your ACTUAL install path. If you're on Windows, no backslashes! +``` +jakanddaxter_options: + # Path to folder containing the ArchipelaGOAL mod. + root_directory: "D:/Files/Repositories/ArchipelaGOAL" +``` - In the Launcher, click Generate to create a new random seed. Save the resulting zip file. - In the Launcher, click Host to host the Archipelago server. It will prompt you for the location of that zip file. - Once the server is running, in the Launcher, find the Jak and Daxter Client and click it. You should see the command window begin to compile the game. @@ -73,7 +79,7 @@ Offline play is untested at this time. ### Known Issues -- I've streamlined the process of connecting the client's agents to the game, but they are temperamental and I am bad at asynchronous programming. +- I've streamlined the process of connecting the client's agents to the game, but it comes at the cost of more granular commands useful for troubleshooting. - The game needs to run in debug mode in order to allow the repl to connect to it. At some point I want to make sure it can run in retail mode, or at least hide the debug text on screen and play the game's introductory cutscenes properly. - The client is currently not very robust and doesn't handle failures gracefully. This may result in items not being delivered to the game, or location checks not being delivered to the server. - The game relates tasks and power cells closely but separately. Some issues may result from having to tell the game to check for the power cells you own, rather than the tasks you completed. \ No newline at end of file