Improve EventSequence example.

This commit is contained in:
hispidence 2023-01-26 21:19:58 +00:00
parent a52177e34c
commit fcf96568f9

View file

@ -22,17 +22,20 @@
-- LevelFuncs.TriggerSequence = function(obj) -- LevelFuncs.TriggerSequence = function(obj)
-- local posSteve = TEN.Objects.GetMoveableByName("stevePosNullmesh"):GetPosition() -- local posSteve = TEN.Objects.GetMoveableByName("stevePosNullmesh"):GetPosition()
-- local posChris = TEN.Objects.GetMoveableByName("chrisPosNullmesh"):GetPosition() -- local posChris = TEN.Objects.GetMoveableByName("chrisPosNullmesh"):GetPosition()
-- local mySeq = EventSequence.Create("my_seq", -- local mySeq = EventSequence.Get("my_seq")
-- false, -- does not loop -- if not mySeq then
-- {seconds = true, deciseconds = true}, -- timer format, see Timer for details -- mySeq = EventSequence.Create("my_seq",
-- 6, -- seconds until call the function specified in next arg -- false, -- does not loop
-- LevelFuncs.HealLara, -- first function to call. If we don't need to pass any arguments, we can just pass the function -- {seconds = true, deciseconds = true}, -- timer format, see Timer for details
-- 2.1, -- seconds until the next function, after the previous one has been called -- 6, -- seconds until call the function specified in next arg
-- {LevelFuncs.SpawnBaddy, TEN.Objects.ObjID.BADDY1, "steve", posSteve}, -- if we DO want to pass arguments to the function to be called, we give a table with the function (LevelFuncs.SpawnBaddy in this case) followed by the args to pass to it -- LevelFuncs.HealLara, -- first function to call. If we don't need to pass any arguments, we can just pass the function
-- 0.5, -- 2.1, -- seconds until the next function, after the previous one has been called
-- {LevelFuncs.SpawnBaddy, TEN.Objects.ObjID.SAS_CAIRO, "chris", posChris}, -- {LevelFuncs.SpawnBaddy, TEN.Objects.ObjID.BADDY1, "steve", posSteve}, -- if we DO want to pass arguments to the function to be called, we give a table with the function (LevelFuncs.SpawnBaddy in this case) followed by the args to pass to it
-- 1, -- 0.5,
-- LevelFuncs.HealLara) -- {LevelFuncs.SpawnBaddy, TEN.Objects.ObjID.SAS_CAIRO, "chris", posChris},
-- 1,
-- LevelFuncs.HealLara)
-- end
-- --
-- -- event sequences are inactive to begin with and so need to be started -- -- event sequences are inactive to begin with and so need to be started
-- mySeq:Start() -- mySeq:Start()