Page 1 of 4

Adventure Game with text input

Posted: Wed 19 Oct, 2005 2:27 pm
by CompWiz
I'm working on adapting an old BASIC Adventure game skeleton for the calculator. It can accept two word input. Is there any interest for this, or is it too hard to type on the calculator? :?
You will only need to type two words, or even three letters of each word.
I will release the example game that was included in the book soon as a calculator BASIC program. (83/84 series)

Posted: Wed 19 Oct, 2005 3:27 pm
by threefingeredguy
I like TBAs. No menus though, menus suck. Will this be graphical as well? It doesn't matter, TBAs rock when they are well done.

Posted: Wed 19 Oct, 2005 4:07 pm
by necro
typing not so good...tabs

Posted: Wed 19 Oct, 2005 6:00 pm
by CompWiz
The adventure game in the book does not support pictures, but I could add them in after I get the first version working.
The typing shouldn't be too bad, as you only really have to type the first three letters of the two words you use.

Posted: Wed 19 Oct, 2005 9:16 pm
by necro
what book?

Posted: Wed 19 Oct, 2005 11:50 pm
by CompWiz
How to Create Adventure Games by Christopher Lampton
copyright 1986
basically it is a book that leads you through creating an adventure game with explanations of each part, then gives you the code for the game they created and a skeleton so you can make one.

Posted: Thu 20 Oct, 2005 1:21 am
by necro
:o that is a loooooooong time ago...I wasn't even alive...

Posted: Thu 20 Oct, 2005 1:23 am
by CompWiz
necro wrote::o that is a loooooooong time ago...I wasn't even alive...
same here.

:x stupid lack of subroutines(without using seperate programs) in ti Basic :x

Posted: Thu 20 Oct, 2005 3:36 am
by threefingeredguy
On www.unitedti.org there is a topic in Basic Programming about subroutines in basic. I think it is called "Basic Tricks" or somehting like that.

Posted: Thu 20 Oct, 2005 3:47 am
by CompWiz
thanks, I'll look more into that tomorrow


Progress:
So far I have the text input and storing of input working. I also have the location statements(tells you where you are) working, but I may have to alter them slightly. I am working currently on a program to output the contents of a string to the screen with line breaks only after spaces, and combining the statements that you would recieve to save screen space.

Posted: Wed 26 Oct, 2005 3:45 am
by CompWiz
Update: I finished the code for the program that will display the combined output from the game(this way it is not a new line for location, items, possible directions, etc..., and it saves screen space)

One problem: It doesn't run. :x I did throw it together fairly quickly, and it probably has a simple mistake somewhere. Also, it is exceedingly un-optimized(I want to optimize for size, as long as speed is reasonable)

The purpose of the program is to output to the screen the text in string1, while wrapping the text only on spaces, if possible. Also, it should be starting after whatever line was already on the display before this program was called. I would like to keep variable use to a minimum, if possible, as the rest of the program uses quite a few variables.

Here is the current code:

Code: Select all

Lbl A
If (length(Str1)<1)
Return
If (inString(Str1," ")=1)
Then
sub(Str1,2,length(Str1)-1)->Str1
Goto A
End
If (inString(Str1," ")>16)
Then
Disp sub(Str1,1,16)
sub(Str1,17,length(Str1)-16)->Str1
Goto A
End
If (length(Str1)<16)
Then
Disp Str1
Return
End
For(X,1,16)
If (inString(Str1," ",X)>16)
Then
Disp sub(Str1,1,inString(Str1," ",X-1))
sub(Str1,1,inString(Str1," ",X-1))->Str1
Goto A
End
End
If the code is not as self-explanitory as it seems it is to me, just say so, and I can make comments.

Posted: Wed 26 Oct, 2005 4:05 am
by Spengo
*in answer to original question*

Yes, but it has to be really funny. :lol:

Posted: Wed 26 Oct, 2005 3:45 pm
by threefingeredguy
necro wrote:typing not so good...tabs
Are you implying that I misspelled TBAs? :no: , its TBA for Text Based Adventure.

Posted: Wed 26 Oct, 2005 6:03 pm
by CompWiz
So, did anyone figure out why the code I posted doesn't work? It runs but it does not output the text in string1 with line wraps only on the spaces. It doesn't even output the entire string. Any ideas?

Posted: Wed 26 Oct, 2005 8:18 pm
by hart
CompWiz, your code is pretty inefficient, so use this code instead. It should work for most cases, and it is relatively small and fast. Just remember to give credit. Also tell me if you find any problems with it.