Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / I need help with my Text RPG

Author
Message
Seraf
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location:
Posted: 21st Jan 2005 11:53
I'm working on a Text RPG with a friend of mine and we can't seem to get it when you choose your class and race if the player does not type in a class or race that is given then it will display say "That is not a valid Race / Class please choose again." Here is the code we are currently using.



input "What class are you?>",class$
if class$="Warrior" then print "You are a Warrior"
if class$="White Mage" then print "You are a WhiteMage"
if class$="Black Mage" then print "You are a BlackMage"
if class$="Archer" then print "You are a Archer"
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 21st Jan 2005 22:01
write it like this:




if you donĀ“t write lower$, warrior and Warrior are two different words. YOu KNow whAt I`m SayING?


Check out PanzerGames at http://www.freewebs.com/panzergames
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 22nd Jan 2005 02:43
Try using the Select/Case commands.

I'm don;t remember if DBC has the Select/Case commands. Another way that would work in either DBC or DBP is:


"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
fasdfsdaf
19
Years of Service
User Offline
Joined: 17th Jan 2005
Location:
Posted: 24th Jan 2005 09:35
@klu 007: that way works, but don't you need to change it to:
ant then you have to make a way to check if it isn't any of those.

@RiiDii: Both ways work, but you need to convert class$ to either all caps of all lowercase.

www.war3forums.net

Login to post a reply

Server time is: 2024-09-23 10:22:23
Your offset time is: 2024-09-23 10:22:23