News:

Happy 20th, FFvT3R!

Main Menu

FFX questions - "branding"

Started by abenavides, July 09, 2014, 11:53:05 PM

Previous topic - Next topic

abenavides

Not sure if this is the right place, but was curious about the changes FFX makes to hero files.
I've encountered a few strange things as I've worked on EZHero and often FFX is at least a little involved.

Is there anyone who can shed light on exactly what changes FFX (versions 2.6 and 3.3) makes to hero files as "branding" .

If I know what it's doing, I can make sure I'm not doing anything in ezhero to cause problems.
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

Epimethee

Since this would be related to the FFX Control Centre, your best bet might be to PM Dr. Mike. Of course, Stumpy might be able to answer to, as IIRC he probed the hero files extensively in the context of FFX.
FFX add-on for FFvsTTR at ffx.freedomforce4ever.com

DrMike2000

Hey Alex

It writes an attribute to hero files that wouldn't otherwise being set. I'm trying to remember what that attribute is called. It could be ffxID, or it might be something else, I'm not sure. Its stored in the same section fo the hero file as materialID and mass, and other things that are retrieved via Object_GetAttr in the script.

I'll have a look when I get home tonight and get back to you.
Stranger Than Fiction:
The Strangers, Tales of the Navigator and Freedom Force X
www.fundamentzero.com

DrMike2000

Looking at the FFX python code, I think the attribute is called 'complex'
Can you see anything like that in a branded custom character file? That's the one you'd want to leave untouched in your hero file editor
Stranger Than Fiction:
The Strangers, Tales of the Navigator and Freedom Force X
www.fundamentzero.com

abenavides

Thx, yep I do see complex sometimes. So that's added like material is to Dat files? Is it always in the same place, byte-position wise?
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

stumpy

The object attribute block is always in the same place in a hero file and there is room to store up to 15 object attributes in the block. But, each individual attribute can be anywhere in those 15 slots. I am pretty sure the game puts occupied slots at the start of the block, but I wouldn't rely on the number or order.

To my reckoning, that block starts at position 2970 in an FFvT3R hero file and each slot is 36 bytes. The start of the slot is the string name of the object attribute (ending with a null char) and the last 4 bytes are the float value.

I think the block position and attribute data is stored the same way in both FF and FFvT3R hero files. If you need more of the nitty gritty, feel free to ask or to look for the ReadSavedCustomCharacter function in scripts/datfiles.py (which should come with FFX 3.x or any FFX-enabled mod). Near the end of that function is where the 'objectAttributes' are read.
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg

abenavides

Thanks, that does sound like the way it works for dat files. I don't have my notes in front of me, but I recall coding something along those lines for the send to dat in ezhero.

I guess my question is how is the ffx control centre handling this? Is it always sticking "complex" in slot 1? Or is it doing something else? Also is complex basically just a flag for the python code in ffx? There's nothing else being modified in the hero file by the control centre?
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

DrMike2000

Yeah, that's all the FFX Control Centre does to a hero file.

As you guys probably know, asking for an attribute that an object doesn't have using Object_GetAttr pops up a really annoying windows message box. The way round this is to make sure that all objects have that attribute with Global_RegisterAttr (or whatever its called). I didn't know about this when I wrote FFX, so I was prodding around for a globally registered variable that did nothing. 'complex' is I think used by prop objects or buildings to determine how they shatter, but not used by characters for the ingame engine, so I grabbed that.

I had a very early attempt to use 'mass', but that didn't end well - you got custom characters weighing 1kg being tossed off the map by the smallest knockback atack.

Stranger Than Fiction:
The Strangers, Tales of the Navigator and Freedom Force X
www.fundamentzero.com

stumpy

I am pretty sure the FFX Control Centre adds the 'complex' attribute as the last object attribute in the list, at least if the character doesn't already have that attribute. As noted, each character doesn't necessarily have the same number of object atttributes, so it's not always in the same position. Your best bet in terms of reliably dealing with it might be reading all 15 of them to get the complex attribute.

BTW, if the purpose is to make sure that a HERO file preserves the template information properly when writing that custom hero as a built-in to the game DATs, then you don't necessarily want to preserve the complex attribute value assigned by the Control Centre to the HERO file. Each character is supposed to have its own complex value, so having the same value in both the DAT hero and the HERO file hero may cause issues. I would suggest that either 1) you assign a unique complex value when adding the hero to the DATs (which could potentially be a bit of work, since you'd need to examine all the other HERO files and DAT heroes to know you had a unique value), or 2) do not add the complex value when sending to DATs at all and make sure the player knows to run the Control Centre again to brand the hero.
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg

abenavides

I'll need to check, but I believe that I am currently not sending "complex" attrib info to DATs at all (which is your second option).
So I think that's OK.

What I want to check (when I get time) is if I am overwriting incorrectly , etc. when I save a herofile in ezhero. It may be safer to say after editing with ezhero always run FFCC .
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.

stumpy

If you are already writing any object attributes to the HERO file, then you are probably also writing any complex attribute that has been set by the FFX CC. There is nothing special about the way the complex attribute is stored. So, if the writing process preserves things like the mass attribute and so on (which many people tweak for their custom heroes), then it may already be preserving the complex attribute, since it involves pretty much the same process.
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg