samedi 2 mars 2019

Multiple possible text inputs with if statements BATCH

Hi Im pretty new to coding and I've only done a few bits with GML and Javascript in the past. currently i am trying to make a fully immersive text adventure using .Batch

here is my problem, i want the answers to be a text input. so the players type in a response witch dictates where they will go.

for a lot of questions i need there too be multiple possible inputs, for example when you get to an enemy there are tons of different things you could do however i can only figure out how to get it to recognize one input.

here is my code for this section so far

:forest1

echo you awake in a forest, you do not know where you are or why you are there.

echo infront of you is a small goblin like creature

:recoil1

echo What do you do?

set /p answer=

if %answer%==run (

goto run1

) else (

if %answer%==attack (

goto attack1

) else (

if %answer%==befriend(

goto befriend1

) else (

if %answer%==scream(

goto scream1

) else (

if %answer%==dance (

goto dance1

) else (

echo Nothing happened

timeout /t 1

goto forest1

)

Aucun commentaire:

Enregistrer un commentaire