Closed Alexustas closed 8 years ago
I decided to completely remake "TabloIndicator" prop using "JSICallbackAnimator" and "JSILabel", but because of the inability to play the sounds have to add another "JSIVariableAnimator" module, just for sound
Okay.
and one more addition)) Is it difficult to add a flashing indicator option?
Flashing is hard by itself. JSICallbackAnimator does not use Update or FixedUpdate. which is where I implement flashing. But CUSTOM_ can do that (use AND with variable and PERIOD_xHZ).
Yes, I thought about it. but in this case every time the indicator is triggered will also play the sound
That is true. Let me figure it out. Audio might also be tricky if it also needs updates.
as a variant, I can make two CUSTOM variables. in one variable I add " PERIOD" so that it will create a flashing, and the second only beeps (another callback module). but how much it can affect performance?
I made some very big changes for performance. Two variables will be a tiny amount more expensive.
Let me do some research first to see if I can find a way to make flashing work. There has to be some way without using Update (and if there is, maybe I can use it for regular JSIVariableAnimator, too).
OK. I have no doubt that you will find the solution )
I will find the solution. The question is what feature will I break by accident with the solution? )
Flashing was easy, but you can only have one flash rate for each JSICallbackAnimator (not one per variable set). Each variable set can choose to flash or not flash, so you can have some variable set that flash, and some that do not, in the same callback animator.
Now to work on audio.
Same as JSIVariableAnimator, but:
flashRate
is part of JSICallbackAnimator:
MODULE
{
name = JSICallbackAnimator
variableName = CUSTOM_ALCOR_BACKLIGHT_ON
flashRate = 1.0
and each VARIABLESET
has to have flash = true
for it to flash, or else it ignores the flashRate:
VARIABLESET
{
coloredObject = LabelObj
passiveColor = 0,0,0,255
activeColor = COLOR_MOARdV_BacklightColor
scale = 0.5,1.1
flash = true
Audio works the same as JSIVariableAnimator, and I think I have it working correctly even when changing camera from IVA to Flight without using OnUpdate.
OU! it's amazing! thank you very much!!
You're welcome! I'm glad it's working (so far). It was not as hard as I thought.
Now I need to go change a lot of props from JSIVariableAnimator to JSICallbackAnimator. ))
I redid almost all of my props, and most of them two or three times.))) but it's worth it
I'm glad it's working (so far)
"flash" working, I've test it already.
but I can not yet verify the audio, because I do not get what kind of syntax I need to use
Example syntax (I tested it on a backlight of a prop I already had):
VARIABLESET
{
coloredObject = LabelObj
passiveColor = 0,0,0,255
activeColor = COLOR_MOARdV_BacklightColor
scale = 0.5,1.1
alarmSound = ASET/ASET_Props/Sounds/beep-04
alarmSoundVolume = 0.5
}
Other options, same as JSIVariableAnimator - untested, but the code is the same as JSIVariableAnimator, so it should work:
alarmMustPlayOnce
- boolean must allow sound to finish playing (untested, but should work)alarmShutdownButton
- collider to stop sound (untested, but should work)alarmSoundLooping
- boolean sound loops while active (untested, but should work)I will update the wiki, probably tomorrow. since this evening will be busy for me.
EDIT: And yes, multiple sounds can be on the same prop using different VARIABLESET.
so it should work:
and it works fine! once again thank you very much!
it will be just great if we get a sound options that we already have in the "JSIVariableAnimator" module