Freedom Reborn Archive

Freedom Force Forums => Scripting Forum => Topic started by: M25 on April 26, 2007, 02:43:42 PM

Title: utility to convert hero files to built-ins - version 1.3
Post by: M25 on April 26, 2007, 02:43:42 PM
It's a hassle creating characters in ffedit, so here's an easier way.

I've written up an in-game utility to convert hero files to built-ins.  In other words, given a hero file, it creates all of the entries necessary in the dat files.

Warning: this could mess up your files, so back up your mod before playing with it.  No, seriously.  Do it.


http://members.shaw.ca/m25/herodatatoolv13.zip

Many thanks to stumpy for his work on decoding the dat files in the first place.


Notes
[spoiler]
Hero file to .dat converter

Version 1.2
May 2, 2007
m25

What is it?

This package includes a rumble room mode and scripts for FFvTTR.  The scripts takes a hero file and adds it to the dat files of a mod, saving a lot of the tedious work in doing so.

You will still have to tweak the results, but the vast majority of the effort is done for you.



How to install it:

Unzip the file into your ffx3 directory or any mod based on ffx3.


How to use it:

Start the game, go to the rumble room and choose the 'Add To Dat' mode.

Pick the custom heroes you want to add to the dat files as your hero team.  You can add additional characters on the villain selection screen.

NOTE: if you select characters that are NOT custom heroes or that have not been branded by the ffx control centre, the tool will not add them (as they are already built-ins).

Start the rumble room session and wait for the session to end.

Restart the game, or look at the dat files with ffedit and you should see your characters as built-ins.


What to do in case of disaster:

If you find your files have become horribly mangled, look in your mod directory for .bak files.  Overwriting the damaged file with the most recent .bak file should restore your data.


My characters don't do anything after I convert them:

You may need to assign an AI to the built-in via the characters tab of ffedit, or you can run them through the AI generator that comes with ffx.

If the name of the built-in is the same as the name of a custom hero file, the custom AI will try to use the AI for the hero file, which won't work.  Rename the built-in or move the .m25ai file out of your hero file directory. 

Your hero file directory should be located here (or in a similar location).  The Application Data directory is hidden, so you should set Windows to show hidden directories.

C:\Documents and Settings\<USERNAME>\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\Custom\Heroes



What it does:

1. Creates a name for the built-in character.  The name is limited to 16 characters, is lower-case and has all spaces changed to underscores (_).  The name can only be 16 characters long due to restrictions on the animportrait entry in res.dat.

2. Adds the character to characters.dat.  Powers are divided up and placed into the two tiers.  Half goes into tier a, and the other half into tier b.  They are divided up in order, so the powers in tier a should be the powers that are listed first on the hero editor screen.

3. Adds the character to objects.dat.  It creates a complex ID for the character so that it works with FFX and updates the HeroIndexData.txt file.

4. Adds all of the character's powers.  Powers are named <hero_name> <power name> so that all entries are placed together, are easy to find, and don't interfere with the same powers from other characters. 

5. Creates an entry in res.dat for the character's animated head.  The entry is named animportrait_<hero_name>. 

6. Copies the mesh for the character into the mod directory.  It is placed in <my mod>\Art\Library\Characters.  If there is anything already in that location it will be COMPLETELY REMOVED and replaced with the copied mesh.  If you make changes to the mesh in your mod and then re-import the hero, your changes will be wiped out.

7. If the mesh doesn't have a head.nif associated with it, Renegade's default head.nif file is copied into the mesh directory in the mod.

8. Entries are added to strings.dat, and strings.txt, for the character.  That includes the name and description of the hero, and the names and descriptions of all of the powers associated with the hero.  Most of these are just placeholders and you'll want to change them yourself.  Do a search for the hero name and you'll find them.  If the entries are already in strings.dat, they won't be overwritten.

9. If ffxcustom and ffxcustom2 are found and the character name had to be modified, any ffx customizations found on the hero file are copied over to the new character name.  This may not work very well for state swaps (carrier attacks) though.

10. If m25aidata.py is found, the tool will attempt to transfer the custom AI defined for the hero into m25aidata.py for the built-in character.  It will completely overwrite any existing custom AI for the built-in.


You have to restart the game to see the changes.

NOTE:  If you have a hero file and a built-in character with the same name, the game may use the hero file in the rumble room when you select the built-in. 



Credits:
default head.nif by Renegade
dat file format decoded by stumpy
[/spoiler]
Title: Re: utility to convert hero files to built-ins
Post by: Previsionary on April 26, 2007, 03:47:12 PM
I'm glad you made this, m25. It should make modding so much more bearable.
Title: Re: utility to convert hero files to built-ins
Post by: tommyboy on April 26, 2007, 04:01:25 PM
Thanks, another great utility.
But you just know I'm going to ask if theres a way to add more than four at a time.....
just kidding...sort of...
Title: Re: utility to convert hero files to built-ins
Post by: Previsionary on April 26, 2007, 04:14:43 PM
Change:

def OnSelectionRequiredCheck():
return 0 #disallows players to choose their opponents


Into:

def OnSelectionRequiredCheck():
return 1 #disallows players to choose their opponents



I believe that to be the correct way of doing it. Of course, I'm assuming since that's the way to add more than 4 AI entries at a time.
Title: Re: utility to convert hero files to built-ins
Post by: tommyboy on April 26, 2007, 04:22:56 PM
Thanks, that makes sense.
I'll have to re-install my eleventy billion hero files and try this out.
Title: Re: utility to convert hero files to built-ins
Post by: M25 on April 26, 2007, 04:27:02 PM
Yes, changing the OnSelectionRequiredCheck() value to 1 should do it. 
Title: Re: utility to convert hero files to built-ins
Post by: HumanTon on April 26, 2007, 04:48:09 PM
This is awesome! Thanks for making it.
Title: Re: utility to convert hero files to built-ins
Post by: Lunarman on April 26, 2007, 10:43:39 PM
OMG!!! Now making an FR mod will be so much easier, You are a lifesaver M25
Title: Re: utility to convert hero files to built-ins
Post by: TaskMasterX on April 27, 2007, 04:17:59 AM
Another great utility from M25! This was needed in a big way! Thanks!
Title: Re: utility to convert hero files to built-ins
Post by: yell0w_lantern on April 27, 2007, 11:02:37 AM
 :thumbup:
Yessssssssssssssssssss!
That's AWESOME!!!!
Title: Re: utility to convert hero files to built-ins
Post by: Xenolith on April 27, 2007, 01:08:00 PM
A really awesome idea.  I so badly wanted this.  yay
Title: Re: utility to convert hero files to built-ins
Post by: Epimethee on April 27, 2007, 09:17:41 PM
Amazing! Congrats to both of you! :thumbup:

P.S.: Since not everyone follows the Script forum, you may want to post this in the Releases forum. :)

Title: Re: utility to convert hero files to built-ins
Post by: M25 on April 28, 2007, 07:34:22 AM
Quote from: Epimethee on April 27, 2007, 09:17:41 PM

P.S.: Since not everyone follows the Script forum, you may want to post this in the Releases forum.



I'm mostly waiting for some mod-makers to confirm that this isn't 'horribly mangling' their mods.   :mellow:
Title: Re: utility to convert hero files to built-ins
Post by: catwhowalksbyhimself on April 28, 2007, 09:23:22 AM
I'll probably be testing this soon, as there are two more recruitable characters that will enter the picture.  It may be a bit as one will get 3 new state swaps and the other, a new attribute.
Title: Re: utility to convert hero files to built-ins
Post by: UnkoMan on April 28, 2007, 01:02:34 PM
Well... For adding characters it certainly works. I was going to ask about special ffx3 state swaps and powers... They seem to work just fine though. And you can leave them blank, as with custom heroes, OR specify which powers should have them. So you could have one thing swapped out to numerous things. That's pretty neat.

One thing, though... The imported characters seem to have little to no AI (unlike their hero file versions who have all been through your AI adding system). What should I do for this? Just change their AI from zerocost to generichero in FFEdit?
Title: Re: utility to convert hero files to built-ins
Post by: M25 on April 28, 2007, 01:07:55 PM

If you want them to have custom AI, you need to run them through the AI generator again.

It might be possible to automatically transfer the custom AI as well, but it doesn't do that right now. 
Title: Re: utility to convert hero files to built-ins
Post by: UnkoMan on April 30, 2007, 10:43:43 AM
I tried this and it helped quite a bit, but they still seem to be... not as bright as they were. Specifically summoned characters. They stand around for a long time doing nothing and only started to attack after they were attacked. I did, however, change their AI in FFEdit (to generichero) first. Would that interfear with your other AI?

Also, would they get new AI files somewhere? The ones in my hero folder are the old ones for the custom characters (which I'd like to keep there anyhow). Or is there somewhere I could just copy the text from the old AI files to?

I'd like to thank you for this tool, by the way. This makes things so much easier.
Title: Re: utility to convert hero files to built-ins
Post by: Lunarman on April 30, 2007, 11:35:54 AM
When you add them they don't have custom ai, so for heroes give them generichero AI and villains (and summons) have got to have AI suitable to their attack layout. For example a villain with a ranged attack first and a melee attack second (and nothing else) can have generic gun thug AI. Otherwise I'd generate AI for them and leave the ffedit AI box empty or as defualt.
Title: Re: utility to convert hero files to built-ins
Post by: M25 on April 30, 2007, 12:12:25 PM
I've updated the tool (see the first post) to version 1.1. 

It will now try to transfer any custom AI from the hero file to the built-in.

Hopefully this version will also work with ffx 3.0 and up (not just ffx 3.2).


UnkoMan: the custom AI is compatible with any built-in AI, so it doesn't matter which one you choose.  The generichero AI is not a good choice as Lunarman said, since I believe it is meant to be used with characters that the player is controlling.

The custom AI for built-ins is in /Missions/Scripts/m25aidata.py, but doing a copy and paste won't work since the power names change.

If you had a character summoning a custom hero and you want them to summon the built-in, you'll have to manually change the attribute in the ffx control centre to summon the built-in, if the name of the built-in is not the same as the custom hero. 
Title: Re: utility to convert hero files to built-ins
Post by: UnkoMan on April 30, 2007, 03:11:29 PM
Ah, thank you. That should take care of that. I'll try this all out later tonight.
Title: Re: utility to convert hero files to built-ins
Post by: BentonGrey on April 30, 2007, 04:15:36 PM
D'oh!  How did I miss this!  Haha, this is just plain ironic.  It seems my needs are running a month or two ahead of the community.  I was working on voices, and had to adjust volumes individually, but once I finished Cat found a utility for doing them en mass.  I was adding in a bizallion herofiles into FF2, and now that I'm almost done M25 writes this awesome utility!  Man, I just need to go on vacation, and by the time I get back, I won't even need to put out my mod anymore, y'all will have done all the hard stuff already! :D
Title: Re: utility to convert hero files to built-ins
Post by: M25 on May 01, 2007, 06:34:08 PM
Quote from: UnkoMan on April 30, 2007, 10:43:43 AM
I tried this and it helped quite a bit, but they still seem to be... not as bright as they were. Specifically summoned characters. They stand around for a long time doing nothing and only started to attack after they were attacked.

I think I've found the cause of this.  I'll release a new version in the next couple of days that should fix it.
Title: Re: utility to convert hero files to built-ins
Post by: UnkoMan on May 01, 2007, 09:06:53 PM
I actually retested from scratch using the latest version, and something crazy happened. It changed all the grenade projectiles to proximity. And when I opened FFEdit to check it out, I noticed that, in the characters tab, the powers and attributes list was all blank. Thus I couldn't add any to anybody. Which was alright.

Anyhow, I went back and switched all the grenades backed, and changed a couple other things, and then the AI seemed to work fine. But I just checked FFEdit and I can see the powers and attributes lists now. So I dunno what happened there. I will test whatever new versions you do from scratch too, most likely.

I have a question though. Is there a way to alter the level of a power? With custom characters I never set a power higher than 1. I don't know why. Just a habit. But when there's built in, they've got that some at 3 setting, you know? Granted that's fine if you're making a mod where characters level up, but if you wanted something where they stay the same throughout? Not that it's a big deal, I'm just curious.
Title: Re: utility to convert hero files to built-ins
Post by: catwhowalksbyhimself on May 02, 2007, 05:11:26 AM
With built ins, unless you are playing a campaign and adding points, the levels are always 3 if the power can be leveled up, and if there's another power on the tier after it, otherwise, the level's always 1.
Title: Re: utility to convert hero files to built-ins
Post by: M25 on May 02, 2007, 01:57:16 PM
The tool has been updated to version 1.2 - see the first post.

There is a constant hidden in characters.dat that stops the character from moving correctly if it isn't there.  The tool will now add it in, but you will have to re-convert any characters you've already converted.

The Attack Flags and Defence Flags should now transfer correctly too.

Title: Re: utility to convert hero files to built-ins
Post by: Epimethee on May 02, 2007, 07:40:23 PM
Quote from: M25 on May 02, 2007, 01:57:16 PMThere is a constant hidden in characters.dat that stops the character from moving correctly if it isn't there.
Interesting. Could it be related to turrets? Or to an abandoned terrain allowance system?
Title: Re: utility to convert hero files to built-ins
Post by: tommyboy on May 10, 2007, 04:53:08 AM
Just thought I'd let you know I used the 1.2 version to add 30+ characters to my Mod in one go.
It worked.
The only problems I had were caused by the length of the hero file names which made powers and heads over 29 characters, which is hardly the fault of your utility.
Other than that, everything went fine.
I didn't even back up my Dats, because I'm a nidiot, but luckily they weren't damaged.
Thanks for a(nother) great tool.
Title: Re: utility to convert hero files to built-ins
Post by: M25 on May 10, 2007, 08:23:56 AM
Glad it, er mostly, worked.

I thought I had the length of the heads capped correctly.  I'll have to look at it again.  Didn't consider the powers though.

The tool creates a single backup of your dats when you run it, so there is some chance of recovery if things go wrong. 
Title: Re: utility to convert hero files to built-ins
Post by: UnkoMan on May 13, 2007, 05:03:40 PM
I also had super long power names. No big deal, I just went back and fixed it.

I had a character with too long a name, and the end of the name was chopped off. This is fine for characters, but I wouldn't sugest doing it for powers. As it stands, things are probably easier to fix this way. A better solution might be removing all but the first letter or two of the hero's name in the power name, if that's even possible... Or even makes sense.
Title: Re: utility to convert hero files to built-ins
Post by: joemama on May 13, 2007, 06:37:31 PM
Love the utility M25.  Great job as usual.

I got around the 29 characters issue by abbreviating the heroes' names and then putting the correct (expanded) name into the strings file.  All my powers were fine after that.

It's a little effort, but it was easier than trying to change the individual powers themselves.

IMHO, of course.

JM


Title: Re: utility to convert hero files to built-ins
Post by: wickerman on May 13, 2007, 06:55:44 PM
Hmmm didn't work for me at all...  session never ended - I waited about 10 mins


script log follows for anyone who might be able to help... thanks!


[spoiler]>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
loading datfiles version 0.251000
loading cshelper ...
Starting ffx.py v. 3.2.0 build 11; branch = Gold / Release
Loading m25ai.py v. 3.2.0 build 10; branch = beta 2: m25 branch 2
importing missionobjvar.py v1.18
importing MLOG Reader 1.0.18 release
Starting General Utilities 1.0
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
missionobjvar defining functions for Rumble Room play.
CustomHeadCurrentTime 1179106859.823000
Starting Height Check module 1.4
Starting System Utilities 1.4
OBJECTS_HEIGHT: 604 entries
NIF_OBJECTS: 482 entries
BUILDINGS_IN_OBJECTS_DAT: 30 entries
BUILDING_DIMENSIONS: 30 entries
Starting skXMapInfo.py  v 0.79 beta
skXMapInfo: m25ai available
FFX Mission Plugin 'firehydrant' imported
FFX Mission Plugin 'zombie' imported
Loading freeroam_keepbuildingdamage.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'freeroam_keepbuildingdamage' imported
FFX Mission Plugin 'm25ai_lowjumper' imported
FFX Mission Plugin 'm25ai_realitymanipulation' imported
FFX Mission Plugin 'cutscene_power' imported
Loading     m25enc_OPENDOOR.py v.1.0.0 build 0; branch = main
FFX Mission Plugins non-fatal error:
    couldn't import plugin 'm25enc_opendoor'
ffx3\sk.py CANNOT import FFX
ffx3\missions\scripts\sk.py loaded
m25gdbm version 1.3
no ffx found
custom aidata found
>>> C:\Documents and Settings\Kuehn\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\cM25 Add To Dat.py executed
>>> C:\Documents and Settings\Kuehn\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\danger.py executed
>>> C:\Documents and Settings\Kuehn\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\cM25 Add To Dat.py executed
>>> OnReceiveSelectedEnemies(('------------', ))
String: ronin_01 already in strings.dat - skipping.
String: ronin_desc_01 already in strings.dat - skipping.
String: ronin_desc2_01 already in strings.dat - skipping.
String: ronin Round House_01 already in strings.dat - skipping.
String: ronin Round House_desc_01 already in strings.dat - skipping.
String: ronin flurry of steel_01 already in strings.dat - skipping.
String: ronin flurry of steel_desc_01 already in strings.dat - skipping.
String: ronin RAM_01 already in strings.dat - skipping.
String: ronin RAM_desc_01 already in strings.dat - skipping.
String: ronin Healing touch_01 already in strings.dat - skipping.
String: ronin Healing touch_desc_01 already in strings.dat - skipping.
String: ronin Right Hook_01 already in strings.dat - skipping.
String: ronin Right Hook_desc_01 already in strings.dat - skipping.
String: ronin Devastating Combo_01 already in strings.dat - skipping.
String: ronin Devastating Combo_desc_01 already in strings.dat - skipping.
String: ronin Pistol bararge_01 already in strings.dat - skipping.
String: ronin Pistol bararge_desc_01 already in strings.dat - skipping.
String: ronin energy grenade_01 already in strings.dat - skipping.
String: ronin energy grenade_desc_01 already in strings.dat - skipping.
Campaign_MakeHeroIndex: Making index <c:\program files\irrational games\freedom force vs the 3rd reich\ffx3\HeroIndexData.txt>
Dat_TransferAI: RONIN has no custom AI.
String: hawkeye_01 already in strings.dat - skipping.
String: hawkeye_desc_01 already in strings.dat - skipping.
String: hawkeye_desc2_01 already in strings.dat - skipping.
String: hawkeye Net Arrow_01 already in strings.dat - skipping.
String: hawkeye Net Arrow_desc_01 already in strings.dat - skipping.
String: hawkeye arrow_01 already in strings.dat - skipping.
String: hawkeye arrow_desc_01 already in strings.dat - skipping.
String: hawkeye Punch_01 already in strings.dat - skipping.
String: hawkeye Punch_desc_01 already in strings.dat - skipping.
String: hawkeye acid arrow_01 already in strings.dat - skipping.
String: hawkeye acid arrow_desc_01 already in strings.dat - skipping.
String: hawkeye triple Shot_01 already in strings.dat - skipping.
String: hawkeye triple Shot_desc_01 already in strings.dat - skipping.
String: hawkeye Electric Arrow_01 already in strings.dat - skipping.
String: hawkeye Electric Arrow_desc_01 already in strings.dat - skipping.
Campaign_MakeHeroIndex: Making index <c:\program files\irrational games\freedom force vs the 3rd reich\ffx3\HeroIndexData.txt>
Dat_TransferAI: Hawkeye has no custom AI.
String: shrapnel_01 already in strings.dat - skipping.
String: shrapnel_desc_01 already in strings.dat - skipping.
String: shrapnel_desc2_01 already in strings.dat - skipping.
String: shrapnel Titanium Armor_01 already in strings.dat - skipping.
String: shrapnel Titanium Armor_desc_01 already in strings.dat - skipping.
String: shrapnel EMP Blast_01 already in strings.dat - skipping.
String: shrapnel EMP Blast_desc_01 already in strings.dat - skipping.
String: shrapnel energy shield_01 already in strings.dat - skipping.
String: shrapnel energy shield_desc_01 already in strings.dat - skipping.
String: shrapnel Cyborg Hook_01 already in strings.dat - skipping.
String: shrapnel Cyborg Hook_desc_01 already in strings.dat - skipping.
String: shrapnel Shrapnel bombs_01 already in strings.dat - skipping.
String: shrapnel Shrapnel bombs_desc_01 already in strings.dat - skipping.
Campaign_MakeHeroIndex: Making index <c:\program files\irrational games\freedom force vs the 3rd reich\ffx3\HeroIndexData.txt>
Traceback (innermost last):
  File "C:\Documents and Settings\Kuehn\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\cM25 Add To Dat.py", line 85, in AddToDat
    m25gdbm.Dat_Convert_All(chardata.GetCharacterData(char))
  File "C:\Program Files\Irrational Games\Freedom Force vs The 3rd Reich\.\ffx3\missions\scripts\m25gdbm.py", line 927, in Dat_Convert_All
    Dat_MoveMesh(cdata)
  File "C:\Program Files\Irrational Games\Freedom Force vs The 3rd Reich\.\ffx3\missions\scripts\m25gdbm.py", line 977, in Dat_MoveMesh
    shutil.copytree(start, target)
  File ".\System\PythonLib\shutil.py", line 82, in copytree
    os.mkdir(dst)
OSError: [Errno 17] File exists: 'c:\\program files\\irrational games\\freedom force vs the 3rd reich\\ffx3\\art\\library\\characters\\Shrapnel'
[/spoiler]
Title: Re: utility to convert hero files to built-ins
Post by: UnkoMan on May 13, 2007, 08:17:56 PM
Ah, good call JM. I'll have to remember that.

Oh, and Wicker... did you brand all the characters in FFX first? Heck, you probably did and it is some other problem. What do I know for this programmin'?
Title: Re: utility to convert hero files to built-ins
Post by: joemama on May 14, 2007, 04:33:21 AM
Wicker--

It's probably not the problem, but, did you happen to open the hero files using one of the hero tools?  I did (MrBrdo's) and it only worked with characters who had no ffx3 attributes/powers/cusomizations.  Fortunately, I only did on about a dozen files, so it was easy to re-input them manually.

Unko,

I'm anal retentive about updating my strings file, so having this utility do (most) of it for me saves a ton of time!

JM
Title: Re: utility to convert hero files to built-ins
Post by: M25 on May 14, 2007, 09:46:01 AM
wickerman:  it looks like the characters were imported.  The tool is supposed to remove the old mesh directory in the mod and then copy the character mesh back into the mod directory (in case you made any changes to the skin/mesh/portrait/head since the last time it was imported).  It failed to remove the directory and then the copy failed.  I'll put in some safeguards for that.

Character and power name issues:
The name that you see in the game comes from strings.dat, and the tool should be using the original names of the characters and powers as the string entries.  You shouldn't see the truncated name at all when playing. 

I'm going to cap power names as well, as that isn't something anyone should have to do manually.  It will still be <truncated character name> <truncated power name> though to help prevent namespace collisions - that is, if I only use a couple of letters from the name of the character, it is much more likely that the powers from different characters will end up with the same name and will overwrite each other.
Title: Re: utility to convert hero files to built-ins
Post by: UnkoMan on May 14, 2007, 11:25:44 AM
I've got to say, I use MrBrdo's tool all the time (mostly for weight changing) and I don't have a problem. Yes, I have to go back into FFX Control Centre after, but I just reimport my py files and it works perfectly.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 16, 2007, 12:16:38 PM
Version 1.3 is up - see the first post

Character names are now capped at 15 characters.
Power names are capped correctly at 29 characters.
All entries in strings.dat reflect these new lengths, but you'll still see the full original character name and power names in the game.
The issue with not being able to copy over an existing folder has been fixed.
Powers have the 'not for custom' flag set.
Stumpy's melee area fix is applied to any melee area powers.

Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Previsionary on May 16, 2007, 07:04:11 PM
Very nice update, m25. My only suggestion is this...is it possible to fix the changing of accuracy for melee attacks?
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 16, 2007, 08:33:06 PM
It looks like melee attacks in hero files all have an accuracy of zero (very low), and the built-in characters' melee powers often have it set to zero as well.  I could be wrong, but I don't think the game uses that value for melee attacks.  Speed determines how accurate a melee attack is. 

Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Previsionary on May 16, 2007, 10:07:44 PM
yes, some heroes/villains do have it set to very low, but a great deal (almost an even amount between the two) have it set to medium and above. From what I can remember from testing, accuracy plays some part as I recall several of my melee characters barely hitting their opponents at a very low setting...and accuracy does affect prestige, so I would hope it effects something. I dunno. :S. However, from what im noticing from the built ins...most of the high powered characters have low accuracy for melees (minuteman, liberty lad (??), supercollider)...so, take that as you will.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: catwhowalksbyhimself on May 17, 2007, 05:15:06 AM
I believe melee attacks hit automatically barring a dodge.  Speed is therefore the important factor in determining melee accuracy, as it determins whether that attack can or cannot be dodged.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 17, 2007, 06:32:34 AM
To put it another way, the tool is not changing the accuracy values.  It's simply copying what is in the hero file.  I can put a different value in its place, but I'm not sure what that should be.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Previsionary on May 17, 2007, 05:29:05 PM
Quote from: M25 on May 17, 2007, 06:32:34 AM
To put it another way, the tool is not changing the accuracy values.  It's simply copying what is in the hero file.  I can put a different value in its place, but I'm not sure what that should be.

I wasn't saying that the tool changed anything, I was certain it wasn't changing that factor. Anyway, don't worry about it. I was just looking at some stuff in game and apparently there isn't an accuracy field for melee...even though I recall there being one. Maybe that was ff1? Anyway, my mistake. :P
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: catwhowalksbyhimself on May 17, 2007, 07:03:03 PM
There is in FFEdit, but not in the hero editor.  I'm pretty sure it does nothing, it's just there for every attack.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Lunarman on May 17, 2007, 11:43:16 PM
yep the accuracy of the melee attack doesn't change whatever you set the accuracy too. It's the speed which affects melee attack's chance to hit. You can just leave accuracy blank :)
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: UnkoMan on May 19, 2007, 01:03:14 PM
Okay, here's something odd I've come across.

I have this one hero in paticular... he will get added fine. I check in FFEdit and he looks like he is all there, just like everybody else. Character, template, powers, etc. However, when I go in-game, his name doesn't appear in the characters list. When I have the hero file still in place, however, it does appear, once... and selecting that character will play as the built-in, not the custom.

So, does anybody know what is going on, and how to fix it? If you need more information, I'll be glad to give it.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: catwhowalksbyhimself on May 19, 2007, 01:06:57 PM
Check his built-in AI.  Putting the wrong one on him, or none at all, will have exactly that effect.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: UnkoMan on May 19, 2007, 01:20:43 PM
His built-in AI is CZeroCost, the same as all the others. His template class is GAME_OBJ_HERO, as well. He seems to be set up in the exact same way as any other hero I've added.

I've even done a test where I started completely from scratch. A brand new folder. I added a bunch of heroes. Everybody worked great except him. Should I, perhaps, just try adding this one paticular character by hand and see what happens?
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 19, 2007, 02:46:29 PM
Look in your strings file (in Lang/English/strings.txt).   Does the character have the right name in there?  What's the name of the character?
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: joemama on May 19, 2007, 06:51:53 PM
QuoteDoes the character have the right name in there?  What's the name of the character?

maybe it has something to do with spaces and/or _'s in the name?

JM
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: HumanTon on May 19, 2007, 08:51:32 PM
Also remember that FFEdit hates upper case letters in certain fields.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 19, 2007, 09:40:59 PM
The tool should be taking care of upper case letters and spaces in hero names.  I'm wondering if there are other special characters/letters that are causing problems.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: UnkoMan on May 19, 2007, 10:44:45 PM
The name is "tomato" (yes, THAT Tomato), so I don't know if it is that. There's one power that has hyphens in it, but if that was a problem it'd just mess up that power, yes?

The strings look all good though. Like I said, everything looks exactly the same as all the other characters. In FFEdit and in the strings and... well he's just not showing up in the of characters is all.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 20, 2007, 11:37:35 AM
Try it without the hyphens anyway.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Xenolith on May 20, 2007, 12:20:03 PM
Leave it to Tomato to mess up   :ffvstr:  :lol:
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: UnkoMan on May 21, 2007, 10:19:02 PM
Nope, still nothing. I think I will... stop worrying about this for a while and come back to it later.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: catwhowalksbyhimself on May 22, 2007, 05:08:51 AM
Change the AI anyway.

Believe me, FFvTTR does nutty things like that at times. It may very well work.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 22, 2007, 08:00:33 AM
I downloaded Tomato's hero file and ran it through the conversion.   For some reason the hero file has the 'mock' attribute set to 1.  Go to the templates tab of ffedit and change the 'mock' attribute to '<none>' and set the value to 0. 

I'm not sure how it got set, (different edition of the game?  a third-party hero editor?) but it is preventing the character from showing up in the game.

Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Epimethee on May 22, 2007, 08:25:47 PM
So, Tomato is only a mock hero, heh? ;)
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: UnkoMan on May 22, 2007, 11:07:21 PM
Oh, is that all it was? I can't believe it was so simple. Thank you for checking for me, and everybody else for your suggestions.

I noticed that, but had no idea what it was. I haven't really messed with this stuff before. But it's cool learning about it, and this'll be good for future reference.

Does FFEdit have a manual that would cover this sort of stuff (meanings of all the things in templates, etc)? I seem to recall the original game's having one, but admit I never more that glanced at it. If so, where would I locate that to go through it?
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Previsionary on May 22, 2007, 11:44:54 PM
Quote from: UnkoMan on May 22, 2007, 11:07:21 PM
Oh, is that all it was? I can't believe it was so simple. Thank you for checking for me, and everybody else for your suggestions.

I noticed that, but had no idea what it was. I haven't really messed with this stuff before. But it's cool learning about it, and this'll be good for future reference.

Does FFEdit have a manual that would cover this sort of stuff (meanings of all the things in templates, etc)? I seem to recall the original game's having one, but admit I never more that glanced at it. If so, where would I locate that to go through it?

check the scripting docs. Every command in ffedit's template tab is defined
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: ow_tiobe_sb on May 29, 2007, 10:53:41 AM
Cheers, lads!  Nice work and interesting discussion, as always.  I had one question that I thought might be germane to this thread.  Since I had not noticed an answer previously discussed here, I thought I might pose my question.

Is it possible to use this utility to specify and add as built-in characters a few extra characters that one normally might have accessed via editing the init.py file of FF1 with the line

APP_ENABLE_XTRACHARS = 1

(You know...Iron Ox, Blackbird, and Supercollider? ;))

In other words, if I am doing a mod in which I might like to hide some Easter egg characters for those clever fellows who decide to edit their init.py file, could M25's utility be used to do just that?  If so, how?  If not, I'll post this question in a new scripting forum thread.

Thanks, and keep up the stellar work!  :)

ow_tiobe_sb
Phantom Bunburyist and The Prat in the Hat
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: M25 on May 29, 2007, 11:11:05 AM
I don't know how Irrational hid those characters, so the answer is probably not.
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: ow_tiobe_sb on May 29, 2007, 11:15:10 AM
Many thanks for the swift response, M25. :)

ow_tiobe_sb
Phantom Bunburyist and The Prat in the Hat
Title: Re: utility to convert hero files to built-ins - version 1.3
Post by: Epimethee on May 29, 2007, 04:17:15 PM
Quote from: ow_tiobe_sb on May 29, 2007, 10:53:41 AMIn other words, if I am doing a mod in which I might like to hide some Easter egg characters for those clever fellows who decide to edit their init.py file, could M25's utility be used to do just that?  If so, how?  If not, I'll post this question in a new scripting forum thread.
I believe something could be done. I'll wait until you post in that new thread to avoid hijacking this one, though. :)