As some of you may know I am working (very slowly) on my DOD mod and have so far completed 2 missions and I am working on a sub mission. Once I've finished the next two missions (they're quite short so I might be able to get them done soon if I don't go back to playing WOW) then I'll release an alpha/beta for y'all to test.
Anyway to cut a long story short. Is there any way to time how long it takes for a player to complete one mission and then save that time only to use it in an objective for the sub mission.
In the plot the team has to take down two gang leaders on opposite sides of the city at the same time to avoid one finding out about the other's demise and escaping. I thought that the best way to do this would be to time one mission and then give the team that amount of time to complete the sub mission. Would this be possible? I suppose I'd need to store the info in an outside script file somewhere, a bit like Dr mike did with his strangers mod, right?
Or have you guys got a better way to simulate what I want to do?
Thankyou very much
Lunarman
-----Edit-----
Oh yeah, has anyone figured out how you reactive lunarman's FFX gravity-flight after you load a save?
Sorry I've lost track, but is your mod in FF or FFvT3R?
This can be done but there isn't an easy way to do it in a saved-game safe manner. What I mean is that you pretty much have to assume that the time you read from the file is the right one for the current session. In other words, suppose a player finishes the mission you are timing, saves the game, and then decides to replay it and then saves that as something else. Regardless of which game he decides to load when he goes on to the next mission, the time will be for the last one played. That probably doesn't happen all that often and it wouldn't be a show stopper here (it would just mean the time isn't really exact), but it's something to know.
If you are using FFX 3.2, you can have something like the following in your OnMissionWon() function
fp = open('MyMod/Mission7aTime.txt','w')
fp.write('%f' % Mission_GetAttr('MLOG_GameTime'))
fp.close()
Then, in the OnPostInit() of the next mission, just call
fp = open('MyMod/Mission7aTime.txt','r')
lastmissiontime = float(fp.read())
fp.close()
# do whatever you want to do with the time...
Obviously, you can change the filename to something that makes sense for your mod and mission names.
For pre-FFX 3.2 versions of the game (FF or FFvT3R), you need extra code. First you need a function to track the game time.
def UpdateGameTime(event):
t = Mission_GetAttr('GameTime')
Mission_SetAttr('GameTime', t+1.0)
regTimer('UpdateGameTime',1.0)
And then, in your OnPostInit() you need to add
Mission_SetAttr('GameTime', 0.0)
regTimer('UpdateGameTime',1.0)
Then you could use the same code as above in OnMissionWon(), just changing the name of the mission attribute from 'MLOG_GameTime' to 'GameTime'.
I haven't tested any of this, so there may be some debugging to do, but it should get you started.
My mod is for FFVTTR. Thankyou very much stumpy, that's wonder code. I'm sure I'll be getting back to you on this.
Thanks
Lunarman
Here we are again, finally having got a new disk drive I've started modding again :). I've hit problems right away, but that's to be expected sin't it ;).
So: courtyard_cs=[
( "peace()",
"reviveHeroes()",
"startCS()",
"playTransition()",
"teleport('dod_lunarman', 'LMCSmarker')",
"teleport('dod_solar_flare', 'SFCSmarker')",
"lookAtPos((-1100, -585, 5), heading = 200, zoom = -250, pitch=-10)",
"wait(2.5)",),
( "AI_Animate('dod_solar_flare', 'melee')",
"speak('dod_solar_flare', 'MISSPCH_02_SF_02', CAPTION_AUTO)",),
( "speak('dod_lunarman', 'MISSPCH_02_LM_03', CAPTION_AUTO)",),
( "endCS()",
"ff.DishOutCP(bonus=50)",
"Mission_Win()",),
]
Above is the code for a short CS. The problem is it seems to be skipping Lunarman's speech. Normally this is caused by having to many CBs isn't it? I can't see that that is the case. What happens is the CS plays SF's speech and then goes straight to the mission win screen. If I comment out both "endCS()", and "Mission_Win()", then the CS plays as it should be doesn't end (obviously). If I have either one or both not commented out then it misses out step 3 as I said above. Any ideas as to why? (BTW, the script log says it's all normal).
Problem 2:This one's a little longer
opening_cs=[
( "startCS()",
"Camera_SetFade(1)",
"lookAtPos((990, -185, -5), heading = 135, zoom = -250, pitch=-20)",
"wait(0.5)", ),
( "Camera_UnFade(1.5)",
"wait(0.5)",
"RPG_SetActive(0)", ),
( "speakNoCB('dod_captain', 'MISSPCH_02_WH_01')",
"wait(2)",),
( "Object_PlayEffect(('CS_thug1'), 'effect_punch', FX_TRACK_OBJECT_FULL)",
"Object_PlayEffect(('CS_thug2'), 'effect_punch', FX_TRACK_OBJECT_FULL)",
"Object_PlayEffect(('CS_thug3'), 'effect_punch', FX_TRACK_OBJECT_FULL)",
"Sound_PlaySound('fx_tombstone_phantom_punch_2d', (0,0,0), 1.0)",
"RPG_SetActive(1)",
"wait(0.3)",),
( "kill('cs_thug1')",
"kill('cs_thug2')",
"kill('cs_thug3')",
"wait(0.3)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_02', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_03', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_04', CAPTION_AUTO)", ),
( "speakNoCB('dod_nightshadow', 'MISSPCH_02_WH_05')",
"playEffectMarker('effect_invis', 'nightshadow_port', 0, fn = '')",
"teleport ('dod_nightshadow', 'nightshadow_port')",
"wait(1)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_06', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_07', CAPTION_AUTO)",
"AI_Animate('dod_nightshadow', 'idle_1')", ),
( "speak('dod_captain', 'MISSPCH_02_WH_08', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_09', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_10', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_11', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_12', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_13', CAPTION_AUTO)",
"AI_Animate('dod_nightshadow', 'ranged_7')",),
( "endCS()",
"noLook()",
"Objective_Add('findboss', 'Take Down the Besucho Brothers', 0, 500)",
"AI_CancelAllSpeech()",
"ff.InitScripts()",
"setMission(1)",
"ff.FFX_InitMission()", ),
]
Quote>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
loading datfiles version 0.234000
ReadHeroIndexData: trouble reading or evaluating data from <c:\program files\irrational games\ffvttr\dod\HeroIndexData.txt>
Importing MLOG reader module version 0.995 with ['animator']
>>> C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py executed
precache
bellyofthebeastAstarted
setting up bubbles, interos, ais and reg deaths
cshelper: Cutscene [intro] submitted for playing
cshelper: Now playing cutscene [intro]
Step 1 of 18
Step 2 of 18
initialising FFQ_initialiseExtras() later: a cutscene is playing
Step 3 of 18
speakInternal
0
Step 4 of 18
exception happened in cutscene playback of step
exceptions.RuntimeError Object_PlayEffect(): expects args {ss|sifs0fOss}
Object_PlayEffect(('CS_thug1'), 'effect_punch', FX_TRACK_OBJECT_FULL)
exception happened in cutscene playback of step
exceptions.RuntimeError Object_PlayEffect(): expects args {ss|sifs0fOss}
Object_PlayEffect(('CS_thug2'), 'effect_punch', FX_TRACK_OBJECT_FULL)
exception happened in cutscene playback of step
exceptions.RuntimeError Object_PlayEffect(): expects args {ss|sifs0fOss}
Object_PlayEffect(('CS_thug3'), 'effect_punch', FX_TRACK_OBJECT_FULL)
Step 5 of 18
0
Step 6 of 18
0
speakInternal
0
Step 7 of 18
0
speakInternal
0
Step 8 of 18
0
speakInternal
0
Step 9 of 18
speakInternal
0
Step 10 of 18
0
speakInternal
0
the above is script log and code for a longer CS I start a level with. (in the script log it stops at 10 becuase that's when I quit, but the other steps run fine). Firstly, the object play effects arn't working, I don't know why this is, I copied them from Tales From The Navigator so I've no idea why they don't work, any thoughts on that? Secondly I'm having something similar to the last problem, the CS ends as soon as it starts, right on the first step before anyone speaks. Can you see why this is?
Thankyou very much
Lunarman
For the first CS, playTransition() has a CB, so there are two in your first block. Try playTransitionNoCB().
For the exceptions you are seeing in that opening CS, they are caused (as you mention) by bad arguments passed to Object_PlayEffect(). You probably want something more like
"Object_PlayEffect('CS_thug1', 'effect_punch', '', FX_TRACK_OBJECT_FULL)",
The object argument should just be a string (it doesn't need the parentheses, although those aren't the problem), and the interpreter expects a string parameter for the callback function before the flag you are giving for tracking. Since you aren't specifying a callback, just pass an empty string.
Thankyou Stumpy
Lunarman
Is there any way to disable a hero from using certain powers for a while? I have a CS where I only want a char to punch not use his area or projectile attack (I thought about setting his energy to zero except his projectile attack cost zero energy, althought I could change that). Can I disable powers or will I have to spawn a copy with only one power and swap them at the end of the CS?
Thankyou
Lunarman
Why not use peace() or AIPeace()?
I may not be reading your question right. Usually, during a CS, the characters are turned off by the aforementioned commands and any fighting they do is specified in the CS. If you want the characters to go on fighting during the CS without you scripting the fight, you probably want to do what you mentioned and make version with just the powers you want used and use him (after running him through the AI Generator, if you are using M25's AI for the NPCs).
currently I've been keeping the war() turned on so the chars fight but having RPGactive(1) so they don't do KB or harm each other. I think this is the only way to create fighting in a CS other than scripting all the anims and trigger powers individually. I think I'll keep the thugs fighting as they are but I'll script Captain's moves manually instead. Thx for the info Stumpy
ARGG. I'm very stuck now, I cann't see that I'm doing anything wrong. I guess I just don't understand lists:
# 02_thebellyofthebeastb
import js
import ff
import cshelper
import event
import ai
import goal
import random
from js import *
from ff import *
from cshelper import *
from event import *
from ai import *
from goal import *
from random import *
from ffx import *
#To Do
courtyard_list=('thug_with_bat16','thug_with_bat17','thug_with_bat18','thug_with_bat19','thug_with_gun12','thug_with_gun13','thug_with_gun14','thug_with_gun15','thug_with_gun16','thug_with_gun17','thug_with_grenade7','thug_with_grenade8','thug_with_grenade9','thug_with_grenade10','mafia5','mafia6','mafia7','mafioso5','mafioso6','mafioso7','mafioso4',)
bubble1_list=('thug_with_grenade4','thug_with_grenade5','thug_with_grenade1','thug_with_gun6','mafia2',)
bubble2_list=('thug_with_bat1','thug_with_bat2','mafioso3',)
bubble3_list=('thug_with_gun7','thug_with_gun8','thug_with_gun9','mafioso1',)
bubble4_list=('thug_with_bat3','thug_with_bat4','thug_with_bat5','thug_with_bat6','thug_with_bat7',)
bubble5_list=('mafia3','mafia4',)
bubble6_list=('thug_with_bat8','thug_with_gun21','mafioso8','mafioso9','mafioso10','mafioso11','mafioso12',)
bubble7_list=('tony','thug_with_gun22','thug_with_gun23','thug_with_gun24',)
bossbattle_list=('mafia15','mafioso17','mafioso16','mafia17','jonny_besucho','joey_besucho',)
def OnPostInit():
print 'bellyofthebeastAstarted'
Mission_SetSunlight(-137,57,1.5,0.2,(0.2,0.2,0.6))
Mission_SetShadows(-137,57,(0.2,0.2,0.4))
Mission_SetProjShadowBackground((1,1,1))
Mission_SetProjShadowColor((.6,.6,.6,1))
Campaign_AddMinion('thug_with_bat')
Campaign_AddMinion('thug_with_gun')
Campaign_AddMinion('mafia')
Campaign_Recruit('dod_lunarman')
Campaign_Recruit('dod_solar_flare')
Sound_PlayMusic('music_02_pirate', 0)
Setup_Bubbles()
cshelper.play(opening_cs,'intro')
Mission_SetAttr('', 0)
def OnPrecacheObjects():
print 'precache'
def OnMissionWon():
print 'Mission Won'
def OnMissionLose():
print 'Mission Lost'
#sets up the marker entrys and guard deaths
def Setup_Bubbles():
print 'setting up bubbles, interos, ais and reg deaths'
makeInterrogationCS('tony', oneshot = 1)
makeInterrogationCS('gav', oneshot = 1)
regDeath('jonny_besucho','On_jonny_KO')
regDeath('joey_besucho','On_joey_KO')
regHeroMarkerEnter('bubble1','On_bubble1_enter')
regHeroMarkerEnter('bubble2','On_bubble2_enter')
regHeroMarkerEnter('bubble3','On_bubble3_enter')
regHeroMarkerEnter('bubble4','On_bubble4_enter')
regHeroMarkerEnter('bubble5','On_bubble5_enter')
regHeroMarkerEnter('bubble6','On_bubble6_enter')
regHeroMarkerEnter('bubble7','On_bubble7_enter')
regHeroMarkerEnter('bossbattle','On_bossbattle_enter')
regHeroMarkerEnter('courtyard','On_courtyard_marker')
for bubble1 in bubble1_list:
AI_SetEnabled(bubble1, 0)
print 'bubble 1 AI turned off'
for bubble2 in bubble2_list:
AI_SetEnabled(bubble2, 0)
print 'bubble 2 AI turned off'
for bubble3 in bubble3_list:
AI_SetEnabled(bubble3, 0)
print 'bubble 3 AI turned off'
for bubble4 in bubble4_list:
AI_SetEnabled(bubble4, 0)
print 'bubble 4 AI turned off'
for bubble5 in bubble5_list:
AI_SetEnabled(bubble5, 0)
print 'bubble 5 AI turned off'
for bubble6 in bubble6_list:
AI_SetEnabled(bubble6, 0)
for bubble7 in bubble7_list:
AI_SetEnabled(bubble7, 0)
for bossbattle in bossbattle_list:
AI_SetEnabled(bossbattle, 0)
for courtyard in courtyard_list:
AI_SetEnabled(courtyard, 0)
def On_bubble1_enter(event):
print 'hero has entered bubble1'
for bubble1 in bubble1_list:
AI_SetEnabled(bubble1, 1)
def On_bubble2_enter(event):
print 'hero has entered bubble2'
for guards in bubble2_list:
AI_SetEnabled(bubble2, 1)
def On_bubble3_enter(event):
print 'hero has entered bubble3'
for guards in bubble3_list:
AI_SetEnabled(bubble3, 1)
def On_bubble4_enter(event):
print 'hero has entered bubble4'
for guards in bubble4_list:
AI_SetEnabled(bubble4, 1)
def On_bubble5_enter(event):
print 'hero has entered bubble5'
for guards in bubble5_list:
AI_SetEnabled(bubble5, 1)
def On_bubble6_enter(event):
print 'hero has entered bubble6'
for guards in bubble6_list:
AI_SetEnabled(bubble6, 1)
def On_bossbattle_enter(event):
print 'hero has entered the bossbattle'
for guards in bossbattle_list:
AI_SetEnabled(guards, 1)
def On_courtyard_enter(event):
cshelper.play(courtyard_cs,'end')
print 'hero has entered the courtyard'
for guards in courtyard_list:
AI_SetEnabled(guards, 1)
def On_jonny_KO():
speakNoCB('mafia1', 'MISSPCH_02_TU_02')
count = Mission_GetAttr('brosdead') + 1.0
if count >=2:
Objective_Complete('killbros')
Mission_SetAttr('brosdead',count)
def On_joey_KO():
speakNoCB('mafia1', 'MISSPCH_02_TU_02')
count = Mission_GetAttr('brosdead') + 1.0
if count >=2:
Objective_Complete('killbros')
Mission_SetAttr('brosdead',count)
#called when the hero enters the marker around the first guard house
def On_guard_marker_enter(event):
print 'hero has been caught by the guard'
speakNoCB('mafia1', 'MISSPCH_02_TU_02')
spawn('secondguard', 'mafia', 'mafia_spawn')
makeInterrogationCS('secondguard', oneshot = 1)
#called when the hero enters the gambling marker and plays the joke CS
def On_gambler_enter(event):
print 'hero has met the gamblers'
speak('thug_with_bat17', 'MISSPCH_02_TU_04', CAPTION_AUTO)
speak('thug_with_gun16', 'MISSPCH_02_TU_05', CAPTION_AUTO)
speak('dod_solar_flare', 'MISSPCH_02_SF_04', CAPTION_AUTO)
for gambler in gambler_list:
AI_SetEnabled(gambler, 1)
def On_courtyard_marker(event):
cshelper.play(courtyard_cs,'end')
if not(Objective_IsComplete('sneakguards') or Objective_IsFailed('sneakguards')):
Objective_Complete('sneakguards')
def DishOutCP(bonus=50):
heroes=GetAllHeroes()
for hero in heroes:
if Campaign_IsRecruited(hero):
Campaign_AddCP(hero,bonus)
#CUTSCENES-----
opening_cs=[
( "startCS()",
"Camera_SetFade(1)",
"lookAtPos((-1810, 899, 5), heading = 90, zoom = -270, pitch=-10)",
"wait(0.5)", ),
( "Camera_UnFade(1.5)",
"wait(0.5)",
"RPG_SetActive(0)", ),
( "speakNoCB('dod_captain', 'MISSPCH_02_WH_01')",
"wait(2)",),
( "Object_PlayEffect('cs_thug1', 'effect_punch', '', FX_TRACK_OBJECT_FULL)",
"Object_PlayEffect('cs_thug2', 'effect_punch', '', FX_TRACK_OBJECT_FULL)",
"Object_PlayEffect('cs_thug3', 'effect_punch', '', FX_TRACK_OBJECT_FULL)",
"Sound_PlaySound('fx_tombstone_phantom_punch_2d', (0,0,0), 1.0)",
"RPG_SetActive(1)",
"peace()",
"wait(0.3)",),
( "kill('cs_thug1')",
"kill('cs_thug2')",
"kill('cs_thug3')",
"wait(0.3)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_02', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_03', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_04', CAPTION_AUTO)", ),
( "speakNoCB('dod_nightshadow', 'MISSPCH_02_WH_05')",
"playEffectMarker('effect_invis', 'nightshadow_port', 0, fn = '')",
"teleport ('dod_nightshadow', 'nightshadow_port')",
"wait(1)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_06', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_07', CAPTION_AUTO)",
"AI_Animate('dod_nightshadow', 'idle_1')", ),
( "speak('dod_captain', 'MISSPCH_02_WH_08', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_09', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_10', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_11', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_02_WH_12', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_13', CAPTION_AUTO)",
"AI_Animate('dod_nightshadow', 'ranged_7')",),
( "endCS()",
"war()",
"noLook()",
"Objective_Add('findboss', 'Take Down the Besucho Brothers', 0, 500)",
"AI_CancelAllSpeech()",
"ff.InitScripts()",
"setMission(1)",
"ff.FFX_InitMission()", ),
]
interrogate_gav_cs=[
(
"speakNoCB('mafia4', 'MISSPCH_02_TU_03')",
"wait(3.5)",
),
(
"kill('secondguard', force = 1)",
"addArrowObject('pointtotony', 'tony', js.ARROW_YELLOW)",
),
]
interrogate_tony_cs=[
(
"speakNoCB('mafia4', 'MISSPCH_02_TU_03')",
"wait(3.5)",
),
(
"kill('secondguard', force = 1)",
"addArrow('pointtobossbattle', 'bossbattle')",
),
]
]
Above is the whole of my mission script. I've got three problems.
1) Captain is being activated with the attribute Empath [spoiler]
Quote>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
loading datfiles version 0.234000
ReadHeroIndexData: trouble reading or evaluating data from <c:\program files\irrational games\ffvttr\dod\HeroIndexData.txt>
Importing MLOG reader module version 0.995 with ['animator']
>>> C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py executed
precache
bellyofthebeastAstarted
setting up bubbles, interos, ais and reg deaths
bubble 1 AI turned off
bubble 1 AI turned off
bubble 1 AI turned off
bubble 1 AI turned off
bubble 1 AI turned off
bubble 2 AI turned off
bubble 2 AI turned off
bubble 2 AI turned off
bubble 3 AI turned off
bubble 3 AI turned off
bubble 3 AI turned off
bubble 3 AI turned off
bubble 4 AI turned off
bubble 4 AI turned off
bubble 4 AI turned off
bubble 4 AI turned off
bubble 4 AI turned off
bubble 5 AI turned off
bubble 5 AI turned off
cshelper: Cutscene [intro] submitted for playing
cshelper: Now playing cutscene [intro]
Step 1 of 18
Step 2 of 18
initialising FFQ_initialiseExtras() later: a cutscene is playing
Step 3 of 18
speakInternal
0
Step 4 of 18
Step 5 of 18
Step 6 of 18
0
speakInternal
0
Step 7 of 18
0
speakInternal
0
Step 8 of 18
0
speakInternal
0
Step 9 of 18
speakInternal
0
Step 10 of 18
0
speakInternal
0
Step 11 of 18
0
speakInternal
0
Step 12 of 18
0
speakInternal
0
Step 13 of 18
0
speakInternal
0
Step 14 of 18
0
speakInternal
0
Step 15 of 18
0
speakInternal
0
Step 16 of 18
0
speakInternal
0
Step 17 of 18
0
speakInternal
0
Step 18 of 18
MLOG_Init: time 0.0151832 sec
initialising FFX: skirmish=0
numberStr=
storing dod_captain: id_1,0
numberStr=
storing dod_nightshadow: id_2,0
cshelper: Cutscene [intro] has ended
cutscene has been cancelled
cshelper: Cutscene [intro] has ended
initialising FFQ_initialiseExtras()
>>> see()
>>> look()
Traceback (innermost last):
File "<string>", line 1, in ?
TypeError: not enough arguments; expected 1, got 0
dod_lunarman : ffqlowgravflier
dod_solar_flare : solarpowered
dod_captain : empath
jonny_besucho : symbiote
jonny_besucho : glassjaw
joey_besucho : ironjaw
joey_besucho : invulnerable2
joey_besucho : symbiote
getting default sun
(-137.0, 57.0, 1.5, 0.20000000298, (0.20000000298, 0.20000000298, 0.600000023842))
[/spoiler] it also shows this happening in the script log. But Captain doesn't have Empathy any more, I deleted it after I found it a little too damaging. Why is it still activating on him when he doesn't have it?
2) The AI, this is my main problem. Basically there are 7 bubbles of enemies on the map. I wrote down the names of each unit under each bubble and put them in the lists at the top of the page. Have I done that right? If yes then I must be doing something wrong in the calling of the lists.
Each bubble has got this code
bubble1_list=('thug_with_grenade4','thug_with_grenade5','thug_with_grenade1','thug_with_gun6','mafia2',)
regHeroMarkerEnter('bubble1','On_bubble1_enter')
for bubble1 in bubble1_list:
AI_SetEnabled(bubble1, 0)
print 'bubble 1 AI turned off'
def On_bubble1_enter(event):
print 'hero has entered bubble1'
for bubble1 in bubble1_list:
AI_SetEnabled(bubble1, 1)
That's all I need, right? What shoudl happen is in the beginning of the mission the AI is cancelled for all the units in bubble1_list. Then when the hero enters the bubble the AI is turned on. Please tell me what I've done wrong, I bet it's do to with my lack of general python coding knowledge not the FF specific stuff.
3) How do I get the music to loop forever. I'm sure in the past I just used this
Sound_PlayMusic('music_02_pirate', 0)
or
Sound_PlayMusic('music_02_pirate')
but for this mission it doesn't seem to work, why?
Thankyou very much as always :D
Lunarman
P.s. the font for the Code boxes makes l and 1 look the same, but you can guess which is which can't you?
QuoteBut Captain doesn't have Empathy any more, I deleted it after I found it a little too damaging. Why is it still activating on him when he doesn't have it?
Did you re-start the campaign over from the beginning after making the change? If you didn't, then Captain's old stats are being pulled from your save file, even if you hadn't already recruited him. Yes, it is annoying.
Quote2) The AI, this is my main problem. Basically there are 7 bubbles of enemies on the map. I wrote down the names of each unit under each bubble and put them in the lists at the top of the page. Have I done that right? If yes then I must be doing something wrong in the calling of the lists.
I don't see anything wrong (although I'm no coding genius) but I do know that the engine can stubbornly refuse to turn AI's off sometimes.
You're mixing peace() and war() with AI_Enable(). peace() turns of ALL of the AIs, and war() turns on ALL of the AIs. It doesn't matter what you've done with them before, war() will still turn all of them back on.
In this case, I would call Setup_Bubbles() at the end of the opening cutscene (opening_cs) instead of in OnPostInit(). Something like:
( "endCS()",
"war()",
"noLook()",
"Objective_Add('findboss', 'Take Down the Besucho Brothers', 0, 500)",
"AI_CancelAllSpeech()",
"ff.InitScripts()",
"setMission(1)",
"ff.FFX_InitMission()",
"ff.Setup_Bubbles()", ),
Duh! I should have seen that!
This is yet another reason why m25 is THE man!
AHH, thankyou. It never occured to me that this would happen because I just presumed peace() and war() were seperate from other AIs being turned on and off.
Thanks to both of you
Lunarman
oh this is great! I'm going to be able to finish this level without any more hitches most likely. If I can figure out the music, it's still not looping, it only plays once. Any ideas why?
Thankyou
Yes.... so much for the above post.
I'm right at the end, then it should be too more levels (with their scripting ripped from FFVTTR missions :) ) and then first story arc (5 missions) will be out for release (or at least beta).
Expect something around the 10th July at the latest.
Ok, two problems.
Firstly, Lunarman uses gravity flight. This attribute works great when the mission is played through for the first time. If you save your game and then load his flight power stops being available. In others words, he never gets re-boyancified. All the other FFX, state swaps and such, work fine however. Any ideas on how to fix this?
I tried having
"ff.InitScripts()",
"ff.FFX_InitMission()",
call at the end of every CS but that didn't fix it.
Question 2:
Cutscene
bossbattle_cs=[
( "startCS()",
"wait(2)",
"peace()",
"reviveHeroes()",
"teleport('dod_captain', 'TEAMCSMARKER1')",
"teleport('dod_lunarman', 'TEAMCSMARKER2')",
"teleport('dod_nightshadow', 'TEAMCSMARKER3')",
"teleport('dod_solar_flare', 'TEAMCSMARKER4')",
"lookAtPos((654, 706, 0), heading = -134, zoom = -215)", ),
( "speak('dod_lunarman', 'MISSPCH_02_WH_55', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_56', CAPTION_AUTO)",
"turnTo('dod_nightshadow', 'dod_lunarman')", ),
( "speak('dod_lunarman', 'MISSPCH_02_WH_57', CAPTION_AUTO)",
"turnTo('dod_lunarman', 'dod_nightshadow')", ),
( "speak('dod_nightshadow', 'MISSPCH_02_WH_58', CAPTION_AUTO)",
"AI_Animate('dod_nightshadow', 'dodge_left_a')", ),
( "speak('dod_lunarman', 'MISSPCH_02_WH_59', CAPTION_AUTO)",
"AI_Animate('dod_lunarman', 'ranged_2')", ),
( "speak('jonny_besucho', 'MISSPCH_02_WH_60', CAPTION_AUTO)",
"turnTo('dod_lunarman', 'bossbattle')",
"turnTo('dod_nightshadow', 'bossbattle')",),
( "speakNoCB('dod_lunarman', 'MISSPCH_02_WH_61')",
"wait(3)",
"Sound_StopMusic()",
"lookAtPos((787, 706, 0), heading = 44, zoom = -263, time = 3.5)", ),
( "speakNoCB('joey_besucho', 'MISSPCH_02_WH_62')",
"Object_Destroy('sc_pat_streetlight1')",
"Object_Destroy('sc_pat_streetlight2')",
"Object_Destroy('sc_pat_streetlight3')",
"Object_Destroy('sc_pat_streetlight4')",
"Object_Destroy('sc_pat_streetlight5')",
"Object_Destroy('sc_pat_streetlight6')",
"Object_Destroy('sc_pat_streetlight7')",
"Object_Destroy('sc_pat_streetlight8')",
"wait(2)",
"spawn('streetlight1', 'pat_streetlight_night', 'streetlightpos1')",
"spawn('streetlight2', 'pat_streetlight_night', 'streetlightpos2')",
"spawn('streetlight3', 'pat_streetlight_night', 'streetlightpos3')",
"spawn('streetlight4', 'pat_streetlight_night', 'streetlightpos4')",
"spawn('streetlight5', 'pat_streetlight_night', 'streetlightpos5')",
"spawn('streetlight6', 'pat_streetlight_night', 'streetlightpos6')",
"spawn('streetlight7', 'pat_streetlight_night', 'streetlightpos7')",
"spawn('streetlight8', 'pat_streetlight_night', 'streetlightpos8')", ),
( "speak('jonny_besucho', 'MISSPCH_02_WH_63', CAPTION_AUTO)",
"lookAtPos((778, 706, 0), heading = -137, zoom = 47, time = 1.5)", ),
( "speak('joey_besucho', 'MISSPCH_02_WH_64', CAPTION_AUTO)",
"AI_Animate('joey_besucho', 'melee_b')", ),
( "war",
"ff.bossbattle()",
"endCS()", ),
]
Some related events:
def On_jonny_KO():
count = Mission_GetAttr('brosdead') + 1.0
if count >=2:
Objective_Complete('findboss')
aftermath()
print 'Jonny dead'
Mission_SetAttr('brosdead',count)
def aftermath():
Campaign_Recruit('dod_nightshadow')
Campaign_Recruit('dod_captain')
Campaign_AddVillain('joey_besucho')
Campaign_AddVillain('jonny_besucho')
cshelper.play(finale_cs,'final')
def On_joey_KO():
count = Mission_GetAttr('brosdead') + 1.0
if count >=2:
Objective_Complete('findboss')
aftermath()
print 'Jonny dead'
Mission_SetAttr('brosdead',count)
The regdeath code
def Setup_Bubbles():
print 'setting up bubbles, interos, ais and reg deaths'
makeInterrogationCS('tony', oneshot = 1)
makeInterrogationCS('gav', oneshot = 1)
regDeath('jonny_besucho','On_jonny_KO')
regDeath('joey_besucho','On_joey_KO')
regHeroMarkerEnter('bubble1','On_bubble1_enter')
regHeroMarkerEnter('bubble2','On_bubble2_enter')
regHeroMarkerEnter('bubble3','On_bubble3_enter')
regHeroMarkerEnter('bubble4','On_bubble4_enter')
regHeroMarkerEnter('bubble5','On_bubble5_enter')
regHeroMarkerEnter('bubble6','On_bubble6_enter')
regHeroMarkerEnter('bubble7','On_bubble7_enter')
regHeroMarkerEnter('bossbattle','On_bossbattle_enter')
regHeroMarkerEnter('courtyard','On_courtyard_marker')
for bubble1 in bubble1_list:
AI_SetEnabled(bubble1, 0)
print 'bubble 1 AI turned off'
for bubble2 in bubble2_list:
AI_SetEnabled(bubble2, 0)
print 'bubble 2 AI turned off'
for bubble3 in bubble3_list:
AI_SetEnabled(bubble3, 0)
print 'bubble 3 AI turned off'
for bubble4 in bubble4_list:
AI_SetEnabled(bubble4, 0)
print 'bubble 4 AI turned off'
for bubble5 in bubble5_list:
AI_SetEnabled(bubble5, 0)
print 'bubble 5 AI turned off'
for bubble6 in bubble6_list:
AI_SetEnabled(bubble6, 0)
for bubble7 in bubble7_list:
AI_SetEnabled(bubble7, 0)
for bossbattle in bossbattle_list:
AI_SetEnabled(bossbattle, 0)
for courtyard in courtyard_list:
AI_SetEnabled(courtyard, 0)
Postinit
def OnPostInit():
print 'bellyofthebeastAstarted'
Mission_SetSunlight(-137,57,1.5,0.2,(0.2,0.2,0.6))
Mission_SetShadows(-137,57,(0.2,0.2,0.4))
Mission_SetProjShadowBackground((1,1,1))
Mission_SetProjShadowColor((.6,.6,.6,1))
Campaign_AddMinion('thug_with_bat')
Campaign_AddMinion('thug_with_gun')
Campaign_AddMinion('mafia')
Campaign_Recruit('dod_lunarman')
Campaign_Recruit('dod_solar_flare')
Sound_PlayMusic('music_02_pirate', 99)
Setup_Bubbles()
cshelper.play(opening_cs,'intro')
Mission_SetAttr('brosdead', 0.1)
right, now you've seen the code I'll explain. I'm having a problem with attributes. What I want is for aftermath to be called once both Besucho brothers are dead (that's Jonny and Joey) but for some reason it's not working. The CS runs fine (I just included it incase it caused the script to break or something) but after the CS there is no more events except this attribute stuff.
I'm guessing you can see what's supposed to happen but I'll explain anyway. The brothers are k.od and when one dies the counter goes up to 1 then the next time the counter rises to 2 causing the if to be fulfilled. This makes the final CS play. For some reason nothing gets counted. Or, if it gets counted it doesn't trigger.
The script log has nothing more to say after the CS except this:
TypeError: no arguments expected
Any hints?
Thankyou ever so much, as always!
Lunarman
Yeah, it's pretty simple.
When you use regDeath, the function used MUST have an arguement, or you will get that error and it will not run.
So, your death fuction should be:
def On_jonny_KO(event):
count = Mission_GetAttr('brosdead') + 1.0
if count >=2:
Objective_Complete('findboss')
aftermath()
print 'Jonny dead'
Mission_SetAttr('brosdead',count)
By the way, you don't have to have a separate function for each brother. It should work just as well if both use the same one. It's not that important, though.
thankyou Catwho
I see now
finally all done. Well it took a day ironing out all the bugs in those missions.
Next one! :)
Another mission:
Right, this one's going well and might even be finished in a few hours but there's a big problem.
FFX isn't initializing.
First few times I tested the mission it worked great, then I made a few tiny script adjustments
interrogate_waiter2_cs=[
( "startCS()",
"look('waiter2', time = 0)",
"wait(1.5)", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_23', CAPTION_AUTO)", ),
( "speak('waiter2', 'MISSPCH_03_LQ_22', CAPTION_AUTO)", ),
( "spawn('hitman6', 'mafia', 'waiter2')",
"spawn('hitman7', 'thug_with_gun', 'customer8')",
"spawn('hitman8', 'mafia', 'customer9')",
"spawn('hitman9', 'mafia', 'customer10')",
"spawn('hitman10', 'thug_with_gun', 'customer11')",
"wait(0.2)", ),
( "Object_Destroy('customer8')",
"Object_Destroy('customer9')",
"Object_Destroy('customer10')",
"Object_Destroy('customer11')",
"Object_Destroy('waiter2')",
"wait(0.2)", ),
( "endCS()", ),]
all I did was change the templates used in this CS and next time I loaded it FFX didn't init.
Here's the log:
[spoiler]>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
loading datfiles version 0.234000
ReadHeroIndexData: trouble reading or evaluating data from <c:\program files\irrational games\ffvttr\dod\HeroIndexData.txt>
Importing MLOG reader module version 0.995 with ['animator']
>>> C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py executed
precache
postinit
cshelper: Cutscene [intro] submitted for playing
cshelper: Now playing cutscene [intro]
Step 1 of 5
Step 2 of 5
speakInternal
0
initialising FFQ_initialiseExtras() later: a cutscene is playing
Step 3 of 5
0
speakInternal
0
Step 4 of 5
0
speakInternal
0
Step 5 of 5
addArrow waiter1arrow waiter1 0 1
addArrow waiter2arrow waiter2 0 1
addArrow waiter3arrow waiter3 0 1
addArrow singerarrow singer1 0 1
MLOG_Init: time 0.0026772 sec
cshelper.ParseNumber - bad name: civilian_male1
cshelper.ParseNumber - bad name: civilian_male6
cshelper.ParseNumber - bad name: civilian_male2
cshelper.ParseNumber - bad name: civilian_male10
cshelper.ParseNumber - bad name: civilian_male7
cshelper.ParseNumber - bad name: civilian_male11
cshelper.ParseNumber - bad name: civilian_male3
cshelper.ParseNumber - bad name: civilian_male8
cshelper.ParseNumber - bad name: civilian_male4
cshelper.ParseNumber - bad name: civilian_male9
cshelper.ParseNumber - bad name: civilian_male5
cshelper.ParseNumber - bad name: civilian_female2
cshelper.ParseNumber - bad name: civilian_female11
cshelper.ParseNumber - bad name: civilian_female3
cshelper.ParseNumber - bad name: civilian_female4
cshelper.ParseNumber - bad name: civilian_female5
cshelper.ParseNumber - bad name: civilian_female6
cshelper.ParseNumber - bad name: civilian_female10
cshelper.ParseNumber - bad name: civilian_female7
cshelper.ParseNumber - bad name: civilian_female8
cshelper.ParseNumber - bad name: civilian_female9
cshelper.ParseNumber - bad name: civilian_female1
cshelper.ParseNumber - bad name: civilian_male1
cshelper.ParseNumber - bad name: civilian_male6
cshelper.ParseNumber - bad name: civilian_male2
cshelper.ParseNumber - bad name: civilian_male10
cshelper.ParseNumber - bad name: civilian_male7
cshelper.ParseNumber - bad name: civilian_male11
cshelper.ParseNumber - bad name: civilian_male3
cshelper.ParseNumber - bad name: civilian_male8
cshelper.ParseNumber - bad name: civilian_male4
cshelper.ParseNumber - bad name: civilian_male9
cshelper.ParseNumber - bad name: civilian_male5
cshelper.ParseNumber - bad name: civilian_female2
cshelper.ParseNumber - bad name: civilian_female11
cshelper.ParseNumber - bad name: civilian_female3
cshelper.ParseNumber - bad name: civilian_female4
cshelper.ParseNumber - bad name: civilian_female5
cshelper.ParseNumber - bad name: civilian_female6
cshelper.ParseNumber - bad name: civilian_female10
cshelper.ParseNumber - bad name: civilian_female7
cshelper.ParseNumber - bad name: civilian_female8
cshelper.ParseNumber - bad name: civilian_female9
cshelper.ParseNumber - bad name: civilian_female1
initialising FFX: skirmish=0
numberStr=
storing dod_lunarman: id_1,0
numberStr=
storing dod_nightshadow: id_2,0
cshelper: Cutscene [intro] has ended
initialising FFQ_initialiseExtras()
dod_lunarman : ffqlowgravflier
dod_solar_flare : solarpowered
dod_lunarman : ffqlowgravflier
getting default sun
(-45.0, 45.0, 1.0, 0.800000011921, (1.0, 1.0, 1.0))
Traceback (innermost last):
File "C:\Program Files\Irrational Games\FFVTTR\.\DOD\missions\scripts\ffx.py", line 650, in initAttribs
object=initialiseChar(object)
File "C:\Program Files\Irrational Games\FFVTTR\.\DOD\missions\scripts\ffx.py", line 748, in initialiseChar
templateNumber=string.atoi(template[16:])
ValueError: invalid literal for atoi():
cshelper: Cutscene [ff.interrogate_waiter1_cs] submitted for playing
cshelper: Now playing cutscene [ff.interrogate_waiter1_cs]
Step 1 of 8
Step 2 of 8
0
speakInternal
0
Step 3 of 8
0
speakInternal
0
Step 4 of 8
Step 5 of 8
Step 6 of 8
0
speakInternal
0
Step 7 of 8
0
speakInternal
0
Step 8 of 8
cshelper: Cutscene [ff.interrogate_waiter1_cs] has ended
cutscene has been cancelled
cshelper: Cutscene [ff.interrogate_waiter1_cs] has ended
[/spoiler]
you can ignore all the civilian stuff, that's the chatter not working.
It's this bit which looks important
QuoteFile "C:\Program Files\Irrational Games\FFVTTR\.\DOD\missions\scripts\ffx.py", line 650, in initAttribs
object=initialiseChar(object)
File "C:\Program Files\Irrational Games\FFVTTR\.\DOD\missions\scripts\ffx.py", line 748, in initialiseChar
templateNumber=string.atoi(template[16:])
ValueError: invalid literal for atoi():
Is that stopping the initialization? I've had a look at the FFX file and those lines are in the initialisation section. That bit is in the spoiler tag below because it's FFX3.0 I'm using (in case you don't have that code anymore :) )
[spoiler]
##################### INITIALISATION AND UPDATE OF ALL ATTRIBUTES ##########################
def initAttribs(event):
#identify which heros have the 'modified' attributes
#do all tempforms first so we can fill in the default arrays
for object in js.Mission_GetDynamicObjects():
if (Object_GetClass(object) & FFX_CHARACTER):
if (hasAttribute(object,'tempform')!=0) | (hasAttribute(object,'involuntaryform')!=0):
object=initialiseChar(object)
for object in js.Mission_GetDynamicObjects():
if (Object_GetClass(object) & FFX_CHARACTER):
if (hasAttribute(object,'tempform')==0) & (hasAttribute(object,'involuntaryform')==0):
object=initialiseChar(object)
RegTimer('updateAttribs5',0.5)
RegTimer('updateFFX',1)
RegTimer('updateStates',1.25)
###! changed for character-specific attributes such as Latent Mutant
def hasAttribute(char,attrib):
hasAttr = FFX_ObjectGetAttr(Object_GetTemplate(char),attrib)!=0
if hasAttr == 1:
return 1
elif FFX_ObjectGetAttr(char, 'special_cases') > 0:
for eachAttr in getFFXAttributesForCharacter(char):
if attrib == eachAttr:
#print "%s has character-specific attribute %s"%(char,attrib)
hasAttr = 1
break
return hasAttr
# def GetDefaultTactics(char):
# newTactics=[FFX_GetTemplate(char),['timer',4,],]
# for tactics in FFXTactics:
# if hasAttribute(char,tactics[0]):
# for tt in tactics[1:]:
# newTactics[1].append(tt)
# return newTactics
def FFX_Report(string):
print string
# if Mission_GetAttr("FFX_RULES_WHOAMI"):
# Mission_StatusText(string)
##########################################################################
#
# CHARACTER INITIALISATION
#
##########################################################################
def transformCheck(event):
char=event.object
# print 'Transformcheck:%s,%d vs %d'%(char,FFX_ObjectGetAttr(char,'original'),Object_GetAttr(char,'complex'))
if FFX_ObjectGetAttr(char,'original')!=Object_GetAttr(char,'complex'):
Object_SetAttr(char,'ffxState',FFX_STATE_UNINITIALISED)
else:
RegTimer('transformCheck',0.1,0,char)
def initialiseCharEv(event):
initialiseChar(event.object)
def initialiseChar(obj):
char=obj
#m25ai.AIDisable(char)
t=FFX_GetTemplate(char)
force=0
if FFX_ObjectGetAttr(char,'original',-1)!=-1:
if FFX_ObjectGetAttr(char,'original')!=Object_GetAttr(char,'complex'):
force=1
if t!=Object_GetTemplate(char) or force==1:
for temp in FFX_Transformers:
if t==temp:
print 'reconstructing transformer'
char=getFormName()
port=FFX_HasPortrait(obj)
AI_DestroyHeroAI(obj)
FFX_Spawn(char,temp,obj,0)
FFX_AdjustPortrait(char,port)
Object_SetAttr(char,'health',Object_GetAttr(obj,'health'))
Object_SetAttr(char,'energyPoints',Object_GetAttr(obj,'energyPoints'))
Object_SetAttr(char,'heroPoints',Object_GetAttr(obj,'heroPoints'))
m25ai.TransferAI(char,obj) #make sure the AI gets transfered to the new version!
Object_Destroy(obj)
FFX_ObjectSetAttr(char,'original',Object_GetAttr(char,'complex'))
RegTimer('transformCheck',1,0,char)
Mission_SelectHero(char)
RegTimer('initialiseCharEv',0.05,0,char)
return
else:
#in campaign mode - this keeps checking law and order to see if a transform has happened
for temp in FFX_Transformers:
if t==temp:
print 'transformer detected:%s,%s'%(t,char)
FFX_ObjectSetAttr(char,'original',Object_GetAttr(char,'complex'))
RegTimer('transformCheck',1,0,char)
Object_SetAttr(char,'ffxState',0)
Object_SetAttr(char,'baseStrength',Object_GetAttr(char,'strength'))
Object_SetAttr(char,'baseSpeed',Object_GetAttr(char,'speed'))
FFX_ObjectSetAttr(char,'baseEnergy',Object_GetAttr(char,'energy'))
FFX_ObjectSetAttr(char,'baseMat',Object_GetAttr(char,'material')) ###!
Object_SetAttr(char,'templateSpeed',Object_GetAttr(char,'speed'))
Object_SetAttr(char,'templateStrength',Object_GetAttr(char,'strength'))
Object_SetAttr(char,'templateAgility',Object_GetAttr(char,'agility'))
cshelper.addAttr('ffxNextID',1)
Object_SetAttr(char,'ffxID',Mission_GetAttr('ffxNextID'))
if Object_GetTemplate(char)=='ffx_tiggot':
return char
RegTimer('initAttribsEvent',1,0,char)
RegTimer('OnInitialiseCharCB',1,0,char)
template=Object_GetTemplate(char)
if (template[:6]=='custom') & (template[:10]!='custom_vil'):
templateNumber=string.atoi(template[16:])
Mission_SetAttr('%s_ID'%(FFX_GetTemplate(char)),templateNumber)
FFX_ObjectSetAttr(char,'baseMass',Object_GetAttr(char,'mass'))
FFX_ObjectSetAttr(char,'baseMinForce',Object_GetAttr(char,'minForce'))
initCarriers(char)
setGender(char)
#print '%s has gender %d'%(char,Object_GetAttr(char,'gender'))
initFX(char)
if isMP()==0:
if Object_GetClass(char)&OC_CONTROLLABLE:
AddWeaponCommands(char)
#m25ai.AIEnable(char)
if m25ai.InSkirmishMode():
m25ai.SetupCharacter(char)
return char
def initFX(char):
temp=FFX_GetTemplate(char)
for set in FFX_CUSTOM_FX:
if set[0]==temp:
fx=set[1]
flags=FX_LOOP|FX_TRACK_OBJECT_POS
if set[2]=='rotate':
flags=FX_LOOP|FX_TRACK_OBJECT_FULL
node=set[3]
Object_PlayEffect(char,fx,'',flags,0,node)
def initAttribsForChar(char,update=0):
template=Object_GetTemplate(char)
Object_SetAttr(char,'ffxState',0)
for attrib in ffxAttribs:
if attrib[0]==template:
#first check for attributes in the combo list
done=0
for set in ffxMultis:
if set[0]==attrib[1]:
done=1
for attribute in set[1:]:
init="init%s('%s',%d)"%(attribute,char,update)
if FFX_DEBUGSTARTUP:
FFX_ObjectSetAttr(Object_GetTemplate(char),attribute,1)
exec init
else:
try:
FFX_ObjectSetAttr(Object_GetTemplate(char),attribute,1)
exec init
except:
print 'error in initialising attribute %s through %s'%(attribute,attrib[1])
Mission_StatusText('error in initialising attribute %s through %s'%(attribute,attrib[1]))
if done==0:
init="init%s('%s',%d)"%(attrib[1],char,update)
if FFX_DEBUGSTARTUP:
FFX_ObjectSetAttr(Object_GetTemplate(char),attrib[1],1)
exec init
else:
try:
FFX_ObjectSetAttr(Object_GetTemplate(char),attrib[1],1)
#print 'setting:%s %s %s'%(char,Object_GetTemplate(char),attrib[1])
saveFFXAttributesForTemplate(Object_GetTemplate(char), attrib[1]) ###! changed for attribute identification and manipulation
exec init
except:
print 'error in initialising attribute %s'%(attrib[1])
Mission_StatusText('error in initialising attribute %s'%(attrib[1]))
#delay this so it knows what attributes a character has
#M25 updated May 10, 2005
if update==0:
if usingM25AI():
m25ai.SetDefaultTactics(char)
#end update
def initAttribsEvent(event):
initAttribsForChar(event.object,event.user)
def usingM25AI():
return Mission_GetAttr('ffxCampaign')==0 or Mission_GetAttr("FFX_RULES_CAMPAIGN_M25AI")!=0
materialFactors=[1,3,2.5,1.25,0.75,1,1,1.5,1,1.5]
def FFX_GetTemplate(char):
temp=Object_GetTemplate(char)
otemp=temp
#strip off the '_npc' bit
if temp[-4:]=='_npc':
temp=temp[:-4]
#strip off the '_extra' bit
if temp[-6:]=='_extra':
temp=temp[:-6]
if isMP():
return temp
if Template_Exists(temp) or Template_Exists(otemp):
return temp
complex=int(Object_GetAttr(char,'complex'))
if complex==0:
return temp
try:
# if complex>2000:
# return ffxSaved[complex-2001][0]
if complex>1000:
return ffxIDs[complex-1001][0]
else:
result=ffxbuiltins[complex-1]
if result=='generic_hero':
return temp
return result
except:
return temp
#strips off '_mp' at the end
def FFX_GetTemplateMP(char):
temp=FFX_GetTemplate(char)
if temp[-3:]=='_mp':
temp=temp[:-3]
return temp
def testtemp(char):
id=storeTemplate(char)
t1=Object_GetTemplate(char)
t2=retrieveTemplate(id)
print 'char=%s temp=%s ->ID=%d->temp%s'%(char,t1,id,t2)
#given a name returns a unique integer ID
def storeTemplate(char):
index=Object_GetAttr(char,'complex')
temp=Object_GetTemplate(char)
#deal with specials like squadX_templateY and custom_template_XX
if temp[:5]=='squad':
squad=string.atoi(temp[5])
num=string.atoi(temp[15])
index=-1000-squad*16-num
if temp[:16]=='custom_template_':
index=-string.atoi(temp[16:])
if temp[:11]=='custom_vil_':
index=-2000-string.atoi(temp[11:])
return index
#given an ID form store template, returns the original template name
def retrieveTemplate(id):
complex=int(id)
# if complex>2000:
# return ffxSaved[complex-2001][0]
if complex>1000:
return ffxIDs[complex-1001][0]
elif complex>0:
return ffxbuiltins[complex-1]
elif complex>-1000:
return 'custom_template_%d'%(-complex)
elif complex>-2000:
num=(-1000-complex)&15
squad=(-1000-complex)&240
return 'squad%d_template%d'%(squad,num)
else:
return 'custom_vil_%d'%(-2000-complex)
customTemplates=[]
def makeTemplateForCustom(name):
#check our list first
for temp in ffx.customTemplates:
if temp==name:
return 1
#do any exist at the moment?
if len(cshelper.getAll(name))>0:
ffx.customTemplates.append(name)
return 1
#no? try spawning one then
js.new(name,(3000,3000,0))
res=0
for obj in cshelper.getAll(name):
if res==0:
ffx.customTemplates.append(name)
res=1
Object_Destroy(obj)
return res
[/spoiler]
If you think upgrading to FFX3.2 would help I'm still worried about it because I'm frightened I'll miss something and the whole mod will break ;). Catwho said upgrading was really hard as well.
Anyway, has anyone got any ideas as to why this isn't working?
Thankyou
Lunarman
I can't fit this in the char limit ;)
but here's the full script
# ------------------------------------------
# Mission 03a: Latin Quarter
# ------------------------------------------
import js
import ff
import cshelper
import event
import ai
import goal
import random
from js import *
from ff import *
from cshelper import *
from event import *
from ai import *
from goal import *
from random import *
from ffx import *
def TooLate(event):
cshelper.play(time_cs,'outoftime')
def Setup_intero():
Objective_Add('capturebro', 'Find Jonny Besucho within 15 minutes!', 0, 500)
Sound_PlayMusic('music_03_latin')
makeCriticalCustomCS('waiter1', oneshot = 1)
makeCriticalCustomCS('waiter2', oneshot = 1)
makeCriticalCustomCS('waiter3', oneshot = 1)
makeCriticalCustomCS('singer1', oneshot = 1)
addArrow('waiter1arrow','waiter1',ARROW_RED,1)
addArrow('waiter2arrow','waiter2',ARROW_RED,1)
addArrow('waiter3arrow','waiter3',ARROW_RED,1)
addArrow('singerarrow','singer1',ARROW_RED,1)
regTimer('TooLate', 900)
Mission_DisplayTimer('Time Left', 900)
AI_SetEnabled('singer1', 0)
AI_SetEnabled('singer2', 0)
InitScripts()
setMission(1)
blind()
setupChatter()
FFX_InitMission()
def OnPostInit():
print 'postinit'
cshelper.play(opening_cs,'intro')
def OnPrecacheObjects():
print 'precache'
def OnMissionWon():
print 'Mission Won'
def OnMissionLose():
print 'Mission Lost'
#####Cutscenes######
time_cs=[
( "startCS()",
"Sound_PlayMusic('music_defeat', 1)",
"see()",
"peace()",
"blank",
"playTransition()",
"wait(10.5)", ),
( "endCS()",
"Mission_Lose()", ),
]
interrogate_waiter1_cs=[
( "startCS()",
"look('waiter1', time = 0)",
"wait(1.5)", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_21', CAPTION_AUTO)", ),
( "speak('waiter1', 'MISSPCH_03_LQ_22', CAPTION_AUTO)", ),
( "spawn('hitman1', 'mafia', 'waiter1')",
"spawn('hitman2', 'mafia', 'customer1')",
"spawn('hitman3', 'mafia', 'customer2')",
"spawn('hitman4', 'mafia', 'customer3')",
"spawn('hitman5', 'thug_with_gun', 'customer4')",
"wait(0.1)", ),
( "Object_Destroy('customer1')",
"Object_Destroy('customer2')",
"Object_Destroy('customer3')",
"Object_Destroy('customer4')",
"Object_Destroy('waiter1')",
"wait(0.1)",
"peace()", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_27', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_03_LQ_28', CAPTION_AUTO)", ),
( "endCS()",
"war()", ),
]
interrogate_waiter2_cs=[
( "startCS()",
"look('waiter2', time = 0)",
"wait(1.5)", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_23', CAPTION_AUTO)", ),
( "speak('waiter2', 'MISSPCH_03_LQ_22', CAPTION_AUTO)", ),
( "spawn('hitman6', 'mafia', 'waiter2')",
"spawn('hitman7', 'thug_with_gun', 'customer8')",
"spawn('hitman8', 'mafia', 'customer9')",
"spawn('hitman9', 'mafia', 'customer10')",
"spawn('hitman10', 'thug_with_gun', 'customer11')",
"wait(0.2)", ),
( "Object_Destroy('customer8')",
"Object_Destroy('customer9')",
"Object_Destroy('customer10')",
"Object_Destroy('customer11')",
"Object_Destroy('waiter2')",
"wait(0.2)", ),
( "endCS()", ),]
interrogate_waiter3_cs=[( "startCS()",
"look('waiter1', time = 0)",
"wait(1.5)", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_21', CAPTION_AUTO)", ),
( "speak('waiter1', 'MISSPCH_03_LQ_22', CAPTION_AUTO)", ),
( "spawn('hitman6', 'mafia', 'waiter1')",
"spawn('hitman7', 'mafia', 'customer1')",
"spawn('hitman8', 'mafia', 'customer2')",
"spawn('hitman9', 'mafia', 'customer3')",
"spawn('hitman10', 'mafia', 'customer4')",
"wait(0.2)", ),
( "Object_Destroy('customer1')",
"Object_Destroy('customer2')",
"Object_Destroy('customer3')",
"Object_Destroy('customer4')",
"Object_Destroy('waiter1')",
"wait(0.2)", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_27', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_03_LQ_28', CAPTION_AUTO)", ),
( "endCS()", ),]
interrogate_singer1_cs=[
( "startCS()",
"look('singer1', time = 0)",
"wait(1)", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_23', CAPTION_AUTO)", ),
( "speak('singer1', 'MISSPCH_03_LQ_25', CAPTION_AUTO)", ),
( "spawn('hitman12', 'mafia', 'customer5')",
"spawn('hitman13', 'mafia', 'customer6')",
"spawn('hitman14', 'thug_with_gun', 'customer7')",
"wait(0.2)",
"peace()", ),
( "Object_Destroy('customer5')",
"Object_Destroy('customer6')",
"Object_Destroy('customer7')",
"wait(0.2)", ),
( "speak('hitman12', 'MISSPCH_03_LQ_26', CAPTION_AUTO)", ),
( "endCS()",
"war()",
"AI_SetEnabled('singer2', 0)", ),
]
opening_cs=[
( "startCS()",
"see()",
"lookAtPos((-1038, -648, 0), heading = 50, zoom = -260)",
"wait(0.5)", ),
( "forceSpeak('dod_solar_flare', 'MISSPCH_03_LQ_18',1, 'dod_solar_flare',)", ),
( "speak('dod_lunarman', 'MISSPCH_03_LQ_19', CAPTION_AUTO)", ),
( "speak('dod_nightshadow', 'MISSPCH_03_LQ_20', CAPTION_AUTO)", ),
( "endCS()",
"noLook()",
"wait(0.5)",
"Campaign_AddCP('dod_nightshadow',250)",
"ff.Setup_intero()",
"Campaign_AddCP('dod_lunarman',250)", ),
]
Well aside from the FFX issue that mission is finished too, and it's a hard one to win I'll tell you that ;)
Now on the final mission in the story arc! Then you'll get to have a look at it :D
That's a rather interesting bug. Do you have a character whose template name begins with "custom"?
Hah! Yes I do, I have a character called Customer. Do I need to change that?
thankyou
edit---------
Thankyou, replacing the template customer has fixed the problem and it now works :)
I'll make a note of that
A new mission and a new problem! ;)
Here's the full log
# 03b_DOCKS
import js
import ff
import cshelper
import event
import ai
import goal
import random
from js import *
from ff import *
from cshelper import *
from event import *
from ai import *
from goal import *
from random import *
from ffx import *
waveone_list=('docker1','docker2','docker3','docker4','docker5','docker6',)
wavetwo_list=('docker7','docker8','docker9','docker10','docker11','docker12',)
wavethree_list=('docker13','docker14','docker15','docker16','docker17','docker18',)
wavefour_list=('docker19','docker20','docker21','docker22','docker23','docker24',)
wavefive_list=('docker25','docker26','docker27','docker28','docker29','docker30',)
def OnPostInit():
print 'bellyofthebeastAstarted'
Mission_SetSunlight(-137,57,1.5,0.2,(0.2,0.2,0.6))
Mission_SetShadows(-137,57,(0.2,0.2,0.4))
Mission_SetProjShadowBackground((1,1,1))
Mission_SetProjShadowColor((.6,.6,.6,1))
Campaign_AddMinion('dock_hand')
Sound_PlayMusic('music_02_bellyofthebeast',0)
cshelper.play(opening_cs,'intro')
Mission_SetAttr('guards_kill', 0)
def OnPrecacheObjects():
print 'precache'
def OnMissionWon():
print 'Mission Won'
def OnMissionLose():
print 'Mission Lost'
#set up waves, bubbles, timer and all that jazz
def SetupBubblesAndAI():
regTimer('onwaveone', '5')
regTimer('onwavetwo', '35')
regTimer('onwavethree', '65')
regTimer('onwavefour', '90')
regTimer('onwavefive', '110')
regTimer('ondockersalldead', '130')
regDeath('joey_besucho','On_joey_KO')
regDeath('scanner','On_scanner_KO')
print 'setting up timers'
regHeroMarkerEnter('meetjoey','On_joeymeet_enter')
for worker in waveone_list:
AI_SetEnabled(worker, 0)
for worker in wavetwo_list:
AI_SetEnabled(worker, 0)
for worker in wavethree_list:
AI_SetEnabled(worker, 0)
for worker in wavefour_list:
AI_SetEnabled(worker, 0)
for worker in wavefive_list:
AI_SetEnabled(worker, 0)
def On_joeymeet_enter(event):
cshelper.play(shiptele_cs,'shiptele')
print 'the heroes have met joey'
def onwaveone(event):
for worker in waveone_list:
print 'wave1 coming'
AI_SetEnabled(worker, 1)
addMoveGoal(worker, 'dockhand move', priority = ai.goal.PRI_LOW-1)
addKillGoal(worker, 'scanner', priority = ai.goal.PRI_MED-1)
def onwavetwo(event):
for worker in wavetwo_list:
print 'wave2 coming'
AI_SetEnabled(worker, 1)
addMoveGoal(worker, 'dockhand move', priority = ai.goal.PRI_LOW-1)
addKillGoal(worker, 'scanner', priority = ai.goal.PRI_MED-1)
def onwavethree(event):
for worker in wavethree_list:
print 'wave3 coming'
AI_SetEnabled(worker, 1)
addMoveGoal(worker, 'dockhand move', priority = ai.goal.PRI_LOW-1)
addKillGoal(worker, 'scanner', priority = ai.goal.PRI_MED-1)
def onwavefour(event):
for worker in wavefour_list:
print 'wave4 coming'
AI_SetEnabled(worker, 1)
addMoveGoal(worker, 'dockhand move', priority = ai.goal.PRI_LOW-1)
addKillGoal(worker, 'scanner', priority = ai.goal.PRI_MED-1)
def onwavefive(event):
for worker in wavefive_list:
print 'wave5 coming'
AI_SetEnabled(worker, 1)
addMoveGoal(worker, 'dockhand move', priority = ai.goal.PRI_LOW-1)
addKillGoal(worker, 'scanner', priority = ai.goal.PRI_MED-1)
def ondockersalldead(event):
speakNoCB('dod_captain', 'MISSPCH_04_TD_21')
addArrow('joey_besucho_arrow','joey_besucho',ARROW_RED,1)
war()
AI_SetEnabled('joey_besucho', 0)
if not(Objective_IsComplete('defendscanner') or Objective_IsFailed('defendscanner')):
Objective_Complete('defendscanner')
def On_scanner_KO(event):
Camera_LookAtObject('scanner', -100, 0, 0, 3, CPM_SCROLLTO, CA_MOVE)
play(heroes_dead_cs, "heroes_dead_cs")
Objective_Fail('defendscanner')
#Cutscenes
heroes_dead_cs = [
( "startCS()",
"Sound_PlayMusic('music_defeat', 1)",
"see()",
"peace()",
"blank",
"wait(10.5)", ),
( "endCS()",
"playTransition()",
"Mission_Lose()", ),
]
opening_cs=[
( "startCS()",
"Camera_SetFade(1)",
"peace()",
"see()",
"lookAtPos((-1738, 14, 0), heading = 27, zoom = -233)",
"wait(0.5)", ),
( "Camera_UnFade(1.5)",
"wait(0.5)", ),
( "speak('narrator', 'BRFSPCH_18_NR_01', CAPTION_TOP_LEFT)", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_01', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_04_TD_02', CAPTION_AUTO)", ),
( "lookAtPos((-219, 391, 0), heading = 41, zoom = -189)",
"wait(1.2)",
"move('jake', 'SFtelemarker')", ),
( "speak('jake', 'MISSPCH_04_TD_03', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_04', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_05', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_06', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_07', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_08', CAPTION_AUTO)",
"AI_Animate('joey_besucho', 'area')", ),
( "speak('jake', 'MISSPCH_04_TD_09', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_10', CAPTION_AUTO)",
"AI_Animate('joey_besucho', 'area')", ),
( "speak('jake', 'MISSPCH_04_TD_11', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_12', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_13', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_14', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_15', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_16', CAPTION_AUTO)",
"AI_Animate('joey_besucho', 'area')", ),
( "speak('dod_captain', 'MISSPCH_04_TD_17', CAPTION_AUTO)",
"lookAtPos((-1738, 14, 0), heading = 27, zoom = -233)",
"move('docker19', 'dockhand_move')", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_18', CAPTION_AUTO)",
"turnTo('dod_captain', 'dockhand_move')", ),
( "speak('dod_captain', 'MISSPCH_04_TD_19', CAPTION_AUTO)", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_20', CAPTION_AUTO)", ),
( "endCS()",
"noLook()",
"Object_Destroy('jake')",
"ff.SetupBubblesAndAI()",
"Objective_Add('findboss', 'Find and beat Joey Besucho in 15 minutes', 0, 700)",
"Objective_Add('defendscanner', 'Defend the scanner while it scans for teleportation residue', 0, 250)",
"ff.InitScripts()",
"blind()",
"setMission(1)",
"ff.FFX_InitMission()", ),
]
# "lookAtPos((766, 13, 0), heading = 114, zoom = 346)", the wide angle shot of the boat
shiptele_cs=[
( "playTransition()",)
( "peace()",
"reviveHeroes()",
"startCS()",
"teleport('dod_solar_flare', 'SFtelemarker')",
"teleport('dod_captain', 'TCtelemarker')",
"wait(2)",
"lookAtPos((-250, 358, 0), heading = 46, zoom = -194)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_22', CAPTION_AUTO)", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_23', CAPTION_AUTO)",
"AI_Animate('dod_solar_flare', 'active_defence')", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_24', CAPTION_AUTO)", ),
( "playEffectMarker('effect_microwave_teleport_out', 'SFtelemarker', 0, fn = '')",
"playEffectMarker('effect_microwave_teleport_out', 'TCtelemarker', 0, fn = '')",
"Sound_PlaySound('fx_microwave_teleportself_1', 'SFtelemarker', 1.0)",
"teleport ('dod_solar_flare', 'SFtelemarkership')",
"teleport ('dod_captain', 'TCtelemarkership')",
"wait(3)", ),
( "lookAtPos((770, -15, 0), heading = 114, zoom = -139)",
"teleport ('joey_besucho', 'joey_teleport')",
"Sound_StopMusic()",
"wait(1)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_25', CAPTION_AUTO)", ),
( "speak('dod-solar_flare', 'MISSPCH_04_TD_26', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_27', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_04_TD_28', CAPTION_AUTO)",
"Sound_PlayMusic('music_captaintheme',0)",
"lookAtPos((766, 13, 0), heading = 114, zoom = 346, time = 3)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_29', CAPTION_AUTO)", ),
( "endCS()",
"war()",),
]
Now, I know there are some things missing but it's the opening Cutscene and related events that's not quite working.
Here's the opening CS again
opening_cs=[
( "startCS()",
"Camera_SetFade(1)",
"peace()",
"see()",
"lookAtPos((-1738, 14, 0), heading = 27, zoom = -233)",
"wait(0.5)", ),
( "Camera_UnFade(1.5)",
"wait(0.5)", ),
( "speak('narrator', 'BRFSPCH_18_NR_01', CAPTION_TOP_LEFT)", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_01', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_04_TD_02', CAPTION_AUTO)", ),
( "lookAtPos((-219, 391, 0), heading = 41, zoom = -189)",
"wait(1.2)",
"move('jake', 'SFtelemarker')", ),
( "speak('jake', 'MISSPCH_04_TD_03', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_04', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_05', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_06', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_07', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_08', CAPTION_AUTO)",
"AI_Animate('joey_besucho', 'area')", ),
( "speak('jake', 'MISSPCH_04_TD_09', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_10', CAPTION_AUTO)",
"AI_Animate('joey_besucho', 'area')", ),
( "speak('jake', 'MISSPCH_04_TD_11', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_12', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_13', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_14', CAPTION_AUTO)", ),
( "speak('jake', 'MISSPCH_04_TD_15', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_16', CAPTION_AUTO)",
"AI_Animate('joey_besucho', 'area')", ),
( "speak('dod_captain', 'MISSPCH_04_TD_17', CAPTION_AUTO)",
"lookAtPos((-1738, 14, 0), heading = 27, zoom = -233)",
"move('docker19', 'dockhand_move')", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_18', CAPTION_AUTO)",
"turnTo('dod_captain', 'dockhand_move')", ),
( "speak('dod_captain', 'MISSPCH_04_TD_19', CAPTION_AUTO)", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_20', CAPTION_AUTO)", ),
( "endCS()",
"noLook()",
"Object_Destroy('jake')",
"ff.SetupBubblesAndAI()",
"Objective_Add('findboss', 'Find and beat Joey Besucho in 15 minutes', 0, 700)",
"Objective_Add('defendscanner', 'Defend the scanner while it scans for teleportation residue', 0, 250)",
"ff.InitScripts()",
"blind()",
"setMission(1)",
"ff.FFX_InitMission()", ),
]
that all works until the very end when ff.SetupBubblesAndAI() doesn't do what it's supposed to.
#set up waves, bubbles, timer and all that jazz
def SetupBubblesAndAI():
regTimer('onwaveone', '5')
regTimer('onwavetwo', '35')
regTimer('onwavethree', '65')
regTimer('onwavefour', '90')
regTimer('onwavefive', '110')
regTimer('ondockersalldead', '130')
regDeath('joey_besucho','On_joey_KO')
regDeath('scanner','On_scanner_KO')
print 'setting up timers'
regHeroMarkerEnter('meetjoey','On_joeymeet_enter')
for worker in waveone_list:
AI_SetEnabled(worker, 0)
for worker in wavetwo_list:
AI_SetEnabled(worker, 0)
for worker in wavethree_list:
AI_SetEnabled(worker, 0)
for worker in wavefour_list:
AI_SetEnabled(worker, 0)
for worker in wavefive_list:
AI_SetEnabled(worker, 0)
It just refuses point blank to run this
Here's the script log
[spoiler]>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
loading datfiles version 0.234000
ReadHeroIndexData: trouble reading or evaluating data from <c:\program files\irrational games\ffvttr\dod\HeroIndexData.txt>
Importing MLOG reader module version 0.995 with ['animator']
Traceback (innermost last):
File "C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py", line 225, in ?
"lookAtPos((-250, 358, 0), heading = 46, zoom = -194)", ),
TypeError: call of non-function (type tuple)
precache
bellyofthebeastAstarted
cshelper: Cutscene [intro] submitted for playing
cshelper: Now playing cutscene [intro]
Step 1 of 25
Step 2 of 25
initialising FFQ_initialiseExtras() later: a cutscene is playing
Step 3 of 25
0
speakInternal
0
Step 4 of 25
0
speakInternal
0
Step 5 of 25
0
speakInternal
0
Step 6 of 25
Step 7 of 25
0
speakInternal
0
Step 8 of 25
0
speakInternal
0
Step 9 of 25
0
speakInternal
0
Step 10 of 25
0
speakInternal
0
Step 11 of 25
0
speakInternal
0
Step 12 of 25
0
speakInternal
0
Step 13 of 25
0
speakInternal
0
Step 14 of 25
0
speakInternal
0
Step 15 of 25
0
speakInternal
0
Step 16 of 25
0
speakInternal
0
Step 17 of 25
0
speakInternal
0
Step 18 of 25
0
speakInternal
0
Step 19 of 25
0
speakInternal
0
Step 20 of 25
0
speakInternal
0
Step 21 of 25
0
speakInternal
0
Step 22 of 25
0
speakInternal
0
Step 23 of 25
0
speakInternal
0
Step 24 of 25
0
speakInternal
0
Step 25 of 25
exception happened in cutscene playback of step
exceptions.RuntimeError Event_RegisterSink(): expects args {iss|sfff}
ff.SetupBubblesAndAI()
MLOG_Init: time 0.0159920 sec
initialising FFX: skirmish=0
numberStr=
storing dod_solar_flare: id_1,0
numberStr=
storing dod_captain: id_2,0
cshelper: Cutscene [intro] has ended
initialising FFQ_initialiseExtras()
dod_solar_flare : solarpowered
joey_besucho : ironjaw
joey_besucho : symbiote
getting default sun
(-137.0, 57.0, 1.5, 0.20000000298, (0.20000000298, 0.20000000298, 0.600000023842))
solar powered characterdod_solar_flare has base energy 8
[/spoiler]
I think the red bit is the main problem but I have no idea what it means nor how to solve it. What should be happening is timed waves of foes moving to a certain marker and attacking the scanner but they don't move and their AI never turns on.
Any ideas?
Thankyou very much
Lunarman
It's pretty simple. The numbers in regTimer should not have any quotes around them. Because the engine is getting a string instead of a number, it chokes up.
Also note that you have a traceback error with your lookat command you might want to fix.
Ah, thankyou very much Catwho
Humph, I'm hoping this is another easy fix, it's got me stumped.
I'm trying to make this CS run when a regheroentermarker is called. The Reg calls correctly, I checked it with a print (before the cshelper.play) but when the print is moved after cshelper.play then it doesn't appear. The problem is with " play(ship_cs,'ship_cs') ".
I have no idea why though, the command I'm using is exactly the same (save the names) as the command I use to call another CS earlier in the mission.
This is the CS I'm trying to call:
ship_cs = [
( "playTransition()", )
( "peace()",
"reviveHeroes()",
"startCS()",
"teleport('dod_solar_flare', 'SFtelemarker')",
"lookAtPos((-250, 358, 0), heading = 46, zoom = -194)",
"teleport('dod_captain', 'TCtelemarker')",
"wait(2)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_22', CAPTION_AUTO)", ),
( "speak('dod_solar_flare', 'MISSPCH_04_TD_23', CAPTION_AUTO)",
"AI_Animate('dod_solar_flare', 'active_defence')", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_24', CAPTION_AUTO)", ),
( "playEffectMarker('effect_microwave_teleport_out', 'SFtelemarker', 0, fn = '')",
"playEffectMarker('effect_microwave_teleport_out', 'TCtelemarker', 0, fn = '')",
"Sound_PlaySound('fx_microwave_teleportself_1', 'SFtelemarker', 1.0)",
"teleport ('dod_solar_flare', 'SFtelemarkership')",
"teleport ('dod_captain', 'TCtelemarkership')",
"wait(3)", ),
( "lookAtPos((770, -15, 0), heading = 114, zoom = -139)",
"teleport ('joey_besucho', 'joey_teleport')",
"Sound_StopMusic()",
"wait(1)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_25', CAPTION_AUTO)", ),
( "speak('dod-solar_flare', 'MISSPCH_04_TD_26', CAPTION_AUTO)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_27', CAPTION_AUTO)", ),
( "speak('dod_captain', 'MISSPCH_04_TD_28', CAPTION_AUTO)",
"Sound_PlayMusic('music_captaintheme',0)",
"lookAtPos((766, 13, 0), heading = 114, zoom = 346, time = 3)", ),
( "speak('joey_besucho', 'MISSPCH_04_TD_29', CAPTION_AUTO)", ),
( "endCS()",
"war()", ),
]
This is the actual function that is triggered by the heroentermarker:
def On_joeymeet_enter(event):
play(ship_cs,'ship_cs')
print 'the heroes have met joey'
and here's the script log:
[spoiler]
Quote>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
loading datfiles version 0.234000
ReadHeroIndexData: trouble reading or evaluating data from <c:\program files\irrational games\ffvttr\dod\HeroIndexData.txt>
Importing MLOG reader module version 0.995 with ['animator']
Traceback (innermost last):
File "C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py", line 229, in ?
"lookAtPos((-250, 358, 0), heading = 46, zoom = -194)", ),
TypeError: call of non-function (type tuple)
precache
MLOG_Read: likely mid-mission load
Traceback (innermost last):
File "C:\Program Files\Irrational Games\FFVTTR\.\DOD\missions\scripts\m25timestamp.py", line 31, in Timestamp_Advance
m25getset.SetMissionVar('_timestamp',tick+1)
TypeError: bad operand type(s) for +
mid level save game detected
MLOG_Init: time 0.0012652 sec
Traceback (innermost last):
File "C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py", line 72, in On_joeymeet_enter
play(ship_cs,'ship_cs')
NameError: ship_cs
[/spoiler]
with regards to the traceback error about line 229 (it is in the CS that I'm having problems with) I cannot see for the life of me why it might be causing a problem (it is exactly the same as one I used earlier, save the numbers) so any help on either issue is much appreciated.
After this it's pretty much a run of the mill end of level job and a base and I'm all done for the first issue. Then it'll only be a matter of checking all the bits are there and you'll be able to have a peek.
Thankyou very much
Lunarman
Quote from: Lunarman on August 12, 2007, 02:07:49 PM
and here's the script log:
Quote>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
loading datfiles version 0.234000
ReadHeroIndexData: trouble reading or evaluating data from <c:\program files\irrational games\ffvttr\dod\HeroIndexData.txt>
Importing MLOG reader module version 0.995 with ['animator']
Traceback (innermost last):
File "C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py", line 229, in ?
"lookAtPos((-250, 358, 0), heading = 46, zoom = -194)", ),
TypeError: call of non-function (type tuple)
precache
MLOG_Read: likely mid-mission load
Traceback (innermost last):
File "C:\Program Files\Irrational Games\FFVTTR\.\DOD\missions\scripts\m25timestamp.py", line 31, in Timestamp_Advance
m25getset.SetMissionVar('_timestamp',tick+1)
TypeError: bad operand type(s) for +
mid level save game detected
MLOG_Init: time 0.0012652 sec
Traceback (innermost last):
File "C:\Documents and Settings\Rachael\Local Settings\Application Data\Irrational Games\Freedom Force vs the 3rd Reich\temp\mission.py", line 72, in On_joeymeet_enter
play(ship_cs,'ship_cs')
NameError: ship_cs
with regards to the traceback error about line 229 (it is in the CS that I'm having problems with) I cannot see for the life of me why it might be causing a problem (it is exactly the same as one I used earlier, save the numbers) so any help on either issue is much appreciated.
My guess is that there is a problem matching the parentheses in your code somewhere. I marked one likely spot red in the quoted script.log above, though that extra parenthesis does not show up in your posted code, which is odd. (Make sure you have saved changes to your code and your are not editing a copy of the code other than the one that's being run, just in case.) But, if you notice where in the script.log the error shows up, it's before the mission objects are even precached and it's probably when the mission.py file is first loaded, before anything in the mission is run. The last traceback error indicates the same thing: The reason it doesn't recognize
ship_cs is because it encountered an error when the list was defined (when it was first read).
I would first check for an extra parenthesis or maybe an extra quotation mark somewhere.
Ok people, all done :)
You'll be getting no more scripting Qs outta me for a while as the first issue is done, I'm just gonna wrap things up and get it released.
Thanks for all the help
Ok, a new mission and new woes ;)
Firstly: Has anyone ever used the ffxfx.py file before. Just so you know it lets you attach FX to bips of your chars like fire to their hands or something similar. I used this to add fx to mangrapes minions when they were hero files and it worked in the rumble room and in missions. However since I added them to the .dat file it's stopped working.
Here's what I've got
FFX_CUSTOM_FX=[
['mg_drunkard_male','effect_ffx_drunken_haze','','Bip01 Head',],
['mg_drunken_cop','effect_ffx_drunken_haze','','Bip01 Head',],
['drunkard_female','effect_ffx_drunken_haze','','Bip01 Head',],
]
Yes the names are correct, both of the characters and the effects (in the resources tab, right?).
What am I doing wrong? Or does it just not work with built in chars.
And: Is there a way to assign a group of enemies a kill goal to kill a group of enemies?
At the moment I've got
def coppubattack():
for pubcops in pubcops_list:
AI_SetEnabled(pubcops, 1)
addKillGoal(pubcops, 'innocent2', priority = ai.goal.PRI_ZERO-1)
regDeath(pubcops,'On_drunkcop_KO')
Objective_Add('saveinnocents', 'Stop the drunken cops before they kill any civilians', 1, 100)
regDeath('innocent1','On_innocent_killed')
regDeath('innocent2','On_innocent_killed')
regDeath('innocent3','On_innocent_killed')
regDeath('innocent4','On_innocent_killed')
regDeath('innocent5','On_innocent_killed')
regDeath('innocent6','On_innocent_killed')
Mission_SetAttr('cops_killed', 0)
But I'd rather that instead of just attacking 'innocent2' the cops attacked all the people in this list, and chose their targets like they normally do
copsinnocents_list=('innocent1','innocent2','innocent3','innocent4','innocent5','innocent6',)
Is there any way to do that?
Thanks
Lunarman
You should just be able to add the kill goal to all of them at once.
The engine can handle multiple kill goals at once, and since they would all be set to the same level, they should pick their targets pretty much normally.
Yeah. addKillGoal() is supposed to handle a tuple of object names as the target. In addition, you could put your regDeath()s for the innocents in loop, just for tidiness. E.g.
def coppubattack():
for pubcops in pubcops_list:
AI_SetEnabled(pubcops, 1)
addKillGoal(pubcops, copsinnocents_list, priority = ai.goal.PRI_ZERO-1)
regDeath(pubcops,'On_drunkcop_KO')
Objective_Add('saveinnocents', 'Stop the drunken cops before they kill any civilians', 1, 100)
for innocent in copsinnocents_list:
regDeath(innocent,'On_innocent_killed')
Mission_SetAttr('cops_killed', 0)
Quote from: Lunarman on August 28, 2007, 07:27:38 AMFirstly: Has anyone ever used the ffxfx.py file before. Just so you know it lets you attach FX to bips of your chars like fire to their hands or something similar. I used this to add fx to mangrapes minions when they were hero files and it worked in the rumble room and in missions. However since I added them to the .dat file it's stopped working.
Here's what I've got
FFX_CUSTOM_FX=[
['mg_drunkard_male','effect_ffx_drunken_haze','','Bip01 Head',],
['mg_drunken_cop','effect_ffx_drunken_haze','','Bip01 Head',],
['drunkard_female','effect_ffx_drunken_haze','','Bip01 Head',],
]
Yes the names are correct, both of the characters and the effects (in the resources tab, right?).
What am I doing wrong? Or does it just not work with built in chars.
I've just run a quick test using the built-in FFX Angel and things apparently work (apparently, because I couldn't see the FX, since "effect_crystal_charged_start" uses a NIF available only in FF1). Do you have any related error in script.log or ff.log?
Thanks guys.
I'll keep trying trying with those ffxfx, otherwise I can skope it onto the mesh.
It all looks to be working now, it was just a minor thing I've fixed now *doh*