Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: oktokels on December 24, 2025, 02:04:44 PM

Title: CHANGE AD DURATION
Post by: oktokels on December 24, 2025, 02:04:44 PM
Hello
I'm trying to call the Campaign_ChangeActiveDefenceDuration function on python win, but doesn't work.

I'm opening datfiles.py on python win, and when tryin to run, i put in the arguments this line

Campaign_ChangeActiveDefenceDuration('ffx_sonic_shield', 3, '../../powers.dat', 0)

But it always give me an exception.

Any tips?
Title: Re: CHANGE AD DURATION
Post by: oktokels on December 24, 2025, 08:58:42 PM
Solved this by creating a new .PY file named CHANGE_AD.PY

Basically it's a script that run the CHANGE_AD function directly through pythonwin. You just have to change the filepaths and the name of the AD that you want to change (change ffx_egypt_shield) to infinite duration or any duration (0,1,2 or 3). It also shows the full AD list before modifying it and then proceeds to show the full AD list with the duration changed, to confirm that the change was actually made.

Created and executed in pythonwin.

# -*- coding: latin-1 -*-

import sys

sys.path.insert(
    0,
    r"C:\FREEDOM_FORCE\Freedom Force vs the 3rd Reich\MOD8\Missions\Scripts"
)

import datfiles

POWERS_DAT = r"C:\FREEDOM_FORCE\Freedom Force vs the 3rd Reich\MOD8\powers.dat"

print "ANTES:"
datfiles.ShowAllActiveDefenceDurations(POWERS_DAT)

datfiles.Campaign_ChangeActiveDefenceDuration(
    stringPower="ffx_egypt_shield",
    intDuration=3,
    FileName=POWERS_DAT,
    ForceRead=0
)

print "\nDESPUES:"
datfiles.ShowAllActiveDefenceDurations(POWERS_DAT)