Page 1 of 1

Scripted Animation

Posted: Sun Jan 06, 2013 8:26 pm
by Bonecrusher16O
Ok, once again time for my random troubles.
I have been trying for the past few months to get a animation of a door to go up and block off a passage when you destory a panel, and to go back down when you fix the panel. (I know that my animation works because I can use FC to run the command PlayAnimation("") in game)
Here is my scirpt:

Code: Select all

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

animateobja = OnObjectKill(
   function(object, killer)
      if GetEntityName(object) == "panel1" then
         PlayAnimation("wdown")
      end
   end
)

killobjc = OnObjectKill(
   function(object, killer)
      if killer and IsCharacterHuman(killer) and GetEntityName(object) == "panel1" then
         AddAssaultDestroyPoints(killer)
      end
   end
)

ReadDataFile("dc:Load\\common.lvl")
The names of the Animations and objects are as follows:
wup: Animation to raise the door up.
wdown: Animation to lower the door.
panel1: Panel object.

I looked at Mav's "Trigger animation on destruction of object?" topic on the FAQ, and that is where I got the scripting for this.
I figured I would work out the acctual work of the panel and animation before I added in the animation reseting script work.

I am pretty sure I messed up the input of the object/animation names or added all the LUA work to the wrong section of the script. Any help?

Re: Scriptied Animation

Posted: Sun Jan 06, 2013 10:21 pm
by AQT
Your functions should go before function ScriptInit().

Re: Scriptied Animation

Posted: Sun Jan 06, 2013 11:47 pm
by Loopy53
they are before script init :wink: try script poastload see if that works.

Re: Scriptied Animation

Posted: Sun Jan 06, 2013 11:58 pm
by AQT
No, they are currently after function ScriptInit(). :? And being after function ScriptPostLoad() is the same thing as being before function ScriptInit().

Re: Scriptied Animation

Posted: Mon Jan 07, 2013 12:00 pm
by Bonecrusher16O
Alright, now it just crashes after about a second of loading.
Error Log:
Hidden/Spoiler:
[code]Opened logfile BFront2.log 2013-01-07 1057
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: No custom_gc_10.lvl
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_GetGCButtonList()
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
addme.lua too old: read version 4.0; expected at least 5.0
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 04B1116C
The key, value is: mode_eli_c 1
The key, value is: era_g 1
The key, value is: mode_con_c 1
The key, value is: isModLevel 1
The key, value is: bSelected 1
The key, value is: mode_1flag_c 1
The key, value is: era_c 1
The key, value is: mode_con_g 1
The key, value is: mode_eli_g 1
The key is mapluafile, the formated value is: AAH<A>_<B>
custom_printTable(): Returning
custom_printTable(): table: 04B1672C
The key, value is: key mode_con
The key, value is: subst con
The key, value is: showstr modename.name.con
The key, value is: descstr modename.description.con
The key, value is: icon mode_icon_con
custom_printTable(): Returning
this.CurButton = nil
cur_button = nil
this.CurButton = nil
cur_button = nil
this.CurButton = check_mode6
cur_button = nil
Checkbox for check_era7 clicked
this.CurButton = check_era7
cur_button = nil
custom_AddMapNew()
custom_printTable(): table: 04D1ECBC
The key, value is: blue 0
The key, value is: mode_eli_g 1
The key, value is: isModLevel 1
The key, value is: bSelected 1
The key, value is: era_g 1
The key, value is: green 0
The key is mapluafile, the formated value is: SAM<A>_<B>
The key, value is: mode_eli_w 1
The key, value is: era_w 1
The key, value is: red 225
custom_printTable(): Returning
custom_printTable(): table: 04B167AC
The key, value is: key mode_eli
The key, value is: subst eli
The key, value is: showstr modename.name.hero-assault
The key, value is: descstr modename.description.elimination
The key, value is: icon mode_icon_eli
custom_printTable(): Returning
gMapEras.key = era_g Era = era_g subst = g
Adding map: SAMg_eli idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil
(none):0: attempt to call global `OnObjectKill' (a nil value)[/code]

Re: Scriptied Animation

Posted: Mon Jan 07, 2013 1:25 pm
by Locutus
When using a conquest script make sure your functions go after conquest:Start() but before the PostLoad end.
You script should look like this:

Code: Select all

function ScriptPostLoad()	   
    
    
    --Stuff like CP setup or whatever
        
    conquest:Start()

    animateobja = OnObjectKill(
   function(object, killer)
      if GetEntityName(object) == "panel1" then
         PlayAnimation("wdown")
      end
   end
)

killobjc = OnObjectKill(
   function(object, killer)
      if killer and IsCharacterHuman(killer) and GetEntityName(object) == "panel1" then
         AddAssaultDestroyPoints(killer)
      end
   end
)
 

       
 end


---------------------------------------------------------------------------
-- 
---------------------------------------------------------------------------
function ScriptInit()

Re: Scriptied Animation

Posted: Mon Jan 07, 2013 1:51 pm
by Bonecrusher16O
But the map is not Conquest, it is Eli/Assault.

Re: Scriptied Animation

Posted: Mon Jan 07, 2013 7:45 pm
by Loopy53
@AQT My bad, I read your post wrong. Sorry.

Re: Scriptied Animation

Posted: Mon Jan 07, 2013 7:51 pm
by Marth8880
The same goes with any game mode, so the stuff must go after conquest:Start(), or ctf:Start(), or TDM:Start() in your case.

Re: Scriptied Animation

Posted: Mon Jan 07, 2013 8:49 pm
by Bonecrusher16O
Yeah, I put it behind that..

Re: Scriptied Animation

Posted: Mon Jan 07, 2013 8:53 pm
by Dreadnot9
Post your entire lua.

Re: Scripted Animation

Posted: Tue Jan 08, 2013 8:14 pm
by Bonecrusher16O
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)

end



animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "panel1" then
PlayAnimation("wdown")
end
end
)

killobjc = OnObjectKill(
function(object, killer)
if killer and IsCharacterHuman(killer) and GetEntityName(object) == "panel1" then
AddAssaultDestroyPoints(killer)
end
end
)

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

ReadDataFile("dc:Load\\common.lvl")

StealArtistHeap(1536*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(2097152 + 65536 * 8)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",1144) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo

ReadDataFile("ingame.lvl")

ALL = 1
IMP = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(95)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_hero_luke_jedi",
"all_hero_hansolo_tat",
"all_hero_leia",
"all_hero_chewbacca")



ReadDataFile("dc:SIDE\\sit.lvl",
"cis_hero_darthmaul",
"cis_hero_countdooku",
"imp_hero_darthvader",
"imp_hero_emperor",
"rep_hero_cloakedanakin",
"sit_inf_sith",
"sit_inf_master",
"sit_inf_basic",
"sit_inf_guard_saber")


ReadDataFile("SIDE\\rep.lvl",
"rep_hero_macewindu",
"rep_hero_aalya",
"rep_hero_yoda",
"rep_hero_kiyadimundi",
"rep_hero_obiwan")

ReadDataFile("dc:SIDE\\jed.lvl",
"jed_knight_01",
"jed_knight_02",
"jed_knight_03",
"jed_knight_04",
"jed_master_01",
"jed_master_02",
"jed_master_03",
"jed_sith_01",
"jed_runner")


--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]

--ReadDataFile("SIDE\\snw.lvl", "snw_inf_wampa")

SetupTeams{
hero = {
team = ALL,
units = 32,
reinforcements = -1,
soldier = { "rep_hero_obiwan",1,2},
assault = { "jed_knight_02", 1,2},
engineer= { "all_hero_luke_jedi", 1,2},
sniper = { "rep_hero_yoda", 1,2},
officer = { "jed_master_02", 1,2},
special = { "rep_hero_macewindu", 1,2},
},
}
AddUnitClass(ALL, "rep_hero_aalya",1,2)
AddUnitClass(ALL, "jed_runner",1,2)
AddUnitClass(ALL, "rep_hero_none",1,2)

SetupTeams{
villain = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "sit_inf_master", 1,2},
assault = { "imp_hero_darthvader",1,2},
engineer= { "imp_hero_emperor", 1,2},
sniper = { "cis_hero_darthmaul", 1,2},
officer = { "sit_inf_basic", 1,2},
special = { "sit_inf_guard_saber", 1,2},

},
}
AddUnitClass(IMP, "rep_hero_cloakedanakin",1,2)
AddUnitClass(IMP, "cis_hero_countdooku",1,2)
AddUnitClass(IMP, "sit_inf_sith",1,2)


-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

local weaponCnt = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",118)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 5)
SetClassProperty("rep_hero_yoda","MaxHealth","1600")
SetClassProperty("rep_hero_yoda","EnergyBar","140")
SetClassProperty("rep_hero_yoda","AddHealth","6")
SetClassProperty("rep_hero_yoda","NoEnterVehicles","0")
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 500) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 1000)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 43)
SetMemoryPoolSize("UnitController", 43)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:SAM\\SAM.lvl", "SAM_eli")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)
OpenAudioStream("sound\\global.lvl", "cw_music")
OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "Allleaving")
SetOutOfBoundsVoiceOver(2, "Impleaving")

SetAmbientMusic(ALL, 0.3, "all_hero_Luke_lp", 0,1)
SetAmbientMusic(ALL, 0.3, "imp_hero_Palpatine_lp", 1,1)
SetAmbientMusic(ALL, 0.4, "all_hero_Luke_lp", 2,1)
SetAmbientMusic(IMP, 0.3, "imp_hero_Vader_lp", 0,1)
SetAmbientMusic(IMP, 0.3, "imp_hero_Palpatine_lp", 1,1)
SetAmbientMusic(IMP, 0.4, "imp_hero_Vader_lp", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

SetAttackingTeam(ATT)

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end[/code]

Re: Scripted Animation

Posted: Tue Jan 08, 2013 8:29 pm
by Locutus
See stuff marked in red...
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)

end --remove the "end" here



animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "panel1" then
PlayAnimation("wdown")
end
end
)

killobjc = OnObjectKill(
function(object, killer)
if killer and IsCharacterHuman(killer) and GetEntityName(object) == "panel1" then
AddAssaultDestroyPoints(killer)
end
end
)

--and add it here AFTER your functions (just like I said ;))

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

ReadDataFile("dc:Load\\common.lvl")

StealArtistHeap(1536*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(2097152 + 65536 * 8)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",1144) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo

ReadDataFile("ingame.lvl")

ALL = 1
IMP = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(95)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_hero_luke_jedi",
"all_hero_hansolo_tat",
"all_hero_leia",
"all_hero_chewbacca")



ReadDataFile("dc:SIDE\\sit.lvl",
"cis_hero_darthmaul",
"cis_hero_countdooku",
"imp_hero_darthvader",
"imp_hero_emperor",
"rep_hero_cloakedanakin",
"sit_inf_sith",
"sit_inf_master",
"sit_inf_basic",
"sit_inf_guard_saber")


ReadDataFile("SIDE\\rep.lvl",
"rep_hero_macewindu",
"rep_hero_aalya",
"rep_hero_yoda",
"rep_hero_kiyadimundi",
"rep_hero_obiwan")

ReadDataFile("dc:SIDE\\jed.lvl",
"jed_knight_01",
"jed_knight_02",
"jed_knight_03",
"jed_knight_04",
"jed_master_01",
"jed_master_02",
"jed_master_03",
"jed_sith_01",
"jed_runner")


--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]

--ReadDataFile("SIDE\\snw.lvl", "snw_inf_wampa")

SetupTeams{
hero = {
team = ALL,
units = 32,
reinforcements = -1,
soldier = { "rep_hero_obiwan",1,2},
assault = { "jed_knight_02", 1,2},
engineer= { "all_hero_luke_jedi", 1,2},
sniper = { "rep_hero_yoda", 1,2},
officer = { "jed_master_02", 1,2},
special = { "rep_hero_macewindu", 1,2},
},
}
AddUnitClass(ALL, "rep_hero_aalya",1,2)
AddUnitClass(ALL, "jed_runner",1,2)
AddUnitClass(ALL, "rep_hero_none",1,2)

SetupTeams{
villain = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "sit_inf_master", 1,2},
assault = { "imp_hero_darthvader",1,2},
engineer= { "imp_hero_emperor", 1,2},
sniper = { "cis_hero_darthmaul", 1,2},
officer = { "sit_inf_basic", 1,2},
special = { "sit_inf_guard_saber", 1,2},

},
}
AddUnitClass(IMP, "rep_hero_cloakedanakin",1,2)
AddUnitClass(IMP, "cis_hero_countdooku",1,2)
AddUnitClass(IMP, "sit_inf_sith",1,2)


-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

local weaponCnt = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",118)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 5)
SetClassProperty("rep_hero_yoda","MaxHealth","1600")
SetClassProperty("rep_hero_yoda","EnergyBar","140")
SetClassProperty("rep_hero_yoda","AddHealth","6")
SetClassProperty("rep_hero_yoda","NoEnterVehicles","0")
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 500) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 1000)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 43)
SetMemoryPoolSize("UnitController", 43)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:SAM\\SAM.lvl", "SAM_eli")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)
OpenAudioStream("sound\\global.lvl", "cw_music")
OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "Allleaving")
SetOutOfBoundsVoiceOver(2, "Impleaving")

SetAmbientMusic(ALL, 0.3, "all_hero_Luke_lp", 0,1)
SetAmbientMusic(ALL, 0.3, "imp_hero_Palpatine_lp", 1,1)
SetAmbientMusic(ALL, 0.4, "all_hero_Luke_lp", 2,1)
SetAmbientMusic(IMP, 0.3, "imp_hero_Vader_lp", 0,1)
SetAmbientMusic(IMP, 0.3, "imp_hero_Palpatine_lp", 1,1)
SetAmbientMusic(IMP, 0.4, "imp_hero_Vader_lp", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

SetAttackingTeam(ATT)

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end

Re: Scripted Animation

Posted: Fri Jan 11, 2013 7:24 pm
by Bonecrusher16O
It still doesn't work. When I destory the panel (correctly named) the animation does not play..
(Thx for the info on the "end" though, I can't believe I missed that.)

Re: Scripted Animation

Posted: Sat Jan 12, 2013 2:49 am
by AQT
Please post a screenshot of your animation's settings in ZE. Also, please post a screenshot of the panel in ZE with its name and object type displayed.

Re: Scripted Animation

Posted: Sat Jan 12, 2013 3:35 pm
by Bonecrusher16O
Umm how? When I save an image on Zero Edit it shows the objects but not the any of the tool bars. And Print Screen button only works for SWBF2 ingame.

Re: Scripted Animation

Posted: Sat Jan 12, 2013 4:13 pm
by CressAlbane
PrntScrn just copies your current display to the clipboard.

Re: Scripted Animation

Posted: Sat Jan 12, 2013 4:27 pm
by Bonecrusher16O
Not for me... (Or am is it because I am trying to paste it off the clipboard?)

Re: Scripted Animation

Posted: Sat Jan 12, 2013 5:39 pm
by Loopy53
here is an easier way. search snipping tool in the start menu. Open it, drag around ZE, save as .png, and upload to dropbox.

Re: Scripted Animation

Posted: Sat Jan 12, 2013 6:29 pm
by Marth8880
Better than Snipping Tool: http://code.google.com/p/sharexmod/ (Originally known as ZScreen)