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 / text adventure help

Author
Message
johnson
15
Years of Service
User Offline
Joined: 8th Dec 2008
Location:
Posted: 13th Nov 2010 23:07
hello I am trying to make my first game, a text adventure game, and I am facing some problems early on. The bolded line is the error.



What I want to do is make it so if go is not entered in input it goes to unknown. Thanks if you can help
johnson
15
Years of Service
User Offline
Joined: 8th Dec 2008
Location:
Posted: 14th Nov 2010 01:59
also how would I do this same thing except just pressing a button, such as enter
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Nov 2010 05:56
If you want to detect if a string does not equal something you can use the less than and more than signs like:


One of the issues you'll see though is if you specifically look for "Go" then the user can type "GO" or "go" or "gO" and it still won't see it properly because it wasn't "Go" (higher case G and lower case O). To make sure you detect all forms of GO no matter what the case you change the user input to highercase or lowercase letters with either the UPPER$() or LOWER$() commands.

To avoid using GOTO you can use DO/LOOPs to keep the user within the loop till the right conditions are met to leave the DO/LOOP with the EXIT command. Once the EXIT has been seen it goes to the line just under the LOOP to continue the program.



You should check out TDKs tutorials to learn the basics of Darkbasic Pro.

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

Login to post a reply

Server time is: 2024-11-24 09:44:35
Your offset time is: 2024-11-24 09:44:35