Yay, I know this isn't my topic but i think its ok if I post this here.
I had also trouble getting that working and just got it.

*happy*
Okay, for those who have trouble with it, here is my lua:
Code: Select all
--
-- LUA Angruya Droid Invasion
--
-- Gametyp Scripts
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("AIHeroSupport")
-- REP Angreifer (1 = Angreifer)
REP = 1;
CIS = 2;
-- Nicht aendern
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
--CP's
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
--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",
multiplayerRules = true}
--CP Ziele
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:Start()
herosupport = AIHeroSupport:New{AIATTHeroHealth = 2800, AIDEFHeroHealth = 2800, gameMode = "NonConquest",}
herosupport:SetHeroClass(REP, "rep_inf_clone_commando")
herosupport:SetHeroClass(CIS, "cis_inf_ubd")
herosupport:AddSpawnCP("cp1","cp1_spawn")
herosupport:AddSpawnCP("cp2","cp2_spawn")
herosupport:AddSpawnCP("cp3","cp3_spawn")
herosupport:AddSpawnCP("cp4","cp4_spawn")
herosupport:Start()
OnObjectRespawnName(PlayAnimRise, "hdoorpanel");
OnObjectKillName(PlayAnimDrop, "hdoorpanel");
EnableSPHeroRules()
end
--START BRIDGEWORK!
-- CLOSE
function PlayAnimDrop()
PauseAnimation("hdooropen");
RewindAnimation("hdoorclose");
PlayAnimation("hdoorclose");
-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection10");
BlockPlanningGraphArcs("Connection0");
BlockPlanningGraphArcs("Connection9");
EnableBarriers("Barrier92");
end
-- OPEN
function PlayAnimRise()
PauseAnimation("hdoorclose");
RewindAnimation("hdooropen");
PlayAnimation("hdooropen");
-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection10");
UnblockPlanningGraphArcs("Connection0");
UnblockPlanningGraphArcs("Connection9");
DisableBarriers("Barrier92");
end
function ScriptPreInit()
SetWorldExtents(1500)
end
-------------------------
function ScriptInit()
Woah its awesome, now the hangar in my map can be closed.
