-- -- Autor: Benjam√ån de la Fuente Ranea -- Fecha: 23-12-2008 -- -- Script con la descripciÛn del circuito -- RegisterCircuit(0, 1, { name = "circuit_tuto1.lua", model = "circuit_playground1.mesh", lightMap = "", groundNodes = "Backgrnd,Rodea,Rodeanoc,Rampas,Rampa01,Rampa02,Rampa03,barreras,Obstacles", noRayCollision = "Rodeanoc", physicsNodes = "Box01,Box02,Box03,Box04,Box05,Item:ActorGeom:CheckPoint(1),Item:ActorGeom:CheckPoint(2),Item:ActorGeom:CheckPoint(3),Item:ActorGeom:CheckPoint(4),Item:ActorGeom:CheckPoint(5),Cone:cono_1,Cone:cono_2,Cone:cono_3,Cone:cono_4,Cone:cono_6,Cone:cono_7,Cone:cono_8,Cone:cono_10,Cone:cono_11,Cone:cono_12", camera = "circuit_tuto", cutscene = "", nLaps = 1, controlPointsData = { }, respawnPoints = { 1 }, nitroPoints = { }, itemDecisionPoints = { }, preInit = function() execute("circuits/circuit_common.lua") function ShowInitialTutoText() if ExistsActor("TutoInfoScreen") then CreateActor("ActorGeom", { name = "TutoMessage", model = "HUD/tutotext.mesh", layer = LF_PANELS+1, camera = "HUD" }) SetText("TutoText()", g_Text.initTuto1Message) SetActorAnim("TutoMessage", { anim = "HUD/tutotext.anm" }) end end function TutoText() return { text = "", scale = 0.07, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end g_checkPoints = {} SetResetCarPoint("Car1", "Car1") function CheckPoint(_id, _carId) if _carId then if not g_checkPoints[_id] then -- Animamos el checkpoint local actorName = "CheckPoint(" .. _id .. ")" ClearActorAnims(actorName, true, true) Sound.PlaySound(g_ActivateCheckpointSound) SetActorAnim(actorName, { anim = "circuitStuff/tl_on.anm" }) -- Actualizamos el contador g_checkPoints[_id] = true local currentCheckpoints = CountCheckPoints() UpdateCheckpoints(currentCheckpoints) EnqueueExecuteScript(actorName, "SetActorAnim('" .. actorName .. "', { anim = 'circuitStuff/tl_on_cycle.anm', loop = true })") -- Comprobación de fin de tutorial if currentCheckpoints == #g_checkPoints then EndCurrentTutorial() DestroyActor('TutoMessage') end end else g_checkPoints[_id] = false return { model = "circuitStuff/tutolight.mesh" } end end function CountCheckPoints() local numCheckpoints = 0 for i = 1, #g_checkPoints, 1 do if g_checkPoints[i] then numCheckpoints = numCheckpoints + 1 end end return numCheckpoints end end, onInit = function() SetActorAnim("CheckPoint(1)", { anim = "circuitStuff/tl_off_cycle.anm", loop = true, }) SetActorAnim("CheckPoint(2)", { anim = "circuitStuff/tl_off_cycle.anm", loop = true, }) SetActorAnim("CheckPoint(3)", { anim = "circuitStuff/tl_off_cycle.anm", loop = true, }) SetActorAnim("CheckPoint(4)", { anim = "circuitStuff/tl_off_cycle.anm", loop = true, }) SetActorAnim("CheckPoint(5)", { anim = "circuitStuff/tl_off_cycle.anm", loop = true, }) end, })