Special Ability Toggle sound?

So, I’ve been playing around with special abilities, and also created a few that toggle various alternate effects on/off via special ability 1-4. However, I find it difficult to tell if some of them are on or off. I also find the controls a little hard to toggle, I often accidentally turn on RAIN, and I have trouble sometimes turning it OFF.

I currently have:

USER1: Lockup Selection: 0 = Normal, 1 = Clash/Lockup Shield Toggle (DUNE Shield), 2 = Dual Lockup (Two Independent Lockup Humps)
USER2: 
USER3: Force Lightning Toggle (Replaces Lightning Block) 0 = Lightning Block, 1 = Force Lightning.
USER4: Rain Toggle (Off Color) 0 = Off, 1 = On.

I’ve been digging around in TrDoEffect, and am wondering if there’s a way to simply trigger a single sound effect, preferably, and if not, a simple one time Effect like a flash, when ever a EFFECT_USER# is triggered? That will help me (and other users) tell if I tripped the control or not…

The closest thing I’ve found in existing code samples I have is this, but I think this is a toggled looping sound.

TransitionEffectL<
	TrDoEffect<
		TrInstant,
		EFFECT_SOUND_LOOP,
		0
	>,
	EFFECT_USER4
>

No idea what any of that means, Special Abilities are best set up in the library as it handles the code and the corresponding set up for the sounds, it’s more complex than just building an effect and you can’t layer or mix or you’ll create conflicts. The library has a lot of code and logic in place to handle correctly.

There is currently no way to directly trigger a sound effect from style code.
As you point out, TrDoEffect<> is probably what you want, but normally that will require some code somewhere to trigger the actual sound effect.

Interestingly I’ve recently found a way to make strings into templates, so something that directly plays a wav file could be possible, although I’m not sure that’s actually a good idea, as it sort of breaks what styles are supposed to do.

Maybe what we need is “sound styles”.

EFFECT_TRANSITION_SOUND and EFFECT_SOUND_LOOP actually do this already via my prop and Special Abilities BUT you need to keep track of the sounds used and you can’t mix control layers that trigger the effects. I believe he’s trying to combine concepts from the library that can’t be used together because of how they work. The library has several functions built into it to ensure there are no conflicts or doubled controls for these effects, trying to combine different effects outside of the library loses the checks that are in place.

Yes, I’m trying to code it myself though. I would have to be careful not to have duplicate controls activating the sound(s) at the same time. That’s what testing is for, also how I learn :slight_smile:

But yeah, I wish there was some way to tell if / when i toggle a special ability, as i’m having trouble. My saber has 1 button controls, so i hold power and quickly twist the hilt 1/4th the way left, or right, and nothing happens most of the time. The Controls page just says “Hold PWR + turn right”, for instance, but it doesn’t say how long to hold power, or how far to turn it, and so far I haven’t figured out the timing / twist angle for it. Is it a quick twist, or a slow twist?

It took me months to develop, test and write the code that enables and checks the set up these features in the library. It is your best source for these abilities and ensuring they work correctly and as intended…

It’s a TURN right or left, roughly a 1/4 to 1/3 turn of the hilt. It’s a change in angle of rotation of the hilt, not speed. Hold the button down and turn the hilt like a dial in one direction about 1/4 turn.

Pointing up or parallel is one control, pointing down is another with 1 button.

And release power after 1/4th turn?

Release after the effect triggers, not before. “HOLD” means hold down until effect occurs. Releasing before turn direction is detected will not trigger the effect.

Yea. I have these setup to trigger alternate effects for things like LOCKUP and LIGHTNING BLOCK, so it’s not immediately obvious if it’s ON or OFF, until I toggle the appropriate effect after toggling the corresponding Special Ability switch. As I’m coding things myself, i’m probably finding new and creative ways to use these things :smiley:

Ok, after some more fiddling, I am up to around 50% success rate at toggling the special abilities. Still want to code some kind of effect on activation, maybe a simple 1 time flash transition, or emitter flare, hmm…

These are “states” not effects, you’d have to modify the prop to change how these are controlled.

Here’s my Lockup code, for example. It uses Special Ability 1 to cycle between 3 “options”. Note, these are using style functions, so the actual visual styles are just the names of the using functions, that code is elsewhere in my style, but this shows how i’m using the special abilities to “choose” which code path to follow.

// Lockup
	LockupTrL<
		// Lockup Effect
		ColorSelect<
			EffectIncrementF<
				EFFECT_USER1,
				Int<3>
			>,
			TrInstant,
			// Normal Lockup, pick a random effect
			EffectSequence<
				EFFECT_LOCKUP_BEGIN,
				// Intensity Lockup
				Lockup_Color_Intensity,
				// Localized AudioFlicker
				Lockup_Color_Localized_Flicker,
				// Full Blade AudioFlicker
				Lockup_Color_Full_Flicker,
				// Original old Lockup, moves on it's own...
				Lockup_Color_Cylon
			>,
			// Dune Shield Lockup
			Lockup_Color_Shield,
			// Dial Mode Lockup using USER1 Special Ability
			Lockup_Color_Dual
		>,
		// EFFECT_LOCKUP_BEGIN
		TrSelect<
			// look for DUNE Shield using USER1 Special Ability
			EffectIncrementF<
				EFFECT_USER1,
				Int<2>
			>,
			// Normal Lockup, pick a random effect
			TrRandom< //TrSequence<
				// Real Clash v1
				Lockup_Start_RealClash,
				// Localized Flicker
				Lockup_Start_Localized,
				// Localized Flash/Fade
				Lockup_Start_Localized_Flash,
				// Full blade Flash/Fade
				Lockup_Start_Full_Flash
			>,
			// Dune Shield Lockup
			Lockup_Start_Shield
		>,
		// EFFECT_LOCKUP_END
		TrSelect<
			// look for DUNE Shield using USER1 Special Ability
			EffectIncrementF<
				EFFECT_USER1,
				Int<2>
			>,
			// Normal Lockup, pick a random effect
			TrRandom< //TrSequence<
				// Real Clash Intensity
				Lockup_End_Intensity,
				// Power Burst Wave release
				Lockup_End_Power_Burst,
				// Localized Absorb Flash
				Lockup_End_Localized_Absorb,
				// Full blade flash
				Lockup_End_Full_Absorb
			>,
			// Dune Shield Lockup
			Lockup_End_Shield
		>,
		SaberBase::LOCKUP_NORMAL
	>,

I’m basically using the special abilities to toggle specific behavior on command, like toggling Blaster mode on or off, switching Lightning Block from the normal “blocking lightning” to the force lightning “shooting lightning” effect. (so in a duel, one person can switch to shooting lightning, and another blocks it)

Not really following and I don’t understand your using functions. I think you’re making things harder and more complicated than they need to be. Just use EffectSequence<> to change the effects you want to use, that’s what it’s built to do :wink:

Using the EFFECT_USER effects as a trigger is fine but keep in mind you’re cannibalizing effects that my prop and library use for different purposes so you won’t be able to use the abilities generated by the library as you’re building potential conflicts in that my library can’t account for.

This is all part of one blade style, so it won’t conflict with other blade styles, it’s just very large and full of various options.

EffectSequence goes in order, right? So, each time Effect_BLAH triggersr, it goes in the same order and loops back around, which is not a way to control something.

This initially started as a way to activate DUAL LOCKUP mode (for choreography dueling against someone using two sabers). I needed a way to, on demand, switch between Dual lockup effect, and normal Lockup effect. So, yea, special ability toggle is where it went.

Then I went and added your DUNE shield style as another option. Turn your shield on or off :smiley: Now i’m just exploring the aspect of toggling sounds with them, or what else I can use them for.

If you set two options, EffectSequence<> becomes a toggle.

I’d say start small, get something working, take another small step, rinse and repeat.

That’s what I’m doing.

Also, with two options set, Normal Lockup, and Dual Lockup, what happens when you want to do in a battle: Normal Lockup, Normal Lockup, Dual Lockup?

I meant use the EFFECT_USER in EffectSequence<> for the lockups prior to doing the effect.

EffectSequence<EFFECT_USER1, A, B>

Put that inside the lockup, then do Special Ability 1 to change before you do lockup, etc.

Then it just toggles back and forth :wink:

Just note it may conflict with the library Special Abilities.

Hm, yea that is simpler.

What about the start/end transitions? is there a Tr version of EffectSequence?

Just wrap the EffectSequence around the entire lockup layer then :wink:

hm, so that would be:

EffectSequence<
   EFFECT_USER1,
   LockupTrl<
        // Style code when not enabled here
       SaberBase::LOCKUP_NORMAL
   >,
   LockupTrl<
        // Style code when enabled here
       SaberBase::LOCKUP_NORMAL
   >,
>

right?

Looks right