Some modding tools

For those of us who are curious and like to poke around in the game's data files and scripts as well as glitching. Caters to anything from unit/building stats to level data to telling how to glitch and stories of game errors.
Post Reply
Ormu
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 840
Joined: Fri Dec 26, 2008 4:59 pm
Location: Finland

Some modding tools

Post by Ormu » Tue Aug 22, 2017 7:52 pm

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:
https://mega.nz/#!RxgFxAIS!OwPuSc1RjZF6 ... 1oaRQtjlmQ
(Last update: Sep. 28, 2017)

You need Python 3 (3.6.x is a good choice) to use these:
https://www.python.org/downloads/

Certain image conversions require Python Imaging Library. Be careful to download the correct version for your version of Python:
https://pypi.python.org/pypi/Pillow/4.2.1
Image
Matthew Lever wrote:Take out Ormus as soon as you see them.
UA community Discord channel: https://discord.gg/7H4dFQH
Not all Ormus are mine. When in doubt, please ask...

GoldStar611
BlackSect Creator
BlackSect Creator
Posts: 861
Joined: Sun Dec 02, 2007 1:16 am
Location: USA
Contact:

Re: Some model editing tools

Post by GoldStar611 » Wed Aug 23, 2017 8:08 pm

Thanks for sharing with everyone Ormu! Hopefully we can get some highly motivated members to make some good mods with these tools
Image
Image

teuzzz
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 42
Joined: Sun Feb 15, 2015 3:04 am

Re: Some model editing tools

Post by teuzzz » Thu Aug 24, 2017 11:39 am

Thank you very much Ormu & GoldStar611

teuzzz
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 42
Joined: Sun Feb 15, 2015 3:04 am

Re: Some model editing tools

Post by teuzzz » Thu Aug 24, 2017 3:52 pm

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.

Ormu
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 840
Joined: Fri Dec 26, 2008 4:59 pm
Location: Finland

Re: Some modding tools

Post by Ormu » Thu Sep 28, 2017 6:18 pm

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:
./RCtoLNG_converter.py name_of_the_rc_file
python RCtoLNG_converter.py name_of_the_rc_file
python2 RCtoLNG_converter.py name_of_the_rc_file
python3 RCtoLNG_converter.py name_of_the_rc_file

5c. On Windows, you can also use command line but the syntax is just slightly different, for example:
RCtoLNG_converter.py 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:
RCtoLNG_converter.py 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.
Image
Matthew Lever wrote:Take out Ormus as soon as you see them.
UA community Discord channel: https://discord.gg/7H4dFQH
Not all Ormus are mine. When in doubt, please ask...

Post Reply