Page 1 of 1

Some modding tools

Posted: Tue Aug 22, 2017 7:52 pm
by Ormu
Hello all,

I and GoldStar611 have created some tools to simplify certain modding tasks.
Credits to Zidane for his work on UA internals. Also, thanks to all testers.

General notes:
  • All these tools have text interface only. However, they are interactive so you can just start them and answer to questions. Better instructions may come later.
  • It's often possible to start these by double-clicking. Using command prompt is recommended because it preserves error messages.
  • These tools are sensitive to invalid input and may crash. Pay attention to correct input.
  • Also see GoldStar611's BAS editor here. It has a GUI and allows more versatile editing but requires some knowledge of the BAS file internals.
  • These tools should work on Windows, Linux and probably other systems too. You need some Python libraries to use these, see below.
  • These tools are experimental! Backup your works before editing! Please report all bugs.

List of tools:
  • ModelClone: Clones a chosen vehicle or building (or sector border) model in a SET.BAS file as well as the skeleton and all textures and animations associated with it. This way you can create retextured models without replacing existing ones. You can search by model name (useful with buildings) or number (useful with vehicles).
  • BASextractor: Unpacks interesting parts from BAS files. Some features work well with sky files too.
  • BASinsert: Inserts these parts back into BAS files
  • BASinfo: Dumps structure information of a SET.BAS or almost any EA85/IFF compatible file into a text file
  • ModelLists: Generates a list of all vehicle, building and sector border models in a chosen SET.BAS file
  • SKLTresize_simple: A very rudimentary skeleton resizer. The skeleton must be unpacked into a separate file first.
  • RCtoLNG_converter: A tool that cleans and formats RC resource files extracted from Language.dll files using Resource Hacker into the plain text format used by UA_source. See instructions in a message somewhere below.

Notes on tools:
  • Using PIL is the most recommended way to extract/convert images. You must supply a palette file. Take Standard.pal from a set directory.
  • VBMP - BMP conversion using template should work but you need a BMP template. The resulting images are flipped.
  • BMP insertion by direct copying has not been implemented yet
  • When editing images, be careful to not change the palette.
  • Animation extraction to GIF files is slow and does not provide good results at the moment. It just gives a rough idea of how the animations might look like.
  • BASinsert can replace existing objects if you give a name that already exists. Currently, it does not ask for confirmation so be careful.
  • BASinsert does not save the file automatically. You must do it after you are done.

Download:!RxgFxAIS!OwPuSc1RjZF6 ... 1oaRQtjlmQ
(Last update: Sep. 28, 2017)

You need Python 3 (3.6.x is a good choice) to use these:

Certain image conversions require Python Imaging Library. Be careful to download the correct version for your version of Python:

Re: Some model editing tools

Posted: Wed Aug 23, 2017 8:08 pm
by GoldStar611
Thanks for sharing with everyone Ormu! Hopefully we can get some highly motivated members to make some good mods with these tools

Re: Some model editing tools

Posted: Thu Aug 24, 2017 11:39 am
by teuzzz
Thank you very much Ormu & GoldStar611

Re: Some model editing tools

Posted: Thu Aug 24, 2017 3:52 pm
by teuzzz
Hey Ormu i'm stuck.
Can you make a detailed guide about how to insert a new model in a bas file? i'm confused, what components a new model need to work in a bas file? do i need to import for example VP_lol.file and VP_lol.sklt as well? and the most important thing: where i can see the new vp ID for the new insterted model? maybe via running ModelLists on the new modded set?? i find BASextractor well done, but i think BASinsert has some problem. When the set has been modded i'm not able to use ModelClone & ModelLists beacuse they crash so i'm not able to see the ID of the new placed model (the game however, with the new inserted model does not crash so i think i done it correctly) i was trying to import the old Myko station model (the cube) on kids 1 place.

Re: Some modding tools

Posted: Thu Sep 28, 2017 6:18 pm
by Ormu
I added RC to LNG converter into the toolkit. It can help converting briefings and other texts from language.dll to the plain text format used by UA_source. The issue with single backslashes and UA_source should be gone now.

Download link is in the first post. Please report all bugs.

Instructions for RC to LNG converter:

1. Open language.dll in Resource Hacker. You should use a recent version of Resource Hacker because old versions use different encoding which requires a workaround.

2. Select String Table from the list in left

3. Select Action -> Save [ String Table ] group to an .rc file...

4. Save the file

5. Run this converter

5a. On Windows, you can run this by double-clicking the file (on Linux this depends on the file manager) and it will ask for input file name

5b. On Linux, use command line - you can run this script directly or specify python executable:
./ name_of_the_rc_file
python name_of_the_rc_file
python2 name_of_the_rc_file
python3 name_of_the_rc_file

5c. On Windows, you can also use command line but the syntax is just slightly different, for example: name_of_the_rc_file

5d. On Windows it should also work if you drag and drop the .rc file into this program in Windows Explorer

5e. If you used an old version of Resource Hacker, you MUST use the "old" parameter on the command line to activate a workaround. For example: name_of_the_rc_file old

6. Type output file name when asked - remember to include the file extension which is .lng

@teuzzz: I might implement cloning between two files at some point. I've been a bit busy lately.