Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: jedione on May 18, 2020, 05:43:22 PM
-
so what im trying to do is
when theme starts, it is automatically passed one signal , prev_game" or "next_game"
because all my animations are set to, Transition.ToNewSelection`
not `Transition.StartLayout`
if any one can do this, or knows a work around......thanks
-
try changing this:
if (ttype == Transition.StartLayout){
to:
if (ttype == Transition.StartLayout || Transition.ToNewSelection){
"||" means either true if StartLayout or ToNewSelection are true
or, if you want an easier fix, just add:
fe.add_transition_callback( this, whenStart )
function whenStart ( ttype, var, transition_time )
{
if (ttype == Transition.StartLayout)
{
fe.signal("next_game")
}
}
(found this info here https://developer.electricimp.com/squirrel/squirrel-guide/operators)
-
i tryed
fe.add_transition_callback( this, whenStart )
function whenStart ( ttype, var, transition_time )
{
if (ttype == Transition.StartLayout)
{
fe.signal("next_game")
}
}
does not seem to work, ,,, it says "the the index 'whenStart' does not exist"
so i added "local whenStart;
and now it doesent throw that "whenStart' does not exist" but doesent do anything,
-
maybe try putting fe.add_transition_callback after the whenStart function:
function whenStart ( ttype, var, transition_time )
{
if (ttype == Transition.StartLayout)
{
fe.signal("next_game")
}
}
fe.add_transition_callback( this, whenStart )
did you try the (ttype == Transition.StartLayout || Transition.ToNewSelection)?
-
ill try when i get home from work,, thanks for your help....
-
You can try a much simpler approach..
local your_animation_on_old_or_new = {
when = Transition.FromOldSelection,
property = "x",
start = flx*0.294,
end = flx*0,
time = 0
}
local your_animation_on_StartLayout = {
when = Transition.StartLayout,
property = "x",
start = flx*0.294,
end = flx*0,
time = 0
}
animation.add( PropertyAnimation( your_object, youranimation_on_old_or_new) );
animation.add( PropertyAnimation( your_object, youranimation_on_StartLayout) );
-
function whenStart ( ttype, var, transition_time )
{
if (ttype == Transition.StartLayout || Transition.ToNewSelection)
{
fe.signal("next_game")
}
}
fe.add_transition_callback( this, whenStart );
not working, for me.. this method would work best, if it can work,
-
try just replacing any previous
.StartLayout
transitions with
Transition.StartLayout || Transition.ToNewSelection
do this to all transitions you want to apply this to
-
You can try a much simpler approach..
local your_animation_on_old_or_new = {
when = Transition.FromOldSelection,
property = "x",
start = flx*0.294,
end = flx*0,
time = 0
}
local your_animation_on_StartLayout = {
when = Transition.StartLayout,
property = "x",
start = flx*0.294,
end = flx*0,
time = 0
}
animation.add( PropertyAnimation( your_object, youranimation_on_old_or_new) );
animation.add( PropertyAnimation( your_object, youranimation_on_StartLayout) );
yeah, that would work too