cabarius / ToyBox

Toy Box is a cute and playful mod with 500+ cheats, tweaks and quality of life improvements for Pathfinder: WoTR. It was created in the spirit of Bag of Tricks & Cheat Menu but with a little different focus . It of a powerful and convenient way to edit the party composition, stats, search and add Feats, Features, Items, etc. to party members.
MIT License
168 stars 110 forks source link

Controller + SteamDeck Support for ToyBox #999

Open Tsmith76 opened 1 year ago

Tsmith76 commented 1 year ago

Description of the bug

I am able to open up Toybox, verifying that it works, and continue playing - with an additional complication. I can no longer use the in-game map. There are no longer any icons, including for NPCS or exits, and I cannot click on it to move around. It also cannot be closed by pressing B any longer - instead requiring me to use trigger to open up a different screen (Inventory, Journal, etc) which can then by closed by B normally.

Steps To Reproduce

Open map using specific key, or via Right Trigger -> Map.

Expected Behavior

Map would have normal functionality.

Log Files

No response

Save File

No response

Screenshots

No response

Settings

No response

Toybox Version

Most Recent Update (1.5.5a)

Operating System

Steam Deck - Linux

What game are you using Toybox on?

Pathfinder Wrath of the Righteous

Game Version

2.1.4w

Anything else?

This relates to the Hardcoded PCView paths in the game object hierarchy and the patches we do on PCView classes. We need to decide for each of those (~400) case by case on how to handle them to allow for Console (Controller + SteamDeck) support.

xADDBx commented 1 year ago

Logs please

Tsmith76 commented 1 year ago

Sorry for the ignorant noob question, but do you mean Logs as in the text that is generated under the UMM menu - between Mod and Settings? Or am I looking elsewhere - again, my apologies, just want to make sure I get the correct info.

xADDBx commented 1 year ago

The game produces 2 different log files while it is running. Follow your steps to produce the bug and then send the log files here. They are called GameLogFull.txt and Player.log and are (On Windows) located in %USERPROFILE%\AppData\LocalLow\Owlcat Games\Pathfinder Wrath of the Righteous\

Tsmith76 commented 1 year ago

Thanks for your patience. Had to do some hunting to find the equivalent folder on Steam Deck. GameLogFull.txt Player.log

xADDBx commented 1 year ago

Can you disable/temporarily uninstall BubbleBuffs and see if it still occurs?

Tsmith76 commented 1 year ago

It does still occur. I tried dropping both scalable cantrips and enable achievements as well, but one of them is preventing me from loading save files if it's not present - haven't determined which one yet.

xADDBx commented 1 year ago

Scaling Cantrips creates a dependency; enable achievements should be unnecessary if you turn on the toggle in ToyBox?

Can you send your logs again without BubbleBuffs after triggering the bug?

Tsmith76 commented 1 year ago

Here you are - logs after both Bubblebuffs and Enable Achievements have been chucked in the toilet. GameLogFull (1).txt Player (1).log

xADDBx commented 1 year ago

Okay so I identified the issue. ToyBox has some problems with Controllers. Specifically the UI scene is different when you play with a Controller vs when you play with M+KB. I'll try and see if I can fix it in time. Thanks for reporting

Tsmith76 commented 1 year ago

Thank you!

sahiljuneja commented 1 year ago

Facing this issue as well with an Xbox controller on the latest version of the game (2.1.5r) and toybox (1.5.6), if any of that information helps. Thank you for looking into this!

evandixon commented 1 year ago

I encountered this too, specifically the issue with the map.

I wonder, what specifically interferes with it? Depending on how fundamental it is to the other features, perhaps a temporary workaround would be to feature switch whatever needs to interact with that scene? As someone who hasn't looked too closely at the code, seems like most of the mod is confined to the UMM window unless enabled as a separate setting.

As an aside to anyone else who has the issue, the broken map can be closed with the View button (the one with the squares next to the dpad). No need to switch to a different menu as described in the original post.

xADDBx commented 1 year ago

I wonder, what specifically interferes with it? Depending on how fundamental it is to the other features, perhaps a temporary workaround would be to feature switch whatever needs to interact with that scene? As someone who hasn't looked too closely at the code, seems like most of the mod is confined to the UMM window unless enabled as a separate setting.

@evandixon short explanation:

  1. The game uses different classes and UI hierarchy paths for pc and console (UI on PC with Keyboard uses PCView classes, on other stuff it's ConsoleView).
  2. There's a bit of stuff here and there that's need to change. The thing specifically breaking the game (and not just mod functions) are the patches. Basically the mod replaces/adds code to game functions expecting interactions with a PCView. A ConsoleView will then cause those functions to behave unexpectedly.
gpimlot commented 1 year ago

Was a solution to this ever found? Having the same problem atm

xADDBx commented 1 year ago

Was a solution to this ever found? Having the same problem atm

You can somehow force the game on SteamDeck to start in Keyboard mode (at least I've heard somebody do that). Doing so mean, that, while you can't use a controller, ToyBox should run.

Otherwise, the mod needs a significant rewrite which none of the Contributor currently have the time for.

gpimlot commented 12 months ago

Okay, appreciate the info

tpkee commented 10 months ago

I have the same problem too even though I have no toy box related feature enabled. It's very annoying and game breaking

evandixon commented 9 months ago

I'm starting to take a look. Commenting out all of MonkeyPatchin/EnhancedUI/LocalMap.cs plus the parts of MonkeyPatchin/BagOfTricks/CameraWrath.cs/CameraPatches.CameraRigPatch.TickScroll that reference it is enough to fix the map, though idk what I broke by doing that. I'll spend some more time playing with this, but hopefully this helps narrow it down if I end up forgetting about this and do nothing for months again.

[Update] I narrowed it down to LocalMapPatches.SetDrawResult, starting at "// Now ToyBox wants to rock your world. We grab various transforms "

[Update 2] A simple try/catch is good enough to get the map working again. The underlying cause is that UIHelpers tries finding PCView transforms without checking for nulls

xADDBx commented 9 months ago

Thanks to @evandixon the ingame map should work in the next Wrath Release (1.5.10 I'd guess?). I'll leave this open since it encompasses complete console support (which still isn't something we'll actively pursue), but the issue of the creator should be resolved with this?

tpkee commented 9 months ago

Thanks to @evandixon the ingame map should work in the next Wrath Release (1.5.10 I'd guess?). I'll leave this open since it encompasses complete console support (which still isn't something we'll actively pursue), but the issue of the creator should be resolved with this?

Isn't the next patch months away? Is it possible to make it work for this release?

xADDBx commented 9 months ago

@tpkee I was talking about the next ToyBox update. I already released that ok the official discord (mod-updates channel). I don't know when Narria will publish it on Nexus.

tpkee commented 9 months ago

I see, thank you!