Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: BentonGrey on August 19, 2015, 05:43:41 PM

Title: FF Active Defense Troubles
Post by: BentonGrey on August 19, 2015, 05:43:41 PM
Howdy guys, I've got a very annoying issue.  I'm trying to change out most of the active defenses in my Marvel mod for FF ADs, but I can't get them to be long duration.  I used the change duration thing, and it worked, for a while. I used it on Magneto's shield, and it worked great when I restarted the game.  I left it there last night and picked the process up this morning.  I copied Magneto's power and used it as a base for all the other character's defense powers, but they're all showing up as 'short' duration, and so is Magneto's!  What can I do?
Title: Re: FF Active Defense Troubles
Post by: spydermann93 on August 19, 2015, 05:53:09 PM
I've been having issues with this as well.

The "FF Active Defense" section in the manual states:

Quote from: FFX3.3 ManualActive Defences and duration

In FFEdit2, active defences duration has no UI. Because of that, whenever a specific active defence is saved, its Duration is set to 0 (short).

When creating the Active Defense in FFEdit, make sure you set the Block Type to Absorb and the EP Cost should be None. If the Active Defense is to be used Remotely, make sure you select "Can Only Use Remotely" in the Defence Flags. The character can still use this power on himself if you choose to customize the power to be used both on the user and remotely. So, you don't need to create two seperate powers - one with the Remote flag and one without. Also, you'll need to change the duration of the Active Defense using the datfiles.Campaign_ChangeActiveDefenceDuration function because new Active Defense Powers created in FFEdit are automatically given Short (10 sec.) Duration. If you set your Duration to be longer than 10 seconds in the customization, then the AD will disappear before your customized duration. For more info about using this function go to the ModMaking section of this manual and click on the Powers.dat link under the DAT Files subsection.

Which leads to this segment in the "Powers.dat" section under "Mod-Making":

Quote from: FFX3.3 ManualCampaign_ChangeActiveDefenceDuration(stringPower, intDuration, FileName='', ForceRead=0)

Rewrite the selected active defence power to change the duration. Valid durations are:

    0 (short)
    1 (medium)
    2 (long)
    3 (infinite)

Note that this function does not reload powers.dat; you'll have to do that manually if you're calling Campaign_ChangeActiveDefenceDuration() in-game and want the changes to affect the mission currently playing.

So, I don't know if this means that every time you start a mission, you have to call this function (using the ~ in-game), or if you only have to do it once.  I am guessing the former.

Also, I'm not 100% sure of the proper syntax for this (this is where my issues lie).

I know that "stringPower" is the Power's name in FFEdit, intDuration is 0, 1, 2, or 3, but I'm guessing "Filename" is Powers.dat? And I'm not sure what "ForceRead" means, exactly.
Title: Re: FF Active Defense Troubles
Post by: BentonGrey on August 19, 2015, 05:56:11 PM
Spider, that's the function I ran which worked temporarily.  I'm not sure what caused it to revert, but something did!
Title: Re: FF Active Defense Troubles
Post by: spydermann93 on August 19, 2015, 05:59:56 PM
Yeah, I'm not sure, Benton.

Perhaps it's something having to deal with FFEdit itself?  Do you have a back up of your powers.dat?  I think a .bak should be generated every time you save your files.
Title: Re: FF Active Defense Troubles
Post by: Epimethee on August 20, 2015, 01:29:06 AM
Stumpy's Python script changes the file itself, so it is persistent. However, IIRC, if you save FFEdit powers tab, it'll will reset the value. So you need to be cautious when using FFEdit after using the script... Back up that powers.dat file.
Title: Re: FF Active Defense Troubles
Post by: BentonGrey on August 20, 2015, 01:59:26 AM
Oh no!  So every time I edit the powers.dat, this will reset?  Are there any built-in defense powers that are long duration that I could copy, or will those pop back to short too?
Title: Re: FF Active Defense Troubles
Post by: yell0w_lantern on August 21, 2015, 12:56:54 AM
what about creating an AD of long duration for a custom character then sending that character to DAT with EZHero or the M25 Rumble Room tool?