Some help please. Style works in Style Editor, not on board

This is wordy and heady. Sorry if hard to follow, but it makes sense I promise.
Hopefully just a “get the words out” to help me figure it out myself.

So I understand that OS7 may bring some things to make this easier, but for now, I am working some more on a dual blade control for an Inquisitor saber.
I have my prop controls set, and I use EFFECT_USER4 to trigger ignition and retraction in the blade style.
Using EffectSequence has its quirks, such as the first COLOR shown is actually the last one in the list until the trigger is…triggered, and that’s all well and good and understood.
Everything below works fine in the Style editor, but I have no idea why in real life, I can’t get the EFFECT_RETRACTION to show.

In plain english, here’s how this works:
Power button turns main blade on.
2nd blade is set to run EffectSequence as a toggle, and is initially hidden because it starts on Black, then EFFECT_USER4 triggers a Wipe to reveal a Layers<> containing all the blade layers, with a simultaneous pseudo EFFECT_IGNITION “power surge” TransitionEffectL that uses EFFECT_USER4.
The Wipe has a built in instant Black at first to conceal the sudden base blade reveal. Then the WipeIn has instant “base blade color” for the inverse effect, as well as a retraction surge “cool down”. This all works fine, as do the pseudo EFFECT_IGNITION and EFFECT_RETRACTION since it all uses USER4.

However, If the 2nd blade is on, and the POWER button is used to turn off ALL blades (I have a standard InOutTrL Wipe built to handle that for 2nd blade style), there is no pseudo EFFECT_RETRACTION effect on the 2nd blade since it’s built in as USER4, which did not initiate the retraction. So, for uniformity, I am trying to build in a standard EFFECT_RETRACTION to handle it (as I did with the WipeIn) for when POWER is used to power off all blades.
So, what’s happening is - I need to have another toggle now, one state for when 2nd blade is active, which would basically do nothing (like show a 100% transparent color), and the other state for when the 2nd blade is running, and have that one show the EFFECT_RETRACTION “cool down” surge.
I can’t use EffectSequence<EFFECT_USER4 again, because the 2 list "COLOR"s would be TransitionEffectL<. . . . . .EFFECT_RETRACTION> and do not respect the same EFFECT_trigger…however that should be worded.
So I used a Mix to toggle them, with a nested EffectIncrementF listening for USER4, inside IsGreaterThan 100 and set the values to run exactly 0/32768 and 16384.
This works! the Style Editor

But when uploaded, I get just black when it certainly should be showing the toggled state of EFFECT_RETRACTION.

Additionally, the 2nd weird thing is I can have 2 TransitionEffectL’s in the Mix<> and it’s happy, but if I try solid colors (to visually test easily), I get all sorts of RGBnod overdrive errors.
Even putting the default Mix<Int<16384>,Red,Blue> as a layer anywhere in the style, it chokes on compiling. Weird.

There are comments included on the style to point out what’s what.

Any idea why I am not seeing the actual EFFECT_RETRACTION effect on the board, but it works in Style Editor?
(NOTE - I use EFFECT_CLASH in lieu of EFFECT_USER4 when testing in Style Editor)
Also…The toggle of 2nd blade on/off resets to OFF automatically when turning off the blade (a good thing, but I don’t see how that could be). This might be due to my prop as It does not in the Editor, and will still be on if POWER is toggled without synced CLASH pressed.

    EffectSequence<EFFECT_CLASH, // Used to toggle base color on-off.
      // The following COLOR can be replaced by a Layers<> containing your primary blade style stuff, 
      // from the base blade color down to, but not including, the InOutTrL, and minus any EFFECT_RETRACTION layers.
      Layers< // on press
        TransitionEffectL<TrConcat<TrInstant,HumpFlickerL<White,50>,TrFade<1000>>,EFFECT_CLASH> // pseudo EFFECT_IGNITION
      Black // starts here at power on of main blade
      TransitionEffectL<TrConcat<TrInstant,Black,TrWipe<500>>,EFFECT_CLASH>, // pseudo extension wipe     
        // This color should be the same as the base blade color layer
          TrConcat<TrFadeX<WavLen<>>,AudioFlickerL<White>,TrInstant>, // pseudo EFFECT_RETRACTION
          TrWipeInX<WavLen<>>>>,EFFECT_CLASH>>,                       // pseudo retraction wipe (for 2nd blade discrete retraction before actual power off.)
    Mix<IsGreaterThan<EffectIncrementF<EFFECT_CLASH,Int<32768>,Int<16384>>,Int<100>>, // Used to toggle Actual power button EFFECT_RETRACTION (Don't show if 2nd blade already retracted). Int<100> could be anything up to 16383
      AlphaL<Black,Int<0>>, // Invisible filler in sync with pseudo version already handled above
      TrInstant, // In-Out: Instantly reveal because USER4 handles wipe and EFFECT_IGNITION
      TrWipeInX<WavLen<EFFECT_RETRACTION>>> // Covering both blades if alt blade left on

First up: Putting solid colors where a layer is expected won’t work in ProffieOS, but might work in the editor.

I’m wondering why the 2nd blade toggle resets though. Maybe your prop does SetPreset() at some point?

Seems like it would be easier to make the prop send EFFECT_USER4 when the saber turns off than to have two retractions.

If you just remove the Mix<> (and only keep one retraction thing at a time) does it work? (Of course it won’t do both, but you could test one thing at a time, right?)

Thanks for the reply. In the end, again, this is all temporary messing around with workarounds until a better (announced today) way of doing this comes to fruition.

This sounds odd. Don’t we do it all the time, and out of necessity? Like even the Layered style in the Examples tab in the Editor has Red as the first layer?
And a transparent color for the first layer causes errors, so it MUST be a solid color…
Like even StylePtr<Layers<Red>>(), compiles fine.
I must be misunderstanding. NOT important right now.


Yeah that’s it. I set a bool for alt_blade_off_ to true for all instances of blade turning off.

Doubles up sounds. wait… no it doesn’t . Meh…kinda giving up on this now.
Flipping the toggle is getting in its own way. Not seeing an easy way to escape it other than just don’t do the EFFECT_RETRACTION

Thanks for listening and helping.
Now for the REAL way to do it (:wink: Fernando)

The first “layer” is special though, it is normally a solid color.

1 Like

Holy Cow I got it…almost.
I should be able to just use TrSelect for the InOutTrL retraction transition to toggle between Instant (when 2nd blade is off anyway) and a TrWipe TrJoined with the TrConcat from the desired EFFECT_RETRACTION surge.
—and it should totally work in theory—
But something odd is happening now though, and I don’t think it’s me.
In BOTH the editor and on the board itself, I feel like something is conflicting because toggles don’t reliably stay in sync between states.

Would there be any reason that things could get wonky between EffectSequence<> and EffectIncrement<> ?

I am repeatedly able to reproduce a “sometimes it works fine, next time it doesn’t” scenario.
Clearly I’ve “talked too much” but I think I am experiencing a legit weirdness in code and am looking to “report” it, or at least come to know it’s not just me.

Here’s the simplified style, with the power button retraction set to just Green for testing and differentiating, and a link to it in the Editor, as well as a video of it in the Editor:


The EffectIncrementF<> only runs while your transition is active so it will not work like you’re wanting. OS7 will have solutions for what you’re trying to do :wink: but right now I don’t think you’re going to get what you’re after with this approach.

alright. yes, bitten by that again, ok. I’m done, and thanks for the reply!

1 Like