Open DT-is-not-available opened 1 year ago
I don't have a fix yet for the bug you're encountering, but a piece of advice: you can use Data.Code.ByName("gml_Object_obj_renderer_Draw_75")
rather than a separate for loop over every entry.
Alright, thank you for the advice and for responding quickly. Is there any other workaround I can use until this is fixed without having the UndertaleModTool GUI visible?
Well, looking at the error now, it seems like the script increased the size of the data file, but the CLI didn't remember to apply that change to the FORM header. I suppose the GUI version handles it automatically, but if you can find the exact value and change it manually, it might work. I'll trace the save process on both versions later.
Alright, thanks for helping. A few more things and then I will leave you alone. Any idea if it's possible to do that within the script, and if so what value would I need to change? Or would I need to edit the file directly after it saves (at which point is there a specific location I should search for, or just find the bytes containing the value of the old filesize)
It's probably possible to do within the script, but I don't know where the structure of Data.FORM
is defined. Editing the file in post is also probably possible; I would guess that it's the second four bytes after "FORM", but you should check yourself. There can only be so many "23870302" uint32 values in a file.
Alrighty, thanks for all the help!
I did some more experimenting, and it appears that this error does not occur if you delete the output file before saving, and replacing the uint32 that contains the file size does not fix the runtime error originally provided. Not sure what is going on here, but removing the old output file before writing to it seems to work.
It could be that the prompt to launch the game is running asynchronously with UndertaleModCLI, such that the file it starts loading is different to the one it finishes? Glad you found something that works.
It could be that the prompt to launch the game is running asynchronously with UndertaleModCLI
If it is that case, OP, I suggest to do start /wait UndertaleModCLI
(note that this may open a new window, but that should be avoidable with extra command switches)
I am running UndertaleModCLI synchronously (which causes the window to display not responding while its running but thats an unrelated issue in the fact that it's running synchronously). I will try adding a delay between UntertaleModCLI closing and starting the game to see if that changes anything. (Forgot to mention an external program is controlling this now, I'm no longer using the batch file provided.)
I did some more experimenting, and it appears that this error does not occur if you delete the output file before saving,
I thought i was the only one having that weird bug. It seems like the lib has some edge case where overwriting the original file doesnt work - something the gui also works around by just saving to a temp file first and then copying the temp file to the original.
Describe the bug
using UndertaleModCLI with the arguments
UndertaleModCLI.exe load "data.win" -s "main.csx" -o "mod.win"
, and running a script that only uses AppendGML to add code to the game, running the modded game will either completely refuse to launch, or display this error message:running the script through the GUI works just fine, and it modifies and saves the game correctly, and you should get the error described above. i am trying to make a mod loader GUI for a gamemaker game that downloads and installs mods, and it uses this as the compiler/backend, so the CLI is really necessary.
Reproducing steps
echo Patching data.win path/to/UndertaleModCLI.exe load "data.win" -s "main.csx" -o "mod.win" echo Launching game... circloo2.exe -game "%cd%\cylindoO\mod.win"
pause
and place it in the same directory
Setup Details