Hi, I'm a noob at all of this and was wondering if I could get some advice implementing the function Campaign_ChangeActiveDefenceDuration() to get Human Cannonball working properly. I'm not entirely sure which file in which to put the relevant line of code. I've searched out some tutorials but still can't work it out.
Thanks.
I assume the problem is indeed that the active defense doesn't last?
1. The following is from memory... please back up your mod's (the "ffx3" folder by default) powers.dat first.
2. Open FFEdit and, under the defences tab, note the exact name of the active defense you want to fix. Close FFEdit.
3. Start a mission in FFvsTTR. Open the console (how to (http://frworld.wikispaces.com/Scripting+for+Dummies)). Type:
import datfiles
datfiles.Campaign_ChangeActiveDefenceDuration("replace this with your active defense's name", 3)
loadPowers()
You can use it from the game console (http://freedomreborn.net/archive/index.php?topic=41006.msg572260#msg572260). Figure out FFEdit name of the defense power whose duration you want to change and what you want to change it to.
For instance, if you want the duration on Alchemiss' "arms of the goddess" AD to long, you find out that it's real FFEdit name is "alchemiss Deflection Shield" and the duration lengths are 0: short, 1: medium, 2: long (and 3: infinite), so you want 2. Then, open the console and paste the following two lines, one at a time (see the Game FAQ (http://freedomreborn.net/archive/index.php?topic=41006.msg572261#msg572261) for more info on this).
from datfiles import Campaign_ChangeActiveDefenceDuration
Campaign_ChangeActiveDefenceDuration("alchemiss Deflection Shield", 2)
And, that's it.
[Edit: Ninja'd by Epimethee, but I'll leave this just as an example.]
wow, that was quick! Thanks guys.
I'll give it run when I get home.
If I want to make these changes permanent I assume that I can use the Campaign_Rewrite() function after the loadPowers() function?
Sorry for the simple questions guys. :(
Quote from: ubky on June 02, 2008, 07:24:37 PMIf I want to make these changes permanent I assume that I can use the Campaign_Rewrite() function after the loadPowers() function?
The changes made by
Campaign_ChangeActiveDefenceDuration() are permanent by themselves. The power whose duration you change will have that new duration from the time you call
loadPowers() (or restart the game/campaign) until you change the power by altering it in
FFEdit or use a datfiles function like
Campaign_ChangeActiveDefenceDuration() again. You don't have to run it again every time you start the game or anything, but you will to use that defense in a different mod.
Quote from: ubky on June 02, 2008, 07:24:37 PMSorry for the simple questions guys. :(
No problem. This doesn't get asked much and simple questions (or at least questions with simple answers) make me feel smart. :P BTW, some of this is in the FFX manual under Other Tools -> DATFiles Tools you can find documentation for this function and some others.
gave that a go and I ended up getting the following error:
>>> from datfiles import Campaign_ChangeActiveDefenceDuration
>>> Campaign_ChangeActiveDefenceDuration("alchemiss Deflection Shield", 2)
Traceback (innermost last):
File "<string>", line 1, in ?
File "E:\games\Freedom Force vs The 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 3406, in Campaign_ChangeActiveDefenceDuration
powers = datfiles.Campaign_ReadPowers(FileName, ForceRead, 0)
NameError: datfiles
>>> Campaign_ChangeActiveDefenceDuration("ffx_force_field", 2)
Traceback (innermost last):
File "<string>", line 1, in ?
File "E:\games\Freedom Force vs The 3rd Reich\.\ffx3\missions\scripts\datfiles.py", line 3406, in Campaign_ChangeActiveDefenceDuration
powers = datfiles.Campaign_ReadPowers(FileName, ForceRead, 0)
NameError: datfiles
Thanks for posting your script.log. That made figuring out what was wrong a snap.
Oops! That was a problem in an earlier version of the Campaign_ChangeActiveDefenceDuration() function in datfiles.py. Download the newer version (0.255 here (http://www.stumpyanker.com/ffscripts/datfiles-0.255.7z)). Unzip it (http://www.7zip.org) over the version in your E:\games\Freedom Force vs The 3rd Reich\ffx3\missions\scripts\ folder. Then try again.