Author Topic: Commands (audio) ignoring 'wait until completed'  (Read 6304 times)

Assimilator1

  • Newbie
  • *
  • Posts: 22
Commands (audio) ignoring 'wait until completed'
« on: July 29, 2017, 02:07:41 PM »
Ok so I've just updated HCS Minus from v1.? to v2.4, I had some custom commands which I imported, and that's where the problems started :(, damn HCS had changed some audio file names (sometimes by just 1 letter!! why HCS??) although some hadn't changed & they still didn't work!

Anyway I've been able to redirect the commands to the newly named files (including the one's with the same name), & that works.
But theirs something different about how VA handles audio files now (like the new instruction 'Execute by name'), anyway in 1 custom command I have, there are 2 audio commands, 1 following the other, or at least it's supposed to, but it doesn't despite 'wait until this command completes' being ticked!
They both play at the same time, & I just can't suss why! Anyone any ideas? (I did Google it btw & no joy).
Oh, I don't want to insert a pause as that would delay key presses for ship controls.

This is what I had for the old HCS & it worked fine [edit] actually, what the..... the 2nd sound isn't even a sound (power to engines).... so what's playing twice in HCS v2.4?.....brb

Command order - Keep boosting/Maintain boost

Execute command, '((RS- Afterburners))' (and wait until it completes)
Press Tab key and hold for 0.1 seconds and release
Execute command, '((Power To Engines))' (and wait until it completes)
Pause 4.8 seconds
Press Tab key and hold for 0.1 seconds and release
Pause 6 seconds
Press Tab key and hold for 0.1 seconds and release
Pause 6.5 seconds
Press Tab key and hold for 0.1 seconds and release
Pause 8 seconds
Press Tab key and hold for 0.1 seconds and release
Pause 8 seconds
Play sound, '{VA_SOUNDS}\hcspack-MINUS\Acknowledgements\Completed.wav'

TIA
Mark
« Last Edit: July 29, 2017, 02:20:19 PM by Assimilator1 »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Commands (audio) ignoring 'wait until completed'
« Reply #1 on: July 29, 2017, 02:20:42 PM »
You have to check the, 'wait until sound completes before continuing command' box for a sound to be waited on.  Otherwise, it's fire and forget...  the command continues on separately.

Assimilator1

  • Newbie
  • *
  • Posts: 22
Re: Commands (audio) ignoring 'wait until completed'
« Reply #2 on: July 29, 2017, 02:33:49 PM »
As I said, I've already done that ;) [edit] wait a sec, you said 'until sound completes', all I see in the command edit is 'wait until this command completes', nothing about sound, so where's that? In the ((RS xxx)) command itself?[edit 2] I see it is, but....
Trouble is, I only want other sound commands to wait, I don't want to hold up control key presses.......

Right, I've jiggled the newer command around a bit, it has 3 audio file commands (which is what I thought the original had), as you can see the 1st 2 have wait until completed enabled, but they play over each other.

Press Tab key and hold for 0.1 seconds and release
Execute command, '((Power To Engines))'
Execute command, '((RS - Afterburner))' (and wait until it completes)
Execute command, '((RS - Power Engines))' (and wait until it completes)
Pause 4.8 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 6 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 6.5 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 8 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 8 seconds
Play sound, '{VA_SOUNDS}\hcspack-MINUS\Acknowledgements\Completed.wav'

****************
(Pauses disabled for testing)

I still don't get why the '(and wait until it completes)' doesn't work. Does it in this case mean, wait until the instruction for this command is complete (ie sent), rather than the carrying out of the whole task (playing the audio file)? 

Well, I've got around it with this for now, it would still be nice to know why the above 1 didn't work though :)

Press Tab key and hold for 0.1 seconds and release
Execute command, '((Power To Engines))'
Execute command, '((RS - Afterburner))' (and wait until it completes)
Pause 1.4 seconds
Execute command, '((RS - Power Engines))' (and wait until it completes)
Pause 3.4 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 6 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 6.5 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 8 seconds
Press Tab key and hold for 0.1 seconds and release
DISABLED - Pause 8 seconds
Play sound, '{VA_SOUNDS}\hcspack-MINUS\Acknowledgements\Completed.wav'
« Last Edit: July 29, 2017, 03:01:58 PM by Assimilator1 »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Commands (audio) ignoring 'wait until completed'
« Reply #3 on: July 29, 2017, 03:04:14 PM »
If a 'play a sound' action is indicated as, 'wait until it completes', the command will not execute the next line until the sound is done playing.  That is, the command just sits and waits, no matter how long the sound is.  Once the sound is finished, the command is allowed to go to the next line (play the next sound, for instance).

If a 'play a sound' action is NOT indicated as, 'wait until it completes', the command will play the sound and immediately go on to the next line.  The command will exit when all the lines are completed whether or not the sound is still playing.  The sound is played asynchronously...  that is, the sound is off on its own, playing until it stops or is stopped (disconnected from the command that played it).


Assimilator1

  • Newbie
  • *
  • Posts: 22
Re: Commands (audio) ignoring 'wait until completed'
« Reply #4 on: July 29, 2017, 03:15:36 PM »
But this is what I'm saying the problem is, the command is executing the next line even with 'wait until it completes' ticked, at least with sounds.

As per these commands in my previous post:-

Press Tab key and hold for 0.1 seconds and release
Execute command, '((Power To Engines))'
Execute command, '((RS - Afterburner))' (and wait until it completes)
Execute command, '((RS - Power Engines))' (and wait until it completes)
etc

Those last 2 sounds play over each other, & you can see the wait command has been enabled (unnecessary for the 2nd 1, but hey ;) ) .
I'm going to create a test command to see if it does it with that, or whether it's just an oddity with that 1.......

[update] created the following, Sound test :-

Execute command, '((RS - Afterburner))' (and wait until it completes)
Execute command, '((RS - Power Engines))'

And yep, the sounds play together, is this a VA bug or HCS?

Another 1, Sound test 2:-

Execute command, '((RS - 50%))' (and wait until it completes)
Execute command, '((RS - 100%))' (and wait until it completes)

Same result, they play over each other......
I have v1.6.7 of VA btw, v2.4 of HCS Minus, Win 7 64bit.
« Last Edit: July 29, 2017, 03:31:49 PM by Assimilator1 »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Commands (audio) ignoring 'wait until completed'
« Reply #5 on: July 29, 2017, 04:36:30 PM »
Not able to reproduce this on my end.  I have three commands,  'sound test', 'sound 1' and 'sound 2'.  All three commands are set to, 'allow others to execute' (although I did try without, 'allow others to execute').


sound 1 (voice disabled)
---------------------------
Play sound, 'D:\Data\SAMPLES\WAVS\BMA.WAV'  (and wait until it completes)   <----note the sound has wait until complete


sound 2 (voice disabled)
---------------------------
Play sound, 'D:\Data\SAMPLES\WAVS\BACON.WAV'  (and wait until it completes)



sound test
---------------------------
Execute command, 'sound 1' (and wait until it completes)
Execute command, 'sound 2'


You may want to export your profile with just the affected commands if what is above isn't helping.


Assimilator1

  • Newbie
  • *
  • Posts: 22
Re: Commands (audio) ignoring 'wait until completed'
« Reply #6 on: July 29, 2017, 04:47:09 PM »
I see you're pointing the commands directly to the sound files [edit] doh! no you're not, I missed a line!, whereas mine were pointing to another command which is then selecting (randomly, hence RS) from a list of audio files.

I'll see if it does it with direct links....

Thanks for your time so far btw :)

Yeah directly linking to the sound files works fine :-
Play sound, '{VA_SOUNDS}\hcspack-MINUS\Weapons\Weapons Battle\Arming weapons.wav'  (and wait until it completes)
Play sound, '{VA_SOUNDS}\hcspack-MINUS\Weapons\Weapons Battle\Incoming missile.wav'

What happens if you untick 'wait until it completes' in your Sound 1 & 2 commands, but leave it ticked for the 'sound test', do they still play sequentially?

Maybe it's to do with playing 2 RS (Random sounds) in row? Or just RSs?
« Last Edit: July 29, 2017, 05:09:14 PM by Assimilator1 »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Commands (audio) ignoring 'wait until completed'
« Reply #7 on: July 29, 2017, 05:16:13 PM »
If I do this:

sound 1 (voice disabled)
---------------------------
Play sound, 'D:\Data\SAMPLES\WAVS\BMA.WAV'   <----REMOVED wait until complete


sound 2 (voice disabled)
---------------------------
Play sound, 'D:\Data\SAMPLES\WAVS\BACON.WAV'   <----REMOVED wait until complete



sound test
---------------------------
Execute command, 'sound 1' (and wait until it completes)   <----keep this the way it is
Execute command, 'sound 2'


The sounds play at the same time.  This is expected and by design.



Also:

sound 1 (voice disabled)
---------------------------
Play sound, 'D:\Data\SAMPLES\WAVS\BMA.WAV'  (and wait until it completes)   <----note the sound has wait until complete (unchanged)


sound 2 (voice disabled)
---------------------------
Play sound, 'D:\Data\SAMPLES\WAVS\BACON.WAV'  (and wait until it completes)(unchanged)



sound test
---------------------------
Execute command, 'sound 1' <---removed wait
Execute command, 'sound 2'

Plays both sounds at the same time, which is expected and by design.


What you need to wrap your head around is the idea that sounds play asynchronously in VA as a rule.  The exception to that rule is when the command is explicitly told not to continue until the sound action completes.  That means WITHIN the calling command, and not any other command.  There is no global, 'wait until sound completes'.  The only global sound, 'option' is to stop all other sounds from playing when a sound is played ('this completes all other currently playing sounds').



Assimilator1

  • Newbie
  • *
  • Posts: 22
Re: Commands (audio) ignoring 'wait until completed'
« Reply #8 on: July 29, 2017, 05:47:01 PM »
Ah ok, we're making headway now :), so in your 2nd scenario that makes sense, the latter Sound test command with the 'wait' removed, overrides the 'wait' in the direct link to the sound files.

But the 1st scenario doesn't make sense, although that is the problem I was having!
Why would the last command in 'the chain' not override the earlier?? ???, especially when it does the other way around. Also why have a box to tick to enable 'wait until it completes', only it doesn't! ;)
If it did allow it to override to 'enforce' waiting just for that command, it would allow us some to give delays for that particular sound for that particular command & not globally. Extra flexibility :).

Btw I don't know what you mean by a 'calling command'.
« Last Edit: July 30, 2017, 08:55:13 AM by Assimilator1 »

J. Calvert (Joshua)

  • Newbie
  • *
  • Posts: 30
Re: Commands (audio) ignoring 'wait until completed'
« Reply #9 on: July 29, 2017, 07:34:22 PM »
Yeah directly linking to the sound files works fine :-
Play sound, '{VA_SOUNDS}\hcspack-MINUS\Weapons\Weapons Battle\Arming weapons.wav'  (and wait until it completes)
Play sound, '{VA_SOUNDS}\hcspack-MINUS\Weapons\Weapons Battle\Incoming missile.wav'

What happens if you untick 'wait until it completes' in your Sound 1 & 2 commands, but leave it ticked for the 'sound test', do they still play sequentially?

Maybe it's to do with playing 2 RS (Random sounds) in row? Or just RSs?

In the RS command like ((RS 50%) did you check the "wait until sound completes" in all the sounds in the list of random sounds ?

When you use the Play a sound action the "wait until sounds completes" is visible right away even before choosing a sound file but if you use the Play a random sound action (like in ((RS 50%) it has to be set in all the sound files you choose soi if it has two soundfiles in the list you have to check it for the two soundfiles separately. And to see if the option is set or not you have to go to the selection screen of the two soundfiles in the list because it doesn't show in the command list like it does when you use Play a sound for a single sound.

Assimilator1

  • Newbie
  • *
  • Posts: 22
Re: Commands (audio) ignoring 'wait until completed'
« Reply #10 on: July 29, 2017, 08:27:00 PM »
Yea roger that, I've come across it, I don't want to enable that setting as I don't want control commands held up (on a global basis), hence enabling it on the RS commands, which doesn't work I've discovered today :(.
Oh well, thanks anyway.