Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - vonfrank

#1
Quote from: Red04SWBF on March 04, 2024, 08:30:24 AMOh okay then.

Did you find the way to modify the names? Not long ago I was interested in doing something similar to you (using the stock Mace Windu as a playable unit, and then showing his respective tag).

So, slow reply... but No, I still haven't figured out how to modify the names of the custom heroes.

Also, I double checked my friend's installation. It is completely correct. And on top of that, the new heroes work perfectly for him in SinglePlayer, but we both have crashes the second the heroes attempt to spawn in MP.

There's gotta be some additional modification required specifically in the MP environment that I'm missing.
#2
Quote from: Led on March 04, 2024, 12:09:44 AMmake sure your friend installed it correctly

I'll double check his installation. The strange thing is though, despite many modifications to the stock game's side files, only heroes caused a crash. We played for hours on various stock and modded maps with heroes turned off with no issues.

Quote from: Red04SWBF on March 04, 2024, 07:12:16 AMIt should work correctly as long as you have the same files. By the way, are you using PC Dedicated software or you run the server directly ingame?

We both have the steam version. I am hosting by running the game directly from the Galaxy Multi-player menu.
#3
Quote from: Red04SWBF on March 03, 2024, 04:40:13 AMI'm not sure if it's possible for a single unit, but I guess you'll have to look for its related localization key. IIRC there was a file/post with all localizations.

The random clone tags appear because these are set up by default for all the playable units in the side you're putting them (except for the hero ones, which I suppose these have a single localization key for each side).

I recommend using the Core LVL builder for the stock files so you can modify the desired localization key.

That's fair. I'll have to look into editing Core.lvl.

On a similar topic, I was testing the hero modification in multipalyer with a friend (I sent him my SIDE folder and mission.lvl, so we have identical installs). Despite the fact that these new heroes work perfectly in Singleplayer, they crash his client in Multiplayer, and sometimes my client too.

Is there something else I need to modify to get this to work in MP?
#4
I'm trying to add variety to the heroes present on stock maps. For example, one of either Windu, Obiwan, or Anakin for the Republic depending on the map (instead of always Windu).

I'm copying the assets from BF2. I know how to add the new unit as well as adding them to the mission.lvl for each stock map, but I'm having trouble with the unit names. On the kill messages, instead of "MACE WINDU KILLED UNIT 123", replacing with my custom Obiwan hero instead gives "(random clone name) KILLED UNIT 123". The player list at the end of the battle also doesnt correctly display his name.

Obviously this is because Obiwan is not localized in the stock game's localization files, so how do I go about adding him and other heroes I intend to bring over?

Thanks!
#5
SWBF1 Modding / Re: lua4dec - Lua 4.0 Decompiler
March 02, 2024, 02:46:20 PM
Quote from: {AR}MetalKiller on March 02, 2024, 01:46:52 PMGlad to hear that  8)
Great that it worked now!

I can make it an option.
What would you prefer?
A second argument, or using the input filename as output filename with the ".lua" extension?

lua4dec_32.exe compiled.script                                  ->   compiled.lua
lua4dec_32.exe compiled.script myscript.lua                     ->   myscript.lua
lua4dec_32.exe --input compiled.script --output myscript.lua    ->   myscript.lua

Alternatively, you can copy the text from the command prompt, but I think you knew that already.

I think simply having it output with the same filename but using the .lua extension would make most sense. Although yes, copy and pasting the text also works.

That being said, I've attempted to re-munge the file output by the decompiler, and it crashes the mission when it attempts to load in-game. I'm not sure if I'm doing something wrong with the re-munge attempt, or if there is an error somewhere in the way it decompiles?
#6
SWBF1 Modding / Re: lua4dec - Lua 4.0 Decompiler
March 02, 2024, 11:01:30 AM
Quote from: {AR}MetalKiller on March 01, 2024, 07:52:19 AMYour feedback is really appreciated!
Perhaps I should add some more error messages if something goes wrong.

The only thing that you need to pass to the program is the file (no flags or anything else required):
lua4dec_32_deb.exe tat3a.outThe file ending does also not matter, as long as the content of the file contains valid Lua 4.0 compiled code.

Any anti-virus software is always unhappy about executing unsigned Software.
I try to look for signing tools, but I don't think that there are any free one available that get you around this problem.
In the meantime you have to trust me, that the exe does not contain malicious code.

I am assuming that you extracted the cours1a.script file directly from the unmunge tool?
If so, you still need to remove the metadata from it.
Here is a picture that might help me to get my point across:

The blue part is what you want, the rest you don't care about.

Here is a sample script file from the unmunge tool inspected with a hex editor:
ucfbh...scr_`...
NAME....bes1a...
INFO........BODY
;....Lua@.......    <- This is the part where the actual compiled script starts.
................       So, you need to remove anything in front of ".Lua@".

---

To speed up your progress I could offer to decompile the script for you.

I'm happy to help test this for you! And I appreciate the assistance with it.

So think I managed to get it working. I didnt realize the program doesnt actually save to a file, but it just optputs the lines of LUA code within command prompt itself.

Is there a way to get it to save to a file? or is that not possible?
#7
SWBF1 Modding / Re: lua4dec - Lua 4.0 Decompiler
February 29, 2024, 02:50:02 PM
Quote from: {AR}MetalKiller on February 29, 2024, 09:12:38 AMThe dependency to the DLLs should now be removed.
You should only require the exe.

While testing, I found out that there is a bug that only occurs in the release build, so the debug build is included as well: https://github.com/styinx/lua4dec/releases/tag/vP.0.1
The difference is the size of the binary and that you get a dump of the byte code.



Thank you very much!

Unfortunately, I don't know what I need to type in command prompt to get it to work.

I tried

```E:\GAMES\LucasArts\LUA_Decompile>luadec_32_deb.exe -cours1a.script```

and

```E:\GAMES\LucasArts\LUA_Decompile>luadec_32_deb.exe cours1a.script```

with no results. (my anti-virus went crazy while attempting this btw)
#8
SWBF1 Modding / Re: lua4dec - Lua 4.0 Decompiler
February 28, 2024, 03:25:40 PM
Quote from: {AR}MetalKiller on February 28, 2024, 07:27:30 AMThe test release contains the tat3a.out sample which is a compiled script file.
To decompile the mission.lvl file you would need SleepKillers unmunge tool first: https://github.com/PrismaticFlower/swbf-unmunge

The level format is structured something like this:
- ucbf header
- file size
- some meta info
- chunk type "script"
  - chunk size
  - some meta info
  - the actual compiled script    <-- this is what you would want
- other chunks type
  - ...
- ...

The unmunge tool extracts the known chunk types into their respective formats (like meshes, textures, ...).
For unknown chunks, it just dumps the binary to a folder with a dummy extension.
Scripts have the ".script" extension and contain the meta information and chunk size besides the compiled script.
If you remove this additional information from the file you can pass it to the "luadec_32_deb.exe" program and it should print you the original script.

A compiled script starts with the following binary signature:
1B 4C 75 61 40    -> .Lua@    (. is a non printable character, @ = 40 which means Lua 4.0)
You can hex edit the file and look out for this sequence of bytes.
Remove everything infront and you are good to go.

If you need assistance feel free to reach out.



Thank you very much for the reply!

I downloaded UnMunge, unmunged the mission.lvl into the 2 .script files, HEX edited the extra data out of the front of the files, and got as far as attempting to pass the script to the luadec_32_deb.exe. However, doing so I get multiple errors:

MSVCP140D.dll is missing
VCRUNTIME140D.dll was not found
ucrtbased.dll was not found

These errors occur when double clicking luadec_32_deb or when running it through command prompt.

I assume I'm missing certain drivers required for the program to run.
#9
SWBF1 Modding / Re: lua4dec - Lua 4.0 Decompiler
February 27, 2024, 09:19:02 PM
I've been looking for a way to decompile mission.lvl files for really old addon maps in order to increase reinforcement count, unit count, and potentially change specific units altogether. Would your tool allow this?

I'm not too familiar with command-line programs, so I'm not sure if the test release is capable of that already.