Animations are stopping ai from spawning?
Posted: Tue Jun 06, 2006 5:26 pm
Ok, I have just now started animating objects! woohoo! I have no clue what any ofthe stuff in the my lua is cause I just copied it from the Utapau map, ( the hovering rep gunship) I added that to my map, anyway, for some reason my units arnt spawning, but the animations work. here is my lUa if anyone can help. thnks!
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
isUberMode = true,
multiplayerRules = true}
--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:Start()
SetUberMode(1);
EnableSPHeroRules()
end
--------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptPostLoad()
SetProperty("LAATAttack", "MaxHealth", 150)
SetProperty("LAATAttack", "CurHealth", 150)
SetProperty("LAATRider", "MaxHealth", 150)
SetProperty("LAATRider", "CurHealth", 150)
laanim = 1
lranim = 2
la_anim()
lr_anim()
-- This is the LAAT Callback info
la_death = OnObjectKillName(la_anim, "LAATAttack");
lr_death = OnObjectKillName(lr_anim, "LAATRider");
la_timer = CreateTimer("la_timer")
SetTimerValue(la_timer, 20)
StartTimer(la_timer)
OnTimerElapse(
function(timer)
KillObject("LAATAttack")
end,
la_timer
)
lr_timer = CreateTimer("lr_timer")
SetTimerValue(lr_timer, 20)
StartTimer(lr_timer)
OnTimerElapse(
function(timer)
KillObject("LAATRider")
end,
lr_timer
)
end
function la_anim()
if laanim == 1 then
PauseAnimation("LA03");
RewindAnimation("LA01");
PlayAnimation("LA01");
EntityFlyerTakeOff("LAATAttack")
laanim = 2
elseif laanim == 2 then
PauseAnimation("LA01");
RewindAnimation("LA02");
PlayAnimation("LA02");
EntityFlyerTakeOff("LAATAttack")
laanim = 3
elseif laanim == 3 then
PauseAnimation("LA02");
RewindAnimation("LA03");
PlayAnimation("LA03");
EntityFlyerTakeOff("LAATAttack")
laanim = 1
end
SetTimerValue(la_timer, 30)
StartTimer(la_timer)
end
function lr_anim()
if lranim == 1 then
PauseAnimation("LR03");
RewindAnimation("LR02");
PlayAnimation("LR02");
EntityFlyerTakeOff("LAATRider")
lranim = 2
elseif lranim == 2 then
PauseAnimation("LR01");
RewindAnimation("LR03");
PlayAnimation("LR03");
EntityFlyerTakeOff("LAATRider")
lranim = 3
elseif lranim == 3 then
PauseAnimation("LR02");
RewindAnimation("LR01");
PlayAnimation("LR01");
EntityFlyerTakeOff("LAATRider")
lranim = 1
end
SetTimerValue(lr_timer, 30)
StartTimer(lr_timer)
end
function Backup()
SetProperty("LAATDrop01", "MaxHealth", 1250)
SetProperty("LAATDrop01", "CurHealth", 1250)
EntityFlyerTakeOff("LAATDrop01")
EntityFlyerInitAsLanded("LAATAttack")
KillObject("LAATAttack")
KillObject("LAATRider")
DestroyTimer(lr_timer)
DestroyTimer(la_timer)
ReleaseObjectKill(la_death)
ReleaseObjectKill(lr_death)
DeactivateRegion(backup_region)
PauseAnimation("LA01");
PauseAnimation("LA02");
PauseAnimation("LA03");
PauseAnimation("LR01");
PauseAnimation("LR02");
PauseAnimation("LR03");
PauseAnimation("drop-hide");
RewindAnimation("LA-hide");
PlayAnimation("LA-hide");
RewindAnimation("LR-hide");
PlayAnimation("LR-hide");
RewindAnimation("Backup");
PlayAnimation("Backup");
end
function Helpers()
SetProperty("LAATDrop01", "MaxHealth", 1250)
SetProperty("LAATDrop01", "CurHealth", 1250)
SetProperty("LAATDrop02", "MaxHealth", 1250)
SetProperty("LAATDrop02", "CurHealth", 1250)
EntityFlyerTakeOff("LAATDrop01")
EntityFlyerTakeOff("LAATDrop02")
EntityFlyerInitAsLanded("LAATAttack")
EntityFlyerInitAsLanded("LAATRider")
DeactivateRegion(helpers_region)
PauseAnimation("hide02");
PauseAnimation("Backup");
RewindAnimation("backup2");
PlayAnimation("backup2");
EntityFlyerTakeOff("LAATDrop01")
EntityFlyerTakeOff("LAATDrop02")
end
function ScriptInit()
ReadDataFile("ingame.lvl")
SetMaxFlyHeight(500)
SetMaxPlayerFlyHeight (500)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
ReadDataFile("sound\\mus.lvl;mus1cw")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_fly_assault_dome",
"rep_fly_gunship_sc",
"uta1_fly_ride_gunship",
"uta1_prop_gunship",
"rep_fly_arc170fighter_sc",
"rep_fly_anakinstarfighter_sc",
"rep_inf_ep4_marine",
"rep_inf_ep3_jettrooper",
"rep_walk_atxt",
"rep_walk_oneman_atst",
"rep_walk_atte",
"rep_hover_fightertank",
"rep_hero_obiwan",
"rep_hover_barcspeeder")
etc.....etc.....
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
isUberMode = true,
multiplayerRules = true}
--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:Start()
SetUberMode(1);
EnableSPHeroRules()
end
--------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptPostLoad()
SetProperty("LAATAttack", "MaxHealth", 150)
SetProperty("LAATAttack", "CurHealth", 150)
SetProperty("LAATRider", "MaxHealth", 150)
SetProperty("LAATRider", "CurHealth", 150)
laanim = 1
lranim = 2
la_anim()
lr_anim()
-- This is the LAAT Callback info
la_death = OnObjectKillName(la_anim, "LAATAttack");
lr_death = OnObjectKillName(lr_anim, "LAATRider");
la_timer = CreateTimer("la_timer")
SetTimerValue(la_timer, 20)
StartTimer(la_timer)
OnTimerElapse(
function(timer)
KillObject("LAATAttack")
end,
la_timer
)
lr_timer = CreateTimer("lr_timer")
SetTimerValue(lr_timer, 20)
StartTimer(lr_timer)
OnTimerElapse(
function(timer)
KillObject("LAATRider")
end,
lr_timer
)
end
function la_anim()
if laanim == 1 then
PauseAnimation("LA03");
RewindAnimation("LA01");
PlayAnimation("LA01");
EntityFlyerTakeOff("LAATAttack")
laanim = 2
elseif laanim == 2 then
PauseAnimation("LA01");
RewindAnimation("LA02");
PlayAnimation("LA02");
EntityFlyerTakeOff("LAATAttack")
laanim = 3
elseif laanim == 3 then
PauseAnimation("LA02");
RewindAnimation("LA03");
PlayAnimation("LA03");
EntityFlyerTakeOff("LAATAttack")
laanim = 1
end
SetTimerValue(la_timer, 30)
StartTimer(la_timer)
end
function lr_anim()
if lranim == 1 then
PauseAnimation("LR03");
RewindAnimation("LR02");
PlayAnimation("LR02");
EntityFlyerTakeOff("LAATRider")
lranim = 2
elseif lranim == 2 then
PauseAnimation("LR01");
RewindAnimation("LR03");
PlayAnimation("LR03");
EntityFlyerTakeOff("LAATRider")
lranim = 3
elseif lranim == 3 then
PauseAnimation("LR02");
RewindAnimation("LR01");
PlayAnimation("LR01");
EntityFlyerTakeOff("LAATRider")
lranim = 1
end
SetTimerValue(lr_timer, 30)
StartTimer(lr_timer)
end
function Backup()
SetProperty("LAATDrop01", "MaxHealth", 1250)
SetProperty("LAATDrop01", "CurHealth", 1250)
EntityFlyerTakeOff("LAATDrop01")
EntityFlyerInitAsLanded("LAATAttack")
KillObject("LAATAttack")
KillObject("LAATRider")
DestroyTimer(lr_timer)
DestroyTimer(la_timer)
ReleaseObjectKill(la_death)
ReleaseObjectKill(lr_death)
DeactivateRegion(backup_region)
PauseAnimation("LA01");
PauseAnimation("LA02");
PauseAnimation("LA03");
PauseAnimation("LR01");
PauseAnimation("LR02");
PauseAnimation("LR03");
PauseAnimation("drop-hide");
RewindAnimation("LA-hide");
PlayAnimation("LA-hide");
RewindAnimation("LR-hide");
PlayAnimation("LR-hide");
RewindAnimation("Backup");
PlayAnimation("Backup");
end
function Helpers()
SetProperty("LAATDrop01", "MaxHealth", 1250)
SetProperty("LAATDrop01", "CurHealth", 1250)
SetProperty("LAATDrop02", "MaxHealth", 1250)
SetProperty("LAATDrop02", "CurHealth", 1250)
EntityFlyerTakeOff("LAATDrop01")
EntityFlyerTakeOff("LAATDrop02")
EntityFlyerInitAsLanded("LAATAttack")
EntityFlyerInitAsLanded("LAATRider")
DeactivateRegion(helpers_region)
PauseAnimation("hide02");
PauseAnimation("Backup");
RewindAnimation("backup2");
PlayAnimation("backup2");
EntityFlyerTakeOff("LAATDrop01")
EntityFlyerTakeOff("LAATDrop02")
end
function ScriptInit()
ReadDataFile("ingame.lvl")
SetMaxFlyHeight(500)
SetMaxPlayerFlyHeight (500)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
ReadDataFile("sound\\mus.lvl;mus1cw")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_fly_assault_dome",
"rep_fly_gunship_sc",
"uta1_fly_ride_gunship",
"uta1_prop_gunship",
"rep_fly_arc170fighter_sc",
"rep_fly_anakinstarfighter_sc",
"rep_inf_ep4_marine",
"rep_inf_ep3_jettrooper",
"rep_walk_atxt",
"rep_walk_oneman_atst",
"rep_walk_atte",
"rep_hover_fightertank",
"rep_hero_obiwan",
"rep_hover_barcspeeder")
etc.....etc.....