Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

No, I'm not on Stack Overflow. How the music works is that it uses embedded VBScript (scroll to the bottom). The technique to embed is from here https://stackoverflow.com/questions/9074476/is-it-possible-to-embed-and-execute-... (the last bit of the first answer). I define macros that use it to play music via CScript. In terms of a cool Batch, you should try this game instead. It has much better code, and showcases how I created the graphics more.

To create the diferent colours and stuff, I use VT100 escape sequences, which is Windows 10 only and makes it a lot easier. You can check them out here https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequen.... Also, I would not recommend creating multiple folders in your game to simulate a dungeon. If I were you, just create some sort of variable that stores what goes into what, and it will be much easier from there.

Thak you so much!

At the moment, I am editing it to allow for SFX that does not loop, like in my game, there is a decapitation that just looped and looped and looped! So I edited the code a bit:

<package>
  <job id="Sound">
    <script language="VBScript">
      Set args = WScript.Arguments
      Set Sound = CreateObject("WMPlayer.OCX.7")
      Sound.URL = args.Item(0)
      Sound.Controls.play
      do while Sound.currentmedia.duration = 0
      Wscript.sleep 100
      loop
      Wscript.sleep (int(Sound.currentmedia.duration)+1)*1000
    </script>
  </job>
  <job id="Sfx">
    <script language="VBScript">
      Set args = WScript.Arguments
      Set Sound = CreateObject("WMPlayer.OCX.7")
      Sound.URL = args.Item(0)
      Sound.settings.volume = 100
      Sound.settings.setMode "loop", False
      Sound.Controls.play
      While Sound.playState <> 1
      WScript.Sleep 100
      Wend
    </script>
  </job>
  <job id="Music">
    <script language="VBScript">
      Set args = WScript.Arguments
      Set Sound = CreateObject("WMPlayer.OCX.7")
      Sound.URL = args.Item(0)
      Sound.settings.volume = 100
      Sound.settings.setMode "loop", True
      Sound.Controls.play
      While Sound.playState <> 1
      WScript.Sleep 100
      Wend
    </script>
  </job>
</package>

As you can now see, there is a new section with the Job ID sfx. this allows the head removal part or war cries to play without looping. 

Honestly, I could not thank you enough for your help.  I'll update you on any add ins!
 

You don't need to edit it at all. As you can see, the code already has a "Sound" package. So in the macro, instead of the word Music put Sound instead.

(1 edit)

ahh, I see! I thought that may have adjusted the volume!

I have got it to talk, but I would like the code here to work only on the voice, not the music:

:END
TASKKILL /F /IM CSCRIPT.exe >NUL
GOTO :EOF

(+1)

You can just call another job that adjusts the SAPI voice element. CScript refers to the VBScript so it's probably easier to save the SAPI  object OR the PID of the VBScript process.

(1 edit)

Can you give me an example of what you mean?

I mean, you can search this kind of thing up online. There's quite a bit of examples on Stack Overflow, and you can just piece them all together. If I just gave you the code, then you wouldn't be learning anything.

True true, Well thank you!!

btw, I am uloading the work in progress, so check it out if you want!