Elevator Pathing Script-Functions not carried out!
Posted: Sat Aug 12, 2006 11:15 am
For some reason the following script, designed to to disable plans and barriers (objects too) coninciding with an animated elevator, neglects to kill and respawn objets and apparently, the pathing funtions. However, the next timer is created and started. Any ideas? Also, the spelling is right (I think)
Edit: The Timer Elevator13 never starts. But the elapse of TImer Elevator1 triggers Timer Elevator 12, without killing the objects or paths.--ELEVATOR1 PLANNING
--///vvvbegin sequence
PlayAnimation("Elevator")
BlockPlanningGraphArcs("Elevator1-down")
BlockPlanningGraphArcs("Elevator1-up")
CreateTimer("Elevator1")--Creates
SetTimerRate("Elevator1", 1)--Sets the rate
SetTimerValue("Elevator1", 10)--and value of
StartTimer("Elevator1")--then starts the downgoing timer
ShowTimer("Elevator1")
--///^^^begin sequence
--///vvvDownGoingTimerElapse-What happens when the downgoing timer ends
OnTimerElapse(
function(timer)
UnblockPlanningGraphArcs("Elevator1-up")--allows units to follow plans onto elevator at bottom
KillObject("elebars2")
KillObject("elebars3")
CreateTimer("Elevator12")--Creates
SetTimerRate("Elevator12", 1)--Sets the rate
SetTimerValue("Elevator12", 20)--and value of
StartTimer("Elevator12")--then starts the bottomwait timer
ShowTimer("Elevator12")
end,
"Elevator1"
)
--///^^^DowngoingTimerElapse
--///vvvbottomwait timer elapse-Stuff that happens when the elevator starts going back up
OnTimerElapse(
function(timer)
BlockPlanningGraphArcs("Elevator1-up")
RespawnObject("elebars2")
RespawnObject("elebars3")
CreateTimer("Elevator13")--Creates
SetTimerRate("Elevator13", 1)--Sets the rate
SetTimerValue("Elevator13", 10)--and value of
StartTimer("Elevator13")--then starts the upgoing timer
ShowTimer("Elevator13")
end,
"Elevator12"
)
--///^^^bottomwait timer elapse
--///vvv upgoing timer elapse-Stuff that happens when the elevator reaches the top again
OnTimerElapse(
function(timer)
DisableBarriers("Elevator1-top")
UnblockPlanningGraphArcs("Elevator1-down")
KillObject("elebars1")
CreateTimer("Elevator14")--Creates
SetTimerRate("Elevator14", 1)--Sets the rate
SetTimerValue("Elevator14", 20)--and value of
StartTimer("Elevator14")--then starts the top waiting timer
ShowTimer("Elevator14")
end,
"Elevator13"
)
--///^^^ upgoing timer elapse
--///vvv top wait timer elapse-Stuff that happens when the elevator starts going back down
RespawnObject("elebars1")
SetTimerRate("Elevator1", 1)--reSets the rate
SetTimerValue("Elevator1", 10)--and value of
StartTimer("Elevator1")--then restarts the downgoing timer
ShowTimer("Elevator1")
--///^^^ top wait timer elapse
--end ELEVATOR1 PLANNING