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

Issues with Texture translation #616

Open
chyzman opened this issue Nov 12, 2024 · 2 comments
Open

Issues with Texture translation #616

chyzman opened this issue Nov 12, 2024 · 2 comments

Comments

@chyzman
Copy link

chyzman commented Nov 12, 2024

I'm having issues trying to dump and then modify textures

[Error  :XUnity.AutoTranslator] An error occurred while dumping texture.
System.MissingMethodException: Method not found: 'Void UnityEngine.Texture2D..ctor(Int32, Int32)'.
   at XUnity.AutoTranslator.Plugin.Core.Extensions.ComponentExtensions.GetTextureData(Texture2D texture)
   at XUnity.AutoTranslator.Plugin.Core.TextureTranslationInfo.SetupHashAndData(Texture2D texture)
   at XUnity.AutoTranslator.Plugin.Core.TextureTranslationInfo.GetKey()
   at XUnity.AutoTranslator.Plugin.Core.AutoTranslationPlugin.DumpTexture(Object source, Texture2D texture)
   at XUnity.AutoTranslator.Plugin.Core.AutoTranslationPlugin.HandleImage(Object source, Sprite& sprite, Texture2D& texture, Boolean isPrefixHooked)

and

[Error  :XUnity.AutoTranslator] An error occurred while translating texture.
System.MissingMethodException: Method not found: 'Void UnityEngine.Texture2D..ctor(Int32, Int32)'.
   at XUnity.AutoTranslator.Plugin.Core.Extensions.ComponentExtensions.GetTextureData(Texture2D texture)
   at XUnity.AutoTranslator.Plugin.Core.TextureTranslationInfo.SetupHashAndData(Texture2D texture)
   at XUnity.AutoTranslator.Plugin.Core.TextureTranslationInfo.GetKey()
   at XUnity.AutoTranslator.Plugin.Core.AutoTranslationPlugin.TranslateTexture(Object source, Sprite& sprite, Texture2D& texture, Boolean isPrefixHooked, TextureReloadContext context)
   at XUnity.AutoTranslator.Plugin.Core.AutoTranslationPlugin.HandleImage(Object source, Sprite& sprite, Texture2D& texture, Boolean isPrefixHooked)

Game uses Unity 2022.3.20f1c1 and I'm using BepInEx 6.0.0-be.697
It doesn't dump anything so i tried generating a hash for the replacements manually and those don't work either

@ManlyMarco
Copy link
Collaborator

Looks like the game uses il2cpp and necessary constructors got stripped out. You could probably make it work in that specific game by changing the constructor calls seen in the stack trace to a different one and compiling your own build. What you need to change it to depends on that specific game, check interop assemblies for what is available.

@chyzman
Copy link
Author

chyzman commented Nov 13, 2024

interop assemblies? (sorry if this is an obvious question)

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

No branches or pull requests

2 participants