[Solved]Naming Conventions

Started by tirpider, October 09, 2011, 04:16:53 PM

Previous topic - Next topic
October 09, 2011, 04:16:53 PM Last Edit: October 09, 2011, 07:34:50 PM by tirpider
Regarding the names of assets.

Through the process of learning how to localize weapon and unit names, I learned how important it is to stick with a naming convention.

faction_weap_inf_WeaponName
faction_inf_UnitName

It gets confusing real fast if you don't.

My question is: Is the "_weap_" in weapon names connected to anything in the game other than as part of a naming convention?

I've hexed the tga entries on some BF1 stock models and have found the number of characters to be limiting.  So I overcame this by using a shorter string in place of "_weap_".  I know you can use whatever name and get it working as long as it's referenced correctly. I'm just worried about breaking something I haven't learned about yet.

A second (and probably better) question.

Is it possible to hex the tga entries(and adjust the file/entry size/offsets) in a msh without lossing the msh?

yes. but unless you are a pretty advanced hexeditor. the names have to be the exact same length as the original name. this also goes for hexediting lvl files. you cannot add an extra character and you cannot remove characters. doing so would corrupt the file.

about the naming thing. the weap part really only needs to be on the odf's label. i've had crashing problems when a unit has faction_rifle or something instead of factionname_weap_something_something

for odf names just stick with this

factionname_weap_weaponclass_weapon

weapons are divided in to these classes for odfs.
_fly
_hover
_walk
_tread?
_inf
or just factionname_weap_weapon
Current Projects:
Battlefront One and a Half Era Mod, v2.0. Making great progress (SWBF)

Thank you.

There is so many corners for a suprise crash to hide, this just seemed like one of those places.

I'll keep the 'weap' and 'inf' in then.
(Hadn't thought about the 'inf'. Thanks for that)
That doesn't leave much room for meaningfull names in some places, but as long as it's localizing correctly and not crashing, then it's a step forward.

The main point for changing the names is to accomodate future edits without tripping over overriding assets from the stock ( or other mod) assets.

As for hexing...
I got the exact number of characters part down, but I am itching to get proper names in there somehow. And eventually I would like to make some fancy changes.

I found the TX0D? where ? describes the length of a 0 terminated string for the tga's.
Simply changing ? to the corrected length renders it unviewable in the viewer.
I'm guessing there is a spot somewhere that describes how large the file is, or a pointer to the addresses for all the entries and that would need to be corrected as well.

You are very right about needing advanced knowledge to get it right. The last time I tried to modify(at a binary level) a game file was D&D Pool of Radiance (on a friend's 386). I thought I had made "Gloves of Piercing", but actually made "Dwarves of Hornet's Nest". It seems there were modifiers to the lookup table offsets that I didn't know about. Didn't crash, but was humorously unplayable.

The point being, offsets and hex make me cross-eyed.
I'll learn a bit more about hex before messing with string lengths and fancy changes.


leave the code alone (TX0D and stuff, i have no idea of what that is)

just  follow this example

if you want to hexedit a stormtrooper to use a diferent texture (edited or something)

view the model in swbfviewer.exe, the msh viewer utility that you really should have if you don't. download here: https://sites.google.com/site/swbfmodding/swbf-tools/SWBFViewer0.04.zip?attredirects=0&d=1

use the info button(the right button) so its gives a small window telling you the name of the texture (in this case its imp_inf_trooper.tga)

make a backup copy of the model before this next step

take the model: imp_inf_stormtrooper.msh and open it in the hexeditor

locate the texture imp_inf_trooper.tga. notice it has a notal of 19 characters (including the .tga). you need to rename your new texture to match the amount of characters.

so if you want a proper-sounding name: give your new texture the name something like: imp_inf_soldier.tga or imp_trooper_inf.tga or
impstormtrooper.tga or
imp_new_trooper.tga.

thats just an example but do what you need to do based on it.
Current Projects:
Battlefront One and a Half Era Mod, v2.0. Making great progress (SWBF)

Got it.
Just replacing the name in place, without adding or removing bytes isn't a problem.

I was hoping for a method of taking more control over the names in the msh so my texture names would be more consistant and easier to find. As it is now the names are all over the place (identical assets in multiple sides/lvls but with diferent names) and I haven't even approached using 3rd party models/textures yet.

I know that what really counts is the final product, I just like to keep my folders neat.