Rain mode and using functions

Are using functions incompatible with rain mode?

I tried building a blade style in Fett’s style library with rain mode as a using function. But if I set any special ability as rain or rain and thunder mode toggle and copy that style as a using function into the config helper, I get the following error message:

“Only letters, numbers or underscore ‘_’ can be used. No spaces or special characters.”

Also, the style cannot be previewed in the config helper. The blade won’t light up.

Here is a simple example of a using function style that causes the error:

/*--------------------------------- RAINTEST -------------------------
copyright Fett263 Rotoscope (Primary Blade) OS7 Style
https://www.fett263.com/fett263-proffieOS7-style-library.html#Rotoscope
OS7.15 v3.215p
This Style Contains 2 Unique Combinations
Style Options:
Default (0): Hyper Responsive Rotoscope (Original Trilogy)
1: Rotoscope (Subtle)


NOTE:This style includes Control Layer. Only one Control Layer should be used per preset.

--Effects Included--
Ignition Effect: Standard Ignition [Color: IgnitionColorArg]
Retraction Effect: Standard Retraction [Color: RetractionColorArg]
Lockup Effect:
0: mainLockMulti0Shape - Begin: Real Clash - Style: Intensity AudioFlicker - End: Full Blade Absorb
[Color: LockupColorArg]
Lightning Block Effect:
0: mainLBMulti0Shape - Begin: Responsive Impact - Style: Strobing AudioFlicker - End: Full Blade Absorb
[Color: LBColorArg]
Drag Effect:
0: mainDragMulti0Shape - Begin: Wipe In - Style: Intensity Sparking Drag - End: Wipe Out
[Color: DragColorArg]
Melt Effect:
0: mainMeltMulti0Shape - Begin: Wipe In - Style: Intensity Melt - End: Wipe Out
[Color: StabColorArg]
Blast Effect: Blast Wave (Random) [Color: BlastColorArg]
Clash Effect: Real Clash V1 [Color: ClashColorArg]
Special Ability 1: Toggle Rain and Lightning Mode Uses trloop00.wav or trloop/000/000.wav (rain sounds looped) and tr00.wav or tr/000/000.wav (thunder or lightning strike)

*/
using RAINTEST = Layers<ColorSelect<IntArg<STYLE_OPTION_ARG,0>,TrInstant,Mix<HoldPeakF<SwingSpeed<250>,Scale<SwingAcceleration<100>,Int<50>,Int<500>>,Scale<SwingAcceleration<>,Int<20000>,Int<10000>>>,RandomFlicker<StripesX<Int<15000>,Scale<HoldPeakF<SwingSpeed<200>,Scale<SwingAcceleration<100>,Int<50>,Int<300>>,Scale<SwingAcceleration<100>,Int<24000>,Int<16000>>>,Int<-3200>,Int<-200>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>,Mix<Int<7710>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>,Mix<Int<19276>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>>,Mix<Sin<Int<16>,Int<32768>,Int<18000>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>,Stripes<12000,-200,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>,Mix<Int<20000>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>,Mix<Int<16448>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,255>>>>>>,ColorSelect<EffectIncrementF<EFFECT_USER1,Int<2>>,TrFade<100>,AlphaL<White,Int<0>>,AlphaL<RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>,SparkleF<300,800>>>,ColorSelect<EffectIncrementF<EFFECT_USER1,Int<2>>,TrFade<100>,AlphaL<RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>,Int<0>>,TransitionLoopL<TrConcat<TrDelayX<Scale<SlowNoise<Int<100>>,Int<1000>,Int<4500>>>,AlphaL<RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>,Int<0>>,TrSelect<EffectIncrementF<EFFECT_USER1,Int<2>>,TrInstant,TrConcat<TrDoEffect<TrInstant,EFFECT_TRANSITION_SOUND,0>,BrownNoiseFlickerL<RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>,Int<200>>,TrRandom<TrBoingX<WavLen<EFFECT_TRANSITION_SOUND>,2>,TrBoingX<WavLen<EFFECT_TRANSITION_SOUND>,3>,TrBoingX<WavLen<EFFECT_TRANSITION_SOUND>,4>>>>>>>,TransitionEffectL<TrDoEffect<TrInstant,EFFECT_SOUND_LOOP,0>,EFFECT_USER1>,TransitionEffectL<TrWaveX<RgbArg<BLAST_COLOR_ARG,Rgb<255,255,255>>,Scale<EffectRandomF<EFFECT_BLAST>,Int<100>,Int<400>>,Int<100>,Scale<EffectPosition<EFFECT_BLAST>,Int<100>,Int<400>>,Scale<EffectPosition<EFFECT_BLAST>,Int<28000>,Int<8000>>>,EFFECT_BLAST>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,TransitionEffectL<TrConcat<TrInstant,AlphaL<RgbArg<CLASH_COLOR_ARG,Rgb<255,255,255>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<ClashImpactF<>,Int<12000>,Int<60000>>>>,TrFadeX<Scale<ClashImpactF<>,Int<200>,Int<400>>>>,EFFECT_CLASH>,TransitionEffectL<TrWaveX<RgbArg<CLASH_COLOR_ARG,Rgb<255,255,255>>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Int<100>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>>,EFFECT_CLASH>>,LockupTrL<TransitionEffect<AlphaL<AlphaMixL<Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<22000>>>,AudioFlicker<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<12000>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>>,BrownNoiseFlicker<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<12000>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>,300>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<22000>>>>,AlphaL<AudioFlicker<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<20000>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>>,TrExtend<5000,TrInstant>,TrFade<5000>,EFFECT_LOCKUP_BEGIN>,TrConcat<TrJoin<TrDelay<50>,TrInstant>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<ClashImpactF<>,Int<20000>,Int<60000>>>>>,TrFade<300>>,TrConcat<TrInstant,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,TrFade<400>>,SaberBase::LOCKUP_NORMAL,Int<1>>,ResponsiveLightningBlockL<Strobe<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,AudioFlicker<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Blue>,50,1>,TrConcat<TrExtend<200,TrInstant>,AlphaL<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Bump<Scale<BladeAngle<>,Int<10000>,Int<21000>>,Int<10000>>>,TrFade<200>>,TrConcat<TrInstant,RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,TrFade<400>>,Int<1>>,LockupTrL<AlphaL<TransitionEffect<RandomPerLEDFlickerL<RgbArg<DRAG_COLOR_ARG,Rgb<255,255,255>>>,BrownNoiseFlickerL<RgbArg<DRAG_COLOR_ARG,Rgb<255,255,255>>,Int<300>>,TrExtend<4000,TrInstant>,TrFade<4000>,EFFECT_DRAG_BEGIN>,SmoothStep<Scale<TwistAngle<>,IntArg<DRAG_SIZE_ARG,28000>,Int<30000>>,Int<3000>>>,TrWipeIn<200>,TrWipe<200>,SaberBase::LOCKUP_DRAG,Int<1>>,LockupTrL<AlphaL<Stripes<2000,4000,Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>>>,Mix<Sin<Int<50>>,Black,Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>>>>,Mix<Int<4096>,Black,Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>>>>>,SmoothStep<Scale<TwistAngle<>,IntArg<MELT_SIZE_ARG,28000>,Int<30000>>,Int<3000>>>,TrConcat<TrExtend<4000,TrWipeIn<200>>,AlphaL<HumpFlicker<Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>>>,RotateColorsX<Int<3000>,Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,68,0>>>>>,100>,SmoothStep<Scale<TwistAngle<>,IntArg<MELT_SIZE_ARG,28000>,Int<30000>>,Int<3000>>>,TrFade<4000>>,TrWipe<200>,SaberBase::LOCKUP_MELT,Int<1>>,InOutTrL<TrWipeX<BendTimePowInvX<IgnitionTime<300>,Mult<IntArg<IGNITION_OPTION2_ARG,10992>,Int<98304>>>>,TrWipeInX<BendTimePowX<RetractionTime<0>,Mult<IntArg<RETRACTION_OPTION2_ARG,10992>,Int<98304>>>>,Black>>;
/*
Add to preset as StylePtr<RAINTEST>()
--------------------------------------------------------------------------*/

It doesn’t look super rainy (It’s likely this is just a quirk of the Style Editor), but the style is fine:

And it compiles fine for me in this simple config:

my_saber2.h (11.6 KB)

I guess whatever issue you’re seeing is something specific to @Fett263’s tooling, hopefully he’ll see this soon and can help.

I don’t use Fett’s config helper, but for general knowledge:
Type aliases (using Name = ...) don’t change the code at all, so unless you make an unrelated syntax error, if the style works, it’ll work in an alias just fine, which is why I only bother checking that the style is alright here.

I’ll try to take a look at the tool this weekend, it may just be a character it doesn’t like.

Thanks, guys. Your support is highly appreciated, as always.

Some additional info: If I ignore the error and generate a full config, it get the following error messages in Arduino:

Arduino: 1.8.3 (Windows 10), Board: "Proffieboard V3, Serial + WebUSB, SDCARD (SDIO High Speed), 80 MHz, half, Smallest Code"

In file included from D:\LS\Proffie\ProffieOS\ProffieOS.ino:621:
sketch\config/Config_Kestis_Shoto_V1.h:47:7: error: expected ';' before 'presets'
   47 | Preset presets[] = {
      |       ^~~~~~~~
      |       ;
In file included from D:\LS\Proffie\ProffieOS\ProffieOS.ino:591:
sketch\config/Config_Kestis_Shoto_V1.h:545:17: error: 'presets' was not declared in this scope; did you mean 'Preset'?
  545 |   , CONFIGARRAY(presets) },
      |                 ^~~~~~~
sketch\common/preset.h:6:24: note: in definition of macro 'CONFIGARRAY'
    6 | #define CONFIGARRAY(X) X, NELEM(X)
      |                        ^
In file included from D:\LS\Proffie\ProffieOS\ProffieOS.ino:240:
sketch\config/Config_Kestis_Shoto_V1.h:545:17: error: 'presets' was not declared in this scope; did you mean 'Preset'?
  545 |   , CONFIGARRAY(presets) },
      |                 ^~~~~~~
sketch\common/common.h:18:26: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                          ^
sketch\config/Config_Kestis_Shoto_V1.h:545:5: note: in expansion of macro 'CONFIGARRAY'
  545 |   , CONFIGARRAY(presets) },
      |     ^~~~~~~~~~~
sketch\config/Config_Kestis_Shoto_V1.h:545:17: error: 'presets' was not declared in this scope; did you mean 'Preset'?
  545 |   , CONFIGARRAY(presets) },
      |                 ^~~~~~~
sketch\common/common.h:18:37: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                                     ^
sketch\config/Config_Kestis_Shoto_V1.h:545:5: note: in expansion of macro 'CONFIGARRAY'
  545 |   , CONFIGARRAY(presets) },
      |     ^~~~~~~~~~~
exit status 1
Error compiling for board Proffieboard V3.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

When compiling the same config without that specific using function, it works just fine.

Assuming you tried to generate the config in my Config Helper and ignored the error message then it’s expected the config will be incomplete, that’s why the tool generated the error message. It’s trying to resolve issues before you compile.

I haven’t had a chance to look yet, but see if the library’s style code has the word “using” in the comments section. The tool looks for this word to parse the Using function’s name, if there’s an instance in the comments section you can manually just change it to “uses” before pasting in the tool and it should bypass the error, if not then something else is causing it.

I’m hoping to get some time to look into it later today but the family has me tied up for a bit.

I’ll give it a try. And yes, I did use your config helper. I tried using parameters that should fit the using function, but yeah, the compiling errors are probably just a follow-up issue. I thought the additional info might help.

I found the issue and I pushed a fix up. You’ll need to refresh the page to get updated script. It should work correctly for the using functions with Special Abilities from the library now.

Config helper works like a charm , and no errors while compiling either. Thanks!

You’re welcome, glad to hear.

This error probably means that whatever is before line 47 is not terminated properly.
(Unbalanced < > or { }, or missing ; at the end.)

Yeah, when my config tool runs into an error it doesn’t complete that portion of the config, so in this case the using function was incomplete because it thought the name had an invalid character. Once I fixed the script it was able to complete the config correctly.