Python used in Freedom Force
Wayne Folta
wfolta at netmail.to
Tue Jan 13 23:29:52 EST 2004
I don't know if it's been discussed since the game came out a while
ago, but I was looking through some temp files that were installed with
the game Freedom Force (a very fun game) and the scenarios are
programmed in Python! (This is on the Mac, but I assume it also used
Python on the PC.)
An example of the code is:
def OnPowerup(object, hero):
if (object == 'powerup5'):
speakNoCB('minute_man', 'MISSPCH_1_MM_12')
elif (object == 'powerup1') or (object == 'powerup6'):
speakNoCB('minute_man', 'MISSPCH_1_MM_11')
Object_SetAttr(object, 'used', 1)
UpdateTrainArrow(object)
def OnInterrogation(char, hero):
print 'OnInterrogation'
Object_SetAttr(char, 'used', 1)
UpdateTrainArrow(char)
# kill(char)
:
:
# chase
def startChase(event):
startPatrol('runfciv', 3, run = 1, priority = ai.goal.PRI_HI)
addMoveGoal('thugb16', Get_ObjectPos('runfciv'), fn =
'continueChase')
def continueChase(event):
addMoveGoal('thugb16', Get_ObjectPos('runfciv'), fn =
'continueChase')
def endChase(event):
clearGoals('runfciv')
speakNoCB('runfciv', 'MISSPCH_1_F1_02')
More information about the Python-list
mailing list