Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone interested in making a text adventure as a group?
#59
I've seen this before. This is all we really need to do:

Let's say the player inputs a command. Let's make that command "TAKE SWORD".

Alphabetize the command pool DATA.
Code:
DATA "eat", "sleep", "TAKE"

Then, take the first letter of the command and store it.
Code:
FLCOM$ = UCASE$(MID$(INP$,1,1)

Next, find all the DATA that starts with that letter.
Code:
DIM COMMANDS(*however many we have*) AS STRING * *length of biggest string*

RESTORE CommandStart
FOR I = 1 TO *however many commands we have availible*
   READ cominp$
   cominp1$ = UCASE$(MID$(cominp$, 1, 1)
   IF cominp1$ = FLCOM$ THEN COMMANDS(I) = cominp$
NEXT I

So, now we have all the commands that start with T.
Now, we have to narrow it down to our command.


First, find all the letters of the first word. Just in case, add a space to the end.
Code:
FOR I = 1 TO LEN(IN$)
WHILE ALLETT$ <> CHR$(32)
   ALLETT$ = UCASE$(MID$(IN$,I,1)
   a = a + 1
WEND
NEXT I
a = a - 1

That gave us the number of text symbols before the space.

Then,

I'll finish this later...[/code]
Reply


Messages In This Thread
Anyone interested in making a text adventure as a group? - by j2krei08 - 10-17-2005, 06:57 PM
been thinkin - by zoasterboy - 10-22-2005, 10:54 AM
sorry! - by phycowelder - 10-23-2005, 12:13 PM
before... - by zoasterboy - 10-24-2005, 07:43 AM
story line - by zoasterboy - 10-25-2005, 04:47 AM
yah - by zoasterboy - 10-25-2005, 07:26 AM
main menu - by zoasterboy - 10-26-2005, 05:13 AM
joining - by phycowelder - 10-26-2005, 05:25 AM
^^ - by zoasterboy - 10-26-2005, 05:27 AM
Anyone interested in making a text adventure as a group? - by Anonymous - 10-26-2005, 05:34 AM
Re: ^^ - by Liquid Snake - 10-26-2005, 06:18 AM
cool! - by phycowelder - 10-26-2005, 06:56 AM

Forum Jump:


Users browsing this thread: 8 Guest(s)