What we are trying to do is - Each time you press a button it calls the function navChecker. From there we would like to call act_sc1. Then when the button is pressed again, act_sc2 is called from navChecker and so on - up to act_sc8.
So we are trying to use the variable scAdvnc to advance the name of the function to be called which we are specifying as the timer listener along with “act_sc”.
This doesn’t produce an error - but nothing happens - the scenes don’t play.
I guess the question is can you even use variables in this way with the timer listener? If you can, what are we doing wrong? Or is there a better way to achieve this? The only thing that can’t change is the format of the functions, sc1 - 8 which have to have the format as shown above - function act_sc1 (event) etc.
Help would be most appreciated.
[blockcode] local scAdvnc = 1
local navChecker = function ()
scAdvnc = scAdvnc + 1
timerStash.timer_sa = timer.performWithDelay( 100, “act_sc”…scAdvnc, 1 )
end
function act_sc1 (event)
– code
end
function act_sc2 (event)
– code
end
– etc up to act_sc8
[import]uid: 166507 topic_id: 36168 reply_id: 336168[/import]