MakeQSP.bat 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. @ECHO off
  2. :: Set batch file path
  3. set BATDir=%~dp0
  4. :: Set those lines to fit your setup.
  5. :: This is where glife.qsp will be copied. If you don't want to move it just comment (::) the line below.
  6. :: set CP_TO=..\GL_ECV
  7. :: This is the program used to open the QSPFILE. If you comment this line windows will launch the default app for the ".qsp" extension.
  8. set QSPGUI=tools\Player-video\qspgui.exe
  9. set QGEN=tools\QGen5\QGen.exe
  10. :: The file that will be generated or open
  11. set QSPFILE=glife.qsp
  12. :: Chimrod validation tool
  13. set QSPParser=tools\qsp_parser.exe
  14. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  15. :menu
  16. cls
  17. echo.
  18. echo :: Girl Life - QSP Compiler and Launcher ::
  19. echo.
  20. if defined QGEN (
  21. if not exist "%BATDir%%QGEN%" (
  22. echo QGEN : [ERROR] - "%BATDir%%QGEN%" not found. Using DEFAULT application.
  23. set QGEN=
  24. ) else (
  25. echo QGEN : [OK] - "%BATDir%%QGEN%")
  26. ) else echo QGEN : [NOT DEFINED] - Using DEFAULT application.
  27. if defined QSPGUI (
  28. if not exist "%BATDir%%QSPGUI%" (
  29. echo QSP EXEC : [ERROR] -"%BATDir%%QSPGUI%" not found.
  30. set QSPGUI=
  31. ) else ( echo QSP EXEC : [OK] - "%BATDir%%QSPGUI%")
  32. ) else ( echo QSP EXEC : [NOT DEFINED] - Using Windows DEFAULT.)
  33. if defined QSPFILE (
  34. if not exist "%BATDir%%QSPFILE%" (
  35. echo QSP FILE : [WARNING] - "%BATDir%%QSPFILE%" not found.
  36. ) else ( echo QSP FILE : [OK] - "%BATDir%%QSPFILE%")
  37. ) else ( echo QSP FILE : [NOT DEFINED] - ERROR: CAN'T CONTINUE.)
  38. if defined CP_TO (
  39. if not exist "%CP_TO%" (
  40. echo COPY : [ERROR] - Destination "%CP_TO%" not found. Copy DISABLED.
  41. set CP_TO=
  42. ) else ( echo COPY : [OK] - "%CP_TO%")
  43. ) else ( echo COPY : [DISABLED] )
  44. if defined QSPParser (
  45. if not exist "%BATDir%%QSPParser%" (
  46. echo QSP Parser : [WARNING] - "%BATDir%%QSPParser%" not found.
  47. echo Please visit the Girl Life Discord to download the latest version.
  48. ) else ( echo QSP Parser : [OK] - "%BATDir%%QSPParser%")
  49. ) else ( echo QSP Parser : [NOT FOUND - DISABLED ] )
  50. echo.
  51. if defined NOT_FOUND (
  52. echo ERROR: Option '%action%' wasn't recognized. Is it lowercase?
  53. set NOT_FOUND=
  54. )
  55. echo.
  56. echo ACTIONS: (B)uild (R)un (F)ull (Q)Gen (V) Validate (E)xit
  57. echo.
  58. set /p action=Choose an action:
  59. if defined QSPFILE (
  60. if %action% == b goto build
  61. if %action% == r goto run
  62. if %action% == f goto build
  63. if %action% == v goto parser
  64. if %action% == q goto qgen
  65. if %action% == B goto build
  66. if %action% == R goto run
  67. if %action% == F goto build
  68. if %action% == V goto parser
  69. if %action% == Q goto qgen
  70. )
  71. if %action% == e goto exit
  72. if %action% == E goto exit
  73. set NOT_FOUND=1
  74. goto menu
  75. :build
  76. echo.
  77. echo Building ...
  78. @ECHO ON
  79. python tools\txtmerge.py locations glife.txt
  80. tools\txt2gam.exe glife.txt %QSPFILE% > nul
  81. @ECHO OFF
  82. echo.
  83. if defined CP_TO ( echo Copying %QSPFILE% to "%CP_TO%" ... & copy %QSPFILE% %CP_TO% > nul )
  84. echo.
  85. echo Done.
  86. pause
  87. if %action% == f ( goto run ) else ( goto menu )
  88. :qgen
  89. echo.
  90. echo Running ...
  91. if defined CP_TO ( start %QGEN% %CP_TO%\%QSPFILE% ) else ( start %QGEN% %QSPFILE% )
  92. goto exit
  93. :parser
  94. echo.
  95. echo validating...
  96. @ECHO ON
  97. "%BATDir%%QSPParser%" --level warn "%BATDir%glife.txt" > "%BATDir%validation.log"
  98. @ECHO off
  99. echo Done - Exiting.
  100. pause
  101. goto exit
  102. :run
  103. echo.
  104. echo Running ...
  105. if defined CP_TO ( start "%BATDir%%QSPGUI%" %CP_TO%\%QSPFILE% ) else ( start "%BATDir%%QSPGUI%" %QSPFILE% )
  106. :exit