News:

Rings of Reznor!

Main Menu

EZ Script Headaches

Started by Boalt92, September 20, 2009, 09:37:52 PM

Previous topic - Next topic

Boalt92

Back working on the on-again, off-again, off-again, off-again, on-again....wait, where was I?

At any rate.  Thought I'd Keep It Simple Stupid with EZ Script and of course I was wrong.  Worked out most of the kinks on this script but it's still doing something annoying (not a major problem, mind you, just annoying).  So I thought I'd post here for some help.

I wrote a really basic capture-the-flag script a while back to test some freeroam ideas and I thought I'd refine it for a public release.  This is the template.  It works fine but when your flag is destroyed sometimes it keeps repeating the "flag is destroyed" cutscene.  Seems to happen when flag takes multiple hits prior to despawning.  Other than that the script works fine.  I'd just like to resolve this last issue before I add the full line-up of game modes.

Log is below, but I don't think there were any "errors" per se.  The script itself is too long to post here, but if you want to test it you can copy/paste it from here  (just remember, it's in "zeta" stage at this point.  villains/objects are really just placeholders).  There are no special markers, so it should run on any EZ Script-enabled map:

www.nguni.com/CTF_1_Flag_Defend_RR.txt

Thanks in advance,

B92

Log:
>>> system/init.py executed
>>> system/localinit.py executed
>>> system\tredir.py executed
loading datfiles version 0.256000
loading cshelper ...
Starting ffx.py v. 3.3.1 build 0; branch = main release update
Loading m25ai.py v. 3.3.0 build 3; branch = Gold v.3.3 with Patch
importing missionobjvar.py v1.20
importing MLOG Reader 1.0.23
Starting General Utilities 1.0.1
missionobjvar(FixLongs): Fixing overflow issue with <SCSTATE_BUOYANT>
missionobjvar defining functions for Rumble Room play.
Loading m25cutscene.py v.3.3.07 January 30, 2009
CustomHeadCurrentTime 1253481603.364000
Starting Height Check module 1.4
Starting System Utilities 1.5
OBJECTS_HEIGHT: 604 entries
NIF_OBJECTS: 482 entries
BUILDINGS_IN_OBJECTS_DAT: 30 entries
BUILDING_DIMENSIONS: 30 entries
Starting skXMapInfo.py  v 0.79 beta
skXMapInfo: m25ai available
Loading m25aiopt.py v.3.2.0 final; branch = swingman 4
FFX Mission Plugin 'firehydrant' imported
FFX Mission Plugin 'zombie' imported
Loading freeroam_keepbuildingdamage.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'freeroam_keepbuildingdamage' imported
FFX Mission Plugin 'm25ai_lowjumper' imported
FFX Mission Plugin 'm25ai_realitymanipulation' imported
FFX Mission Plugin 'cutscene_power' imported
Loading m25enc.py v.3.3.07 January 30, 2009
Loading m25freeroam.py v. 3.2.0 build 7; branch = m25 branch 1
FFX Mission Plugin 'm25encexit' imported
Loading     m25enc_OPENDOOR.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'm25enc_opendoor' imported
FFX Mission Plugin 'm25enc_reqchar' imported
Loading     m25enc_simplechoice.py v.1.0.0 build 0; branch = main
FFX Mission Plugin 'm25enc_simplechoice' imported
Loading m25pstory.py  v.3.3.07 January 30, 2009
FFX Mission Plugin 'm25encstory' imported
Starting Built-In Function Wrapper 1.5
('Object_CalcPrestige', 'js')
ctf\Missions\Scripts\sk.py importing FFX
ctf\Missions\Scripts\sk.py loaded
>>> C:\Users\mike\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\MiniMod Folder.py executed
>>> C:\Users\mike\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\danger.py executed
! GetMapInfo
>>> C:\Users\mike\AppData\Local\Irrational Games\Freedom Force vs the 3rd Reich\temp\MiniMod Folder.py executed
MLOG_Init(keepRunningModules=0): starting up
mlogreader.MLOG_Init: current mission = 'CTF_GAME_LAVA_PITS'
initialising FFX: skirmish=0
mapinfocaliper0 is not a valid explosion object
mapinfocaliper1 is not a valid explosion object
mapinfocaliper2 is not a valid explosion object
mapinfocaliper3 is not a valid explosion object
numberStr=46
storing hero_1: id_1,-46
m25obj_2 thug_with_grenade encounter6_minionout1
m25obj_4 thug_with_bat encounter6_minionout2
m25obj_6 nw_military_hut_flag encounter6_object1
m25obj_8 thug_with_gun encounter3_villainout1
m25obj_10 thug_with_grenade encounter3_villainout2
m25obj_12 thug_with_bat encounter3_villainout3
m25obj_14 thug_with_bat encounter3_villainout4
initialising FFQ_initialiseExtras()
FFX_UpdateSun: getting default sun
FFX_UpdateSun: setting = (-137.0, 57.0, 1.5, 0.20000000298, (0.20000000298, 0.20000000298, 0.600000023842))
initAttribsForChar: working on hero_1 (black_jack)
initAttribsForChar (black_jack): looking at attribute nimble
initAttribsForChar (black_jack): looking at attribute heroic
initAttribsForChar (black_jack): looking at attribute telepathy
execInitAttrib: init telepathy attribute
   on hero_1 of template custom_template_46 (black_jack)
initAttribsForChar: working on m25obj_4 (thug_with_bat)
initAttribsForChar (thug_with_bat): looking at attribute timid
initAttribsForChar (thug_with_bat): looking at attribute weak minded
initAttribsForChar: working on m25obj_2 (thug_with_grenade)
initAttribsForChar (thug_with_grenade): looking at attribute weak minded
initAttribsForChar: working on m25obj_10 (thug_with_grenade)
initAttribsForChar (thug_with_grenade): looking at attribute weak minded
initAttribsForChar: working on m25obj_8 (thug_with_gun)
initAttribsForChar (thug_with_gun): looking at attribute timid
initAttribsForChar (thug_with_gun): looking at attribute weak minded
initAttribsForChar: working on m25obj_12 (thug_with_bat)
initAttribsForChar (thug_with_bat): looking at attribute timid
initAttribsForChar (thug_with_bat): looking at attribute weak minded
initAttribsForChar: working on m25obj_14 (thug_with_bat)
initAttribsForChar (thug_with_bat): looking at attribute timid
initAttribsForChar (thug_with_bat): looking at attribute weak minded
Plugin 'firehydrant' OnPostInit() called
Plugin 'zombie' has no OnPostInit()
Plugin 'freeroam_keepbuildingdamage' OnPostInit() called
Plugin 'm25ai_lowjumper' has no OnPostInit()
Plugin 'm25ai_realitymanipulation' has no OnPostInit()
Plugin 'cutscene_power' has no OnPostInit()
Plugin 'm25encexit' has no OnPostInit()
Plugin 'm25enc_opendoor' has no OnPostInit()
Plugin 'm25enc_reqchar' has no OnPostInit()
Plugin 'm25enc_simplechoice' has no OnPostInit()
Plugin 'm25encstory' has no OnPostInit()
addArrow m25obj_6arrow m25obj_6 1 1
m25obj_16 thug_with_bat encounter17_minionout1
m25obj_18 thug_with_grenade encounter17_minionout2
m25obj_20 thug_with_gun encounter17_villainout1
m25obj_22 thug_with_bat encounter17_villainout2
m25obj_24 nw_military_hut_flag encounter17_object1
m25obj_26 thug_with_gun encounter5_villainout1
m25obj_28 thug_with_grenade encounter5_villainout2
m25obj_30 thug_with_bat encounter5_villainout3
m25obj_32 thug_with_bat encounter5_villainout4
initAttribsForChar: working on m25obj_26 (thug_with_gun)
initAttribsForChar (thug_with_gun): looking at attribute timid
initAttribsForChar (thug_with_gun): looking at attribute weak minded
initAttribsForChar: working on m25obj_28 (thug_with_grenade)
initAttribsForChar (thug_with_grenade): looking at attribute weak minded
initAttribsForChar: working on m25obj_20 (thug_with_gun)
initAttribsForChar (thug_with_gun): looking at attribute timid
initAttribsForChar (thug_with_gun): looking at attribute weak minded
initAttribsForChar: working on m25obj_18 (thug_with_grenade)
initAttribsForChar (thug_with_grenade): looking at attribute weak minded
initAttribsForChar: working on m25obj_16 (thug_with_bat)
initAttribsForChar (thug_with_bat): looking at attribute timid
initAttribsForChar (thug_with_bat): looking at attribute weak minded
initAttribsForChar: working on m25obj_22 (thug_with_bat)
initAttribsForChar (thug_with_bat): looking at attribute timid
initAttribsForChar (thug_with_bat): looking at attribute weak minded
initAttribsForChar: working on m25obj_32 (thug_with_bat)
initAttribsForChar (thug_with_bat): looking at attribute timid
initAttribsForChar (thug_with_bat): looking at attribute weak minded
initAttribsForChar: working on m25obj_30 (thug_with_bat)
initAttribsForChar (thug_with_bat): looking at attribute timid
initAttribsForChar (thug_with_bat): looking at attribute weak minded
addArrow m25obj_24arrow m25obj_24 1 1

Boalt92

#1
Ok, think I fixed it, but it made the script much more complicated.

Went to a variable system of keep score and moved the "flag destroyed" and "flag saved" shouts to separate encounters.

Will test it tonight.  If anybody has any other suggestions, I'm open to them.


Here's the first three rounds of the game:

Spoiler

Story: ctf_1_flag_defend_rr_v3

Starting Encounters: 1fd_00, HK1

############################
#
#  1 Flag Defend
#  Players must protect their flag from hordes of enemies
#  
# Character Swaps
# Round 1, 2, 3 - thug_with_gun, thug_with_grenade, thug_with_bat
# Round 3, 4, 6 - thug_with_gun, thug_with_grenade, thug_with_bat, mafioso
# Round 7, 8, 9 - mafioso, pin_stripe
#
#
# Version 2 - removed start at distance actions
# Version 3 - switch to variable scoring system
##############################





#############
# Round 1
# Score 0 - 0
#############
Encounter: 1fd_00
Type: Custom
Actions: villains fight heroes, allies fight villains, villains attack object, villains start immediately, minions start immeditance, villains start immediately, minions start immediately
Minions: thug_with_gun, thug_with_grenade, thug_with_bat
Objects: nw_military_hut_flag

Next: If Objects Lost: destroy, score1fd_01, HK1
Next: If Objects Saved: save, score1fd_10, HK1


Alert Cutscene:
narrator says, "CTF Game Mode 1 Flag Defend."
narrator says, "The score is 0-0"
narrator says, "first to 5 wins"
narrator says telepathically, "protect your flag!"
Set Lighting to day
yellow arrow on object


##############################################


#############
# Round 2
# Score 1 - 0
#############
Encounter: 1fd_10
Type: Custom
Actions: villains fight heroes, allies fight villains, villains attack object, villains start immediately, minions start immeditance, villains start immediately, minions start immediately
Minions: thug_with_gun, thug_with_grenade, thug_with_bat
Villains: thug_with_gun, thug_with_bat
Objects: nw_military_hut_flag

Next: If Objects Lost: destroy, score1fd_11, HK1
Next: If Objects Saved: save, score1fd_20, HK1

Alert Cutscene:
narrator says, "The score is 1-0"
narrator says, "first to 5 wins"
yellow arrow on object

##############################################

#############
# Round 2
# Score 0 - 1
#############
Encounter: 1fd_01
Type: Custom
Actions: villains fight heroes, allies fight villains, villains attack object, villains start immediately, minions start immeditance, villains start immediately, minions start immediately
Minions: thug_with_gun, thug_with_grenade, thug_with_bat
Villains: thug_with_gun, thug_with_bat
Objects: nw_military_hut_flag

Next: If Objects Lost: destroy, score1fd_02, HK1
Next: If Objects Saved: save, score1fd_11, HK1  


Alert Cutscene:
narrator says, "The score is 0-1"
narrator says, "first to 5 wins"
yellow arrow on object

##############################################


#############
# Round 3
# Score 2 - 0
#############
Encounter: 1fd_20
Type: Custom
Actions: villains fight heroes, allies fight villains, villains attack object, villains start immediately, minions start immeditance, villains start immediately, minions start immediately
Minions: thug_with_gun, thug_with_grenade
Villains: thug_with_gun, thug_with_bat, thug_with_gun, thug_with_grenade
Objects: nw_military_hut_flag

Next: If Objects Lost: destroy, score1fd_21, HK1
Next: If Objects Saved: save, score1fd_30, HK1  


Alert Cutscene:
narrator says, "The score is 2-0"
narrator says, "first to 5 wins"
yellow arrow on object
##############################################


#############
# Round 3
# Score 1 - 1
#############
Encounter: 1fd_11
Type: Custom
Actions: villains fight heroes, allies fight villains, villains attack object, villains start immediately, minions start immeditance, villains start immediately, minions start immediately
Minions: thug_with_gun, thug_with_grenade
Villains: thug_with_gun, thug_with_bat, thug_with_gun, thug_with_grenade
Objects: nw_military_hut_flag

Next: If Objects Lost: destroy, score1fd_12, HK1
Next: If Objects Saved: save, score1fd_21, HK1  


Alert Cutscene:
narrator says, "The score is 1-1"
narrator says, "first to 5 wins"
yellow arrow on object
##############################################

#############
# Round 3
# Score 0 - 2
#############
Encounter: 1fd_02
Type: Custom
Actions: villains fight heroes, allies fight villains, villains attack object, villains start immediately, minions start immeditance, villains start immediately, minions start immediately
Minions: thug_with_gun, thug_with_grenade
Villains: thug_with_gun, thug_with_bat, thug_with_gun, thug_with_grenade
Objects: nw_military_hut_flag

Next: If Objects Lost: destroy, score1fd_03, HK1
Next: If Objects Saved: save, score1fd_12, HK1  


Alert Cutscene:
narrator says, "The score is 0-2"
narrator says, "first to 5 wins"
yellow arrow on object

##############################################




###########################
#
#  RESET Encounter
#  restarts mission from beginning after player returns to fortress
#
##############################


Encounter: reset_l
Type: cutscene
Next: reset

start Cutscene:
narrator says telepathically, "you lost the game!"
narrator says telepathically, "return to the fortress to reset and play again or choose a new game map."

################################

Encounter: reset_w
Type: cutscene
Next: reset

start Cutscene:
narrator says telepathically, "you won the game!"
narrator says telepathically, "return to the fortress to reset and play again or choose a new game map."

################################

Encounter: reset
Type: cutscene
Map: ctf_fortress
Next: 1fd_00, HK1

start Cutscene:
narrator says telepathically, "Game Mode 1 Flag Defend Reset Successfully.  You may return at any time."

################################


###########################
#
#  Hunter Killer Encounters
#  Just here to make life more difficult
#
############################

Encounter: HK1
Type: custom
Actions: villains fight heroes, allies fight villains, villains hunt heroes, villains start immediately, minions start immediatnce, villains start immediately, minions start immediately
Villains: thug_with_gun, thug_with_grenade, thug_with_bat, thug_with_bat

Next: none

#################################

Encounter: HK2
Type: custom
Actions: villains fight heroes, allies fight villains, villains hunt heroes, villains start immediately, minions start immediatnce, villains start immediately, minions start immediately
Villains: thug_with_gun, thug_with_grenade, thug_with_bat, mafioso

Next: none

###################################



##########################
#
#  destroy and save
#  shouts out whether your flag was saved or destroyed
#
#########################

Encounter: destroy
Type: cutscene
Next: none

Alert Cutscene:
narrator says telepathically, "your flag was destroyed!"
############

Encounter: save
Type: cutscene
Next: none

Alert Cutscene:
narrator says telepathically, "you saved your flag!"
###################################



##############################
#
#  Scoreboard
#  Placeholders keep track of score
#
#############################

Encounter: score1fd_01
Type: none
Next: 1fd_01
###

Encounter: score1fd_10
Type: none
Next: 1fd_10
#######

Encounter: score1fd_20
Type: none
Next: 1fd_20
#######

Encounter: score1fd_11
Type: none
Next: 1fd_11
#######

Encounter: score1fd_02
Type: none
Next: 1fd_02
########

Encounter: score1fd_30
Type: none
Next: 1fd_30
########

Encounter: score1fd_21
Type: none
Next: 1fd_21
########

Encounter: score1fd_12
Type: none
Next: 1fd_12
########

Encounter: score1fd_03
Type: none
Next: 1fd_03
########

BentonGrey

Haha, Boalt, you're so far out of my league, that it really isn't funny. ;)
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

Boalt92

#3
Quote from: BentonGrey on September 22, 2009, 03:08:04 PM
Haha, Boalt, you're so far out of my league, that it really isn't funny. ;)

LOL.

Let me make sure it's working AND actually release it....then we can talk!   :P

This is the base template for my single-flag game modes (3 so far).  Need to work out the kinks as it is very similar to the template for the multi-flag games (2 so far).


B92

PS--it would probably be  much easier if I actually knew Python  :rolleyes:

M25

Your ability to get EZ script to do things like that is truly impressive.