Page 1 of 1

Destroy consol, open door ?

Posted: Sun Feb 01, 2009 2:54 pm
by Alpha_07
I need some help for my new map.
I want this:
If I destroy a consol, a door will open.

What must I write in the LUA ?




Sorry for my bad english

Re: Destroy consol, open door ?

Posted: Sun Feb 01, 2009 3:01 pm
by Fiodis
You yourself can delete one of the cloned posts. You could also have edited your first post in this thread instead of double-posting.


And...I think it has to be in the LUA, yes. Take a peek at the Mustafar one.

Maybe you could combine OnEnterRegion with PlayAnimationFromTo or something like that.


EDIT - Wait.....OnEnterRegion makes no sense there....well, sneak a peek at Mustafar's LUA anyway.

Re: Destroy consol, open door ?

Posted: Sun Feb 01, 2009 5:58 pm
by YaNkFaN
here are the lines from kashyyyk

OnObjectKillName(PlayAnimDown, "gatepanel");
OnObjectRespawnName(PlayAnimUp, "gatepanel");

end

function PlayAnimDown()
PauseAnimation("thegateup");
RewindAnimation("thegatedown");
PlayAnimation("thegatedown");
ShowMessageText("level.kas2.objectives.gateopen",1)
ScriptCB_SndPlaySound("KAS_obj_13")
SetProperty("gatepanel", "MaxHealth", 2200)
-- SetProperty("gatepanel", "CurHealth", 50000)
-- PlayAnimation("gatepanel");
--SetProperty("gatepanel", "MaxHealth", 1e+37)
--SetProperty("gatepanel", "CurHealth", 1e+37)


-- Allowing AI to run under gate
UnblockPlanningGraphArcs("seawall1");
DisableBarriers("seawalldoor1");
DisableBarriers("vehicleblocker");

end

function PlayAnimUp()
PauseAnimation("thegatedown");
RewindAnimation("thegateup");
PlayAnimation("thegateup");


-- Allowing AI to run under gate
BlockPlanningGraphArcs("seawall1");
EnableBarriers("seawalldoor1");
EnableBarriers("vehicleblocker");
SetProperty("gatepanel", "MaxHealth", 1000)
SetProperty("gatepanel", "CurHealth", 1000)

end

hope this helps

Re: Destroy consol, open door ?

Posted: Mon Feb 02, 2009 9:16 am
by Alpha_07
thank you

I'll try that