Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

Thanks haha, this was more of an experiment, and the unresponsiveness was just part of the limitations of Batch script. But yeah, thanks for the feedback! (what you had to do was match the colour of the boss' head; if you didn't, you took damage. If you matched, than they took damage)

oh, I thought the colour thing was entirely cosmetic! 

(+1)

Nah.... I guess I'll write better instructions next time

Hey, I wanted to ask if you could help me with my own Batch Game. I am designing a game which uses multiple sub folders with batch files to create a Skyrim/ Roguelike styled batch adventure I named "Eternal Falls". IT even has Icon art I made!. 

To the Point:

O usually download Batch games when I think my game can get no better, surely... but then I downloaded yours....

Wow! I must ask you how on earth you got that game to play music! I am refering to the song Metamorphosis by Phillip Glass and the several other MP3 FIles. 

Normally if I like part of A batch script, I delete sections of a copied progrtam to keep the original pristine, and test to see if the certain feature still works, and I have managed to get "Kayleigh" by Marillion to play on your game. 

Dude, please... This Game is cool, and I want to ask if you could impart some of your knowledge to me on how you have done this!

A

P.s. I would have uploaded my Game, however I need to figure out a way for the game to run in any location or drive of a computer / Memory stick, rather in the core of the C:\ or D:\ Drive. 

Just for reference, I currently use a code:

  •  set drive=%cd:~0,3%

When I run the Batch Script from my USB (D:\), the variable %drive% would equal: D:\

Without changing the code, I run it copie onto my WIndows PC (C:\). The Variable %drive% now equals: C:\

Therefore to retrieve files:

  • cd "%drive%LifeA\Users"
  • call %name%.bat

The game can only be run if the path is :C:\LifeA\ or D:\LifeA

Can I ask, are you Hackoo from Stack Overflow?

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?

Also, Recently I sent you a message, and mentioned colour in Batch. 

Copy and paste this to the bottom of your Batch file you are using. 

:c
setlocal enableDelayedExpansion
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:colorPrint Color  Str  [/n]
setlocal
set "s=%~2"
call :colorPrintVar %1 s %3
exit /b

:colorPrintVar  Color  StrVar  [/n]
if not defined DEL call :initColorPrint
setlocal enableDelayedExpansion
pushd .
':
cd \
set "s=!%~2!"
:: The single blank line within the following IN() clause is critical - DO NOT REMOVE
for %%n in (^"^

^") do (
  set "s=!s:\=%%~n\%%~n!"
  set "s=!s:/=%%~n/%%~n!"
  set "s=!s::=%%~n:%%~n!"
)
for /f delims^=^ eol^= %%s in ("!s!") do (
  if "!" equ "" setlocal disableDelayedExpansion
  if %%s==\ (
    findstr /a:%~1 "." "\'" nul
    <nul set /p "=%DEL%%DEL%%DEL%"
  ) else if %%s==/ (
    findstr /a:%~1 "." "/.\'" nul
    <nul set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%"
  ) else (
    >colorPrint.txt (echo %%s\..\')
    findstr /a:%~1 /f:colorPrint.txt "."
    <nul set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%"
  )
)
if /i "%~3"=="/n" echo(
popd
exit /b

:initColorPrint
for /f %%A in ('"prompt $H&for %%B in (1) do rem"') do set "DEL=%%A %%A"
<nul >"%temp%\'" set /p "=."
subst ': "%temp%" >nul
exit /b

:cleanupColorPrint
2>nul del "%temp%\'"
2>nul del "%temp%\colorPrint.txt"
>nul subst ': /d
exit /b

::After you have done that, any Command that you want coloured, type= call :c (colour) " HELLO WORLD" /n

::For Multiple colours in one line, In red and then green as an example= call :c 0c "HELLO" &call :c 0a "WORLD" /n

:: The " " contains the viewable text, and the (Remember a Spacebetween quote marks and slash) /n ends that line, otherwise the next line would run onto the line you forgot to put "the cork" on, as I term it.)

Here, I made an example of two swords and some text I use for the game I am making. This will make Sword appear like its being written too (haha)





@echo off
mode con COLS=76 LINES=42
setlocal disableDelayedExpansion
set q=^"
echo.
call :c 06 "       ("&call :c 0c "**"&call :c 06 ")                                         ("&call :c 0c "**"&call :c 06 ") " /n
call :c 08 "       IIII                                         IIII " /n
call :c 04 "       ####                                         #### " /n
call :c 04 "       HHHH "&call :c 0f "   One shall come with a steel blade,"&call :c 04 "   HHHH " /n
call :c 04 "       HHHH "&call :c 0f "  With the fire that ancients forbade,"&call :c 04 "  HHHH " /n
call :c 04 "       #### "&call :c 0f "  Battles without, for battles within "&call :c 04 "  #### " /n
call :c 06 "    ___IIII___ "&call :c 0f "      Seeks evil within,       "&call :c 06 "   ___IIII___ " /n
call :c 06 " .-`_._"**"_._`-."&call :c 0f "      and evil's rule     "&call :c 06 "   .-`_._"**"_._`-. " /n
call :c 06 "|/``  .`\/`.  ``\|"&call :c 0f "    A hero, heart true,  "&call :c 06 "  |/``  .`\/`.  ``\| " /n
call :c 08 "`     }    {     '"&call :c 0f "     A warriors heart,  "&call :c 08 "   `     }    {     ' " /n
call :c 08 "      ) () ( "&call :c 0f " Or a Coward's mind, heart or mind, "&call :c 08 "  ) () ( " /n
call :c 08 "      ( :: ) "&call :c 0f "      To redeem , never betray,  "&call :c 08 "     ( :: ) " /n
call :c 08 "      | :: | "&call :c 0f "  Cease to speak or cease to breath  "&call :c 08 " | :: | " /n
call :c 08 "      | )( | "&call :c 0f "       His silence shall cleave  "&call :c 08 "     | )( | " /n
call :c 08 "      | || | "&call :c 0f "         The path of foes,    "&call :c 08 "        | || | " /n
call :c 08 "      | || | "&call :c 0f "             Kill many      "&call :c 08 "          | || | " /n
call :c 08 "      | || | "&call :c 0f "         To save a Peoples, "&call :c 08 "          | || | " /n
call :c 08 "      | || | "&call :c 0f "        Our Hero , Our Hero, "&call :c 08 "         | || | " /n
call :c 08 "      | || | "&call :c 0f "Only to rest when the fire is warmed! "&call :c 08 " | || | " /n
call :c 08 "      ( () )                                       ( () ) " /n
call :c 08 "       \  /                                         \  / " /n
call :c 08 "        \/                                           \/ " /n
echo.
echo.
pause
ping localhost -n 4 >nul 
goto enddd

"&call :c 08 "

:c
setlocal enableDelayedExpansion
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:colorPrint Color  Str  [/n]
setlocal
set "s=%~2"
call :colorPrintVar %1 s %3
exit /b

:colorPrintVar  Color  StrVar  [/n]
if not defined DEL call :initColorPrint
setlocal enableDelayedExpansion
pushd .
':
cd \
set "s=!%~2!"
:: The single blank line within the following IN() clause is critical - DO NOT REMOVE
for %%n in (^"^

^") do (
  set "s=!s:\=%%~n\%%~n!"
  set "s=!s:/=%%~n/%%~n!"
  set "s=!s::=%%~n:%%~n!"
)
for /f delims^=^ eol^= %%s in ("!s!") do (
  if "!" equ "" setlocal disableDelayedExpansion
  if %%s==\ (
    findstr /a:%~1 "." "\'" nul
    <nul set /p "=%DEL%%DEL%%DEL%"
  ) else if %%s==/ (
    findstr /a:%~1 "." "/.\'" nul
    <nul set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%"
  ) else (
    >colorPrint.txt (echo %%s\..\')
    findstr /a:%~1 /f:colorPrint.txt "."
    <nul set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%"
  )
)
if /i "%~3"=="/n" echo(
popd
exit /b

:initColorPrint
for /f %%A in ('"prompt $H&for %%B in (1) do rem"') do set "DEL=%%A %%A"
<nul >"%temp%\'" set /p "=."
subst ': "%temp%" >nul
exit /b

:cleanupColorPrint
2>nul del "%temp%\'"
2>nul del "%temp%\colorPrint.txt"
>nul subst ': /d
exit /b  

:enddd



::ENJOY!!

::A.