Author Topic: correct additional random hal hapswap command script needed  (Read 2637 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
correct additional random hal hapswap command script needed
« on: September 26, 2011, 02:58:42 pm »
i wanted to ask oncutting edge or someone that does code scripting what the correct way would be to write an additional random playing ogg files command.

example i have :

HalCommands = "<HAPFILE>blowingnose.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


this is at the end of a random saying file triggered by certain words (not shown)

what i am wondering is how can the above (highlighted in blue ) command be made to allow random ogg sounds so that i can put different blowing nose sounds so it isn't the same nose blowing sound each time,


any help on this would be appreciated i am trying to work more on the hapswap files i started .  :)
 

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
Re: correct additional random hal hapswap command script needed
« Reply #1 on: October 17, 2011, 07:00:47 pm »
You could simply append a number to the end of the file name (ie. blowingnose1.ogg, blowingnose2.ogg, etc.), generate a random number in your script, and have Hal run that random file (making sure not to generate a larger number than you have files). There are many other ways, but that would be the simplest way I think.

Happy coding!
Living life with a loving heart, peaceful mind, and bold spirit.