This is the code I developed with help from Xwingguy, which originally designed to trigger an animation when 3 objects (cps) are owned by team on republic. I then modified it without success to then kill the captured commands posts, and respawn 2 more at the same moment the animation begins. This was successful. (cps 2,3,5 disappear, cp1 and cp1cam appear)OnGunshipTime = OnFinishCapture(
function(post)
if GetObjectTeam("cp2") == 1 then
if GetObjectTeam("cp3") == 1 then
if GetObjectTeam("cp5") == 1 then
ReleaseFinishCapture(OnGunshipTime)
OnGunshipTime = nil
PlayAnimationFromTo("LAAT", 0, 210)
RespawnObject("cp1cam")
RespawnObject("cp1")
KillObject("cp2")
KillObject("cp3")
KillObject("cp5")
CreateTimer ("LAATJourney1")
SetTimerValue("LAATJourney1",210)
StartTimer("LAATJourney1")
end
end --every time you add a command post if statement you must add another end here
end
end
)
OnGetTimerValue ("LAATJourney1" , 210)
RespawnObject("cp2cam")
end
KillObject("cp1")-note this stuff happens before the above stuff
KillObject("cp4")
KillObject("cp6")
KillObject("cp7")
KillObject("cp8")
KillObject("cp1cam")
KillObject("cp2cam")
CreateTimer ("CISreinf1")
SetTimerValue("CISreinf1",3600)
StartTimer("CISreinf1")
OnGetTimerValue ("CISreinf1" , 3300)
AddReinforcements (2, 50)
My next goal was to have another command post spawn when the animation reached 210 seconds, which is when an animated gunsip reaches it's destination. Since I could find no "Getanimationtime' function I attempted to have a a timer (LAATjourney1) begin simualtaneous with the animation and use gettimervalue function. My timers doen't work and end in munge errors.
At the bottom of this section of code is a timer that is supposed to add 50 reinforcments to the CIS every five minutes (my attemot at more realistic reinforcements coming in from a wide area, the republic most secure the area and gain local supeority as to stop incoming cis and move on to next objectives) but it doesn't work either.
If one of the code experts could rewrite it proparly (man that doc is hard to understand, but I'm learning. It shows an example of get object time with an arrow symbol that doesn't work in .lua. . .) or at least tell me my errors, well, thanks!


