Party Saber Colour Wrapping?

Slightly unusual one - I have a relatively simple blade style intended to achieve the Kestis colour changing effect using the EFFECT_USERx feature. Effect user is linked in the prop to a swing/button press combination.

It works great to achieve the colour changes, however when it gets to the last colour, that’s it - it doesn’t wrap back to the first colour on the next swing. The only way to reset it is by switching away from that font and then back to it.

It’s not a deal-breaker, but I guess my question is, can it be set to wrap back to the start, and if so, where would that get done - in the prop or in the bladestyle, or somewhere else in the OS?

Thanks in advance. Relevant code extracts below:

Prop file:

    case EVENTID(BUTTON_NONE, EVENT_SWING, MODE_ON | BUTTON_POWER):
      SaberBase::DoEffect(EFFECT_USER1, 0);
      return true;

Blade style:

StylePtr<Layers<
  Layers<
    ColorSelect<AltF,TrFade<300>,Green,Rgb<147,0,255>,Yellow,Cyan,Magenta,Orange,Azure,Red,Rgb<128,0,128>,DeepSkyBlue>,
    ColorSelect<AltF,TrFade<300>,RandomL<Rgb<0,125,0>>,RandomL<Rgb<70,0,125>>,RandomL<Rgb<125,125,0>>,RandomL<Rgb<0,125,125>>,RandomL<Rgb<125,0,125>>,RandomL<Rgb<125,49,0>>,RandomL<Rgb<110,125,125>>,RandomL<Rgb<125,0,0>>,RandomL<Rgb<64,0,64>>,RandomL<Rgb<0,75,125>>>,
    TransitionEffectL<TrDoEffectX<TrInstant,EFFECT_ALT_SOUND,ModF<Sum<AltF,Int<1>>,Int<10>>>,EFFECT_USER1>,
    OriginalBlastL<White>,
    LockupL<Strobe<Azure,Black,20,16>,Strobe<White,Black,20,16>>,
    ResponsiveMeltL<Mix<TwistAngle<>,Red,Yellow>,TrInstant,TrInstant>,
    SimpleClashL<Strobe<White,Black,28,25>,260>,
    InOutTrL<TrWipe<500>,TrWipeInX<WavLen<EFFECT_RETRACTION>>>,
    TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>>(),

Do you have /alt010 in your font? Your ModF<> is expecting it before it wraps to 0.

FWIW, you could just build the Party Mode recipe in my library and set Special Ability 1 to “Toggle Swing Change” and it would handle for you.

I just did some more work on this, and that was indeed part of it - my alt files only went up to /alt008.
I’d also missed out the ModF bits on the colour sequences, so this:
ColorSelect<AltF,TrFade<300>
needed to be this:
ColorSelect<ModF<AltF,Int<10>>,TrFade<300>

Now sorted and wrapping nicely. :slight_smile:
Thanks as always. :slight_smile:

That shouldn’t matter, the OS automatically restricts AltF to the existing altNNN folders found in the font. The reason you need ModF<> in the TrDoEffect<> is because it’s a Sum<>.

1 Like