Closed rf886 closed 3 years ago
UABE supports reimporting assets (it's older and I don't know how many types can be reimported)
That's the issue, UABE only supports importing until 2019.2 and something got changed with 2019.4 that makes it unable to rebuild the assets. It would always be good to have 2 tools for import and export, if one is unable to code. Especially because this tool is called AssetStudio and not AssetExtractor.
Edit: That's not 100% true, I still got some TextAsset and MonoBehaviour mods working with 2019.4, but it was a bit tricky.
Yes, UABE can import but the problem is that it is not updated and has some problems, also as webfischi comments, it would be very useful to have 2 tools that allow importing, also for now the only tools that have worked well for me have been this and the UABE and if this had the function of importing it would undoubtedly be the best.
It's also possible with UnityPy, a python module based on the code of AssetStudio. An example can be found here.
That's waaayyy to complicated for a normal user, I even mentioned it in my comment. I'm okay with console commands, like >unitypy patch assets asset. But coding what I need first? It's already complicated enough to get anything working that was modded, and every game is different. Even if I would have a script, it wouldn't work with all games. The last game I patched, that used Unity 2019.4 I was able to create the assets with UABE, maybe because I just chagned a TextAsset and a MonoScript. Also I HATE Google Translate, it was used for Tabletop Simulator lately, about 70% was nonesense or misstranslated.
Well, it's a module for Python, a scripting language. The actual normal procedure is quite simple if one excludes the other stuff.
import UnityPy
# load Unity file
env = UnityPy.load(file_path)
# iterate over all objects in that file
for obj in env.objects:
# parse the obj
data = obj.read()
# filter the obj
if not data.type == "TextAsset":
continue
# patch the text
new_text = magic() # e.g. read it from a edited file
data.text = new_text
# save the change
data.save()
# save the changed Unity file
open(new_file_patch, "wb").write(env.file.save())
Using CLI to patch Unity files wouldn't work out that well, because different objects can have the same name or no name at all. So the user would have to input the object id, which is definitely not user-friendly either, especially when a lot of files have to be patched, e.g. as in the linked example, where a whole game is translated. (bad translated English is still better than a language one can't read and has to translate via a translator anyway)
AssetStudio could probably include a feature to patch in changed objects. While that itself shouldn't be too hard, it would still take quite a lot of time and would result in a lot of issues, requesting support for various object types.
That's the issue, UABE only supports importing until 2019.2 and something got changed with 2019.4 that makes it unable to rebuild the assets. It would always be good to have 2 tools for import and export, if one is unable to code. Especially because this tool is called AssetStudio and not AssetExtractor.
This is the issue I am currently frustrated about in UABE. I got one MonoBehaviour file that is 1752 bytes long. AssetStudio can read all 1752 bytes but UABE can only read the first 32 bytes. If only there is an import option in AssetStudio...
That's not directly the issue of UABE, it's just an issue of .dll handling. When you first open an Asset you have to either click on Tools and select "Get script information" or select a MonoBehaviour and click on View Data, and you will get a Pop Up: Click on "Yes" after that it needs A LOT of DLLs the issue is, that it somehow asks for a lot of files with .Test.dll You'll need to copy them out of the Managed Folder, and rename it, if needed. If the .dll doesn't exist, just skip it by clicking Cancel. You may need to click inside the file name box to see the whole name of the .dll. UABE looks for:
That's not directly the issue of UABE, it's just an issue of .dll handling. When you first open an Asset you have to either click on Tools and select "Get script information" or select a MonoBehaviour and click on View Data, and you will get a Pop Up: Click on "Yes" after that it needs A LOT of DLLs the issue is, that it somehow asks for a lot of files with .Test.dll You'll need to copy them out of the Managed Folder, and rename it, if needed. If the .dll doesn't exist, just skip it by clicking Cancel. You may need to click inside the file name box to see the whole name of the .dll. UABE looks for:
- Unity.Analytics.Tracker.dll (didn't came with the game, downloaded it, didn't throw an error)
- UniRx.Examples.dll
- UnityEngine.UI.Tests.dll
- Unity.Addressables.Tests.dll
- UnityEngine.TestRunner.dll
- UnityEngine.SpatialTracking.Tests.dll
- Unity.Analytics.DataPrivacy.Tests.dll
- Unity.RenderPipelines.Universal.Runtime.Tests.dll
- Unity.Recorder.Tests.dll
- Unity.RenderPipelines.Core.Runtime.Tests.dll
- Unity.ResourceManager.Tests.dll
- Unity.RemoteConfig.Tests.dll
- com.unity.cinemachine.Tests.dll (didn't need that, downloaded files only threw an error)
- Unity.TextMeshPro.Tests.dll
- Unity.2D.PixelPerfect.Tests.dll
- Unity.Postprocessing.Runtime.Tests.dll
- Unity.Analytics.Editor.dll (not needed)
I do know about this. One thing I forgot to mention: I already supplied the exact same DLL files to both AssetStudio and UABE. Strangely, only AssetStudio can completely open it. UABE can't, it outputs just those 32 bytes. Also, that "Unity.Analytics.Tracker.dll" threw 4 errors at me.
Edit: I found several MonoBehaviour files that cannot be read by UABE at all, even when the same assemblies are included!
Some MonoBehaviour files are also affected by this to a lesser extent. I've seen a MonoBehaviour file in UABE that outputs correct data but not as complete as what AssetStudio shown. Some of the variables are missing there. Also, I'm talking about modifying an APK that had all of its assemblies compiled (solved that, with Il2CppDumper), not a Windows executable.
P.S. I did several successful modifying attempts before.
It's also possible with UnityPy, a python module based on the code of AssetStudio. An example can be found here.
Yes, It seems that this script is to translate the texts, but the thing is that I already have the levels finished, the only thing I would like is a way to reintegrate them into the data.unity3d file without having to enter one by one, although this is not complicated In several games, in some there are more than 100 files and putting them in every time the game changes something is very time consuming, not to mention that webfischi is right, it is very complex for a common user.
It's also possible with UnityPy, a python module based on the code of AssetStudio. An example can be found here.
Yes, It seems that this script is to translate the texts, but the thing is that I already have the levels finished, the only thing I would like is a way to reintegrate them into the data.unity3d file without having to enter one by one, although this is not complicated In several games, in some there are more than 100 files and putting them in every time the game changes something is very time consuming, not to mention that webfischi is right, it is very complex for a common user.
Same. I'm dealing with 2700-ish files (all of them are asset files) and this will consume a lot of time.
Why has this been closed and then labled as question?
Come on, the problem still exists. UABE is getting more and more unreliable as time passes.
Hi, first of all, excellent program, great job, but I have a doubt: is it possible to re-import assets once modified? I have an asset text that I translated but now I don't know if it is possible to re-enter it in the project or how to do it.
for your attention thanks