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

Fix HandleInputSafe crashing in some games #531

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Fix HandleInputSafe crashing in some games #531

merged 1 commit into from
Jun 19, 2024

Conversation

ManlyMarco
Copy link
Collaborator

@ManlyMarco ManlyMarco commented May 2, 2024

In some cases input API can throw an InvalidOperationException, resulting in error spam on every frame. I don't see any reason to catch only specific Exceptions, they are logged and the end result is the same - Input API isn't usable.

Full exception message: System.InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.

In some cases input API can throw an InvalidOperationException, resulting in error spam on every frame.

Full exception message: System.InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
@astef89
Copy link

astef89 commented Jun 2, 2024

Hi can you help me? while I'm playing WITH PCBS2 translated into Italian I get an error when I do any tutorial you said that this error can be fixed how do you do it? thanks in advance

@ManlyMarco
Copy link
Collaborator Author

@astef89 If you get the error I mentioned then just clone this PR and build it.

@astef89
Copy link

astef89 commented Jun 2, 2024

@ManlyMarco I'm not very good at C# programming, do you have any suggestions for me? How can I do it? I already have all the Visual Studio 2022 tools and the source file... can you help me proceed? Thank you very much
LogOutput.log

@ManlyMarco
Copy link
Collaborator Author

This PR won't help in your case.

@astef89
Copy link

astef89 commented Jun 2, 2024

@ManlyMarco ah as I didn't say.:(can you tell me what causes that error? Is there a way when I play to deactivate automatic translation without crashing the game? an alternative solution please help me I'm desperate... I also tried the hot keys but they don't work.....

@ManlyMarco
Copy link
Collaborator Author

No idea what's exactly wrong, it depends on the game. Some of the other PRs may help.

@astef89
Copy link

astef89 commented Jun 2, 2024

@ManlyMarco Can you link them to me? I want to try them all, thank you very much

@ManlyMarco
Copy link
Collaborator Author

ManlyMarco commented Jun 2, 2024

Not sure what you want me to link, they are all on this repo https://github.com/bbepis/XUnity.AutoTranslator/pulls

There might be an update next week so if you don't know how to build code from PRs you could wait for that.

If you need help building the project in general I suggest asking on the BepInEx discord server.

@astef89
Copy link

astef89 commented Jun 2, 2024

Non sono sicuro di cosa vuoi che colleghi, sono tutti su questo repository https://github.com/bbepis/XUnity.AutoTranslator/pulls

Potrebbe esserci un aggiornamento la prossima settimana, quindi se non sai come creare codice dai PR potresti aspettarlo.

Se hai bisogno di aiuto per costruire il progetto in generale ti suggerisco di chiedere sul server Discord di BepInEx.

@ManlyMarco if you tell me that an update will be released next week I will wait very patiently... Meanwhile I'm having fun converting your PR IN DLL To try maybe I can solve it but as said it's a whole new world for me... what great news I'm really hoping for an update next week

@astef89
Copy link

astef89 commented Jun 2, 2024

@ManlyMarco I looked at the log file...and I really think that with your fix I should solve it, I hope so, thank you very much for answering everything

[Warning:XUnity.AutoTranslator] Input API is not available!
System.TypeLoadException: Could not load type 'UnityEngine.Input' from assembly 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
at XUnity.AutoTranslator.Plugin.Core.AutoTranslationPlugin.HandleInput()
at XUnity.AutoTranslator.Plugin.Core.AutoTranslationPlugin.HandleInputSafe()
[Info :XUnity.AutoTranslator] Skipping plugin scan because no plugin-specific translations has been registered.
[Error :XUnity.AutoTranslator] Error occurred during translation.
System.NullReferenceException: Object reference not set to an instance of an object.

@VelhoZagaia
Copy link

I'm playing adventure quest 3d, at first everything went well, but a few minutes later the game crashes when starting dialogues with NPCs.

@ManlyMarco ManlyMarco merged commit e3d6ab1 into bbepis:master Jun 19, 2024
@ManlyMarco ManlyMarco deleted the patch-1 branch June 19, 2024 15:51
@astef89
Copy link

astef89 commented Jun 19, 2024

@ManlyMarco Hi friend, when will the next update come out? I'm looking forward to it...thanks you

@ManlyMarco
Copy link
Collaborator Author

This + #467 should resolve most issues with input not working, but if the game uses the new input system it won't work yet until #329 is fixed.

@ManlyMarco
Copy link
Collaborator Author

@ManlyMarco Hi friend, when will the next update come out? I'm looking forward to it...thanks you

Now.

@astef89
Copy link

astef89 commented Jun 19, 2024

@ManlyMarco thank you, thank you... as soon as I get home I'll try the new update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants