RPG batch game question

February 3, 2011 at 09:17:45
Specs: Windows 7
Hello im making a batch RPG game and at the beginning the player is asked to type in their game name and that name is gonna be used in the entire game but how?

See More: RPG batch game question

Report •


#1
February 3, 2011 at 15:27:35
You have to assign a value to a variable.
set /p GameName= Enter your game name:

set /? at your prompt for more info.

Good luck with your game ;)


Report •

#2
February 3, 2011 at 18:08:46
Just an add on to what was said above, you will be able to access that name with the variable %GameName%.

Can I put a question here?


Report •

#3
February 4, 2011 at 06:57:29
ok thanks :D, but can i use this method to make a currency system?

oh and if you wanted to put a question here, go ahead


Report •

Related Solutions

#4
February 4, 2011 at 20:40:51
Yeah, check out "SET /?" and read the documentation.

SET Money=10
SET /a Money+=1
ECHO %Money%

----

Below is my signature line, all forums have them. Mine's just a joke nobody ever seems to get. Maybe that says something about the joke...

Can I put a question here?


Report •

#5
March 16, 2011 at 12:13:50
if you like i could give you a copy of a game i made

Report •

#6
March 16, 2011 at 12:15:45
i could give you a copy af a game i made

Report •

#7
June 19, 2011 at 09:15:10
Matt123, just got the joke, had seen the line before but never realized it...i'm slow, but funny..funny

mike


Report •

#8
July 17, 2011 at 14:23:15
I have a good way for money to work.
If you earn money:
set /a money=%money%+%moneyearned%
If you spend money:
if /i %money% lss %itemcost% (
goto not_enough_money
)
set /a money=%money%-%itemcost%
And yes you have to type it that exact way not including the variables.

Report •

#9
July 17, 2011 at 14:24:53
Wait! In the if /i part, it's !money! not %money%

Report •

#10
July 17, 2011 at 14:32:59
I just realized I could have just edited that message instead of making a new message

Report •


Ask Question