Sync off : Sync Rate 60 : Color Backdrop 0 : HIDE MOUSE
Sync is off by default. I'm pretty sure
sync rate has no effect if sync is off.
Color backdrop activates and colours the 3D backdrop, obviously you don't want that for a text adventure.
Hide mouse is best put right at the start, if you turn sync on, which would be a good idea, and then hide the mouse it wont hide until the next sync update.
in$ = left$(lower$(trim$(in$)),1)
I had to insert this line, I don't know when you wrote this but you didn't have any of this string manipulation that Kevin Picone and I recommended you do. See how by cutting the string down as simple as possible we make it a lot easier to read the input:
chooseClass:
INK RGB(255, 100, 0), 0 : INPUT "THIEF, MAGE or CAPTAIN? -> ";in$
in$ = left$(lower$(trim$(in$)),1)
Select in$
Case "t" : myClass = 0 : Endcase
Case "m" : myClass = 1 : Endcase
Case "c" : myClass = 2 : Endcase
Case Default : INK RGB(255, 0, 0), 0 : Print "Invalid class, try again." : GOTO chooseClass : Endcase
Endselect
// end of chooseClass
I indented this section as it's not clear what it is doing. This is the problem with GOTO, there's no indication of what is going on and no way to anticipate when a jump will happen, so I tried to make it clearer until we find a better solution. I also changed your error message as shouting "ERROR!!" isn't much help to the player. Making this section into a subroutine makes a little more sense so I've done that.
Print " " : Print "You are in a large forest. There is a path to your FRONT, trees to your LEFT and a cave to your RIGHT."
You can start a string with a space:
Print " You are in a large forest. There is a path to your FRONT, trees to your LEFT and a cave to your RIGHT."
PLAY MUSIC 1
LOOP MUSIC 1
Loop music plays the music, you don't need both these commands. This makes me think you are not reading the help files on the commands you use.
Text adventures traditionally use NORTH, EAST, SOUTH and WEST for orientation. FRONT (you mean FORWARD?), LEFT, RIGHT don't make a lot of sense if you think about it, what happens if you turn around!
GOTO Section1
Okay, maybe I've given you a bad habit here. I used GOTO in the input because it was a simple solution and the label was so close to the GOTO call that it was fairly easy to see what it was for. However, when I read this right at the end of the program I think, "where the hell is Section1?", this is obviously bad for following your code and maintaining it.
Hopping from section to section seems logical (I did the same thing making my first text adventure) but it's bad coding, you may as well be writing it out on paper if you're going to do it like that. A better solution is to create a routine for handling sections and then read the data for each section into it, this means far less code and no confusing jumps, also it's much easier to add new sections to this system. I wont go into how to do this now but think about what you would need to do to use the same code to display any section and offer different options.
INK RGB(255, 100, 0), 0
You may or may not realise this but RGB() is a function that converts three numbers into one colour value, yes colours are actually stored as a single number, for example, 255 is bright blue and 65535 is cyan. (Use the search bar to find out how colours are combined into one value if you are interested.)
My point here is that RGB() requires calculation and that means it's slowing down the program unnecessarily, because we could define the colours before the program main begins. Also, what if you decide to change the colours you are using? You'd have to go and change each one by hand! Maybe you want to allow the player to change the colour scheme too.
colorErr = rgb(200,80,0)
colorFG = rgb(200,200,180)
colorBG = rgb(30,30,20)
We could define colours like this. It's best to give the variable a name for what it is used for rather than colour we assign it because the point of a variable is that it can be changed.
Alternatively, we could use an array to store the colours. One advantage of using an array is that we can use a variable to index the array and so use different colours in the same generic template, another level of flexibility. Here's an example comparing variables with an array:
w/variables:
colorTitle = rgb(200,160,0)
colorFG = rgb(200,200,180)
colorBG = rgb(30,30,20)
for i = 0 to 1
read txt0$
read txt1$
read txt2$
ink colorTitle,0
print txt0$
ink colorFG,0
print txt1$
print txt2$
wait key
next i
// SCREEN 0 text
data "~*~ DUNGEON MASTER ~*~"
data "Welcome to Dungeon Master, the best text adventure ever!"
data "PRESS ANY KEY TO CONTINUE"
// SCREEN 1 text
data "You are standing in a field. There is a forest to your EAST, to your WEST is a town,"
data "a river lies to the SOUTH, and dark caves to the NORTH."
data "Where will you travel?> "
w/array:
dim color(2)
color(0) = rgb(200,160,0)
color(1) = rgb(200,200,180)
color(2) = rgb(30,30,20)
for i = 0 to 1
read txt0_color : read txt0$
read txt1_color : read txt1$
read txt2_color :read txt2$
ink color(txt0_color),0
print txt0$
ink color(txt1_color),0
print txt1$
ink color(txt2_color),0
print txt2$
wait key
next i
// SCREEN 0 text
data 0, "~*~ DUNGEON MASTER ~*~"
data 1, "Welcome to Dungeon Master, the best text adventure ever!"
data 2, "PRESS ANY KEY TO CONTINUE"
// SCREEN 1 text
data 1, "You are standing in a field. There is a forest to your EAST, to your WEST is a town,"
data 1, "a river lies to the SOUTH, and dark caves to the NORTH."
data 0, "Where will you travel?> "
Of course I could put the text into an array too and really make this short! This should give you an idea of how to make a generic display system that you can feed data into.
Wow, I'm really writing an essay here!
Going back to your class data:
Data "Thief", "Mage", "Captain"
For x1 = 0 to 2
Read Classes(x1).character
value# = 6
gold# = 50
Classes(x1).exp# = 0
Classes(x1).gold = gold#
Classes(x1).lvl = 1
Classes(x1).hasWeapon = 0
Classes(0).lives = value#
Classes(0).dex = value#+2
Classes(0).mana = value#-2
Classes(0).str = value#
Classes(1).lives = value#-2
Classes(1).dex = value#
Classes(1).mana = value#+2
Classes(1).str = value#-2
Classes(2).lives = value#+2
Classes(2).dex = value#-2
Classes(2).mana = value#
Classes(2).str = value#+2
NEXT x1
I see what you are trying to do here but as soon as you start typing the index numbers for the arrays, eg "Classes(2)", you should sense you're doing something wrong. Add some more data for those stats and it gets much simpler:
data "Thief", 6, 8, 4, 6
data "Mage", 4, 6, 8, 4
data "Captain", 8, 4, 6, 8
For i = 0 to 2
read Classes(i).character
read Classes(i).lives
read Classes(i).dex
read Classes(i).mana
read Classes(i).str
Classes(i).exp# = 0
Classes(i).gold = 50
Classes(i).lvl = 1
Classes(i).hasWeapon = 0
NEXT i

Formerly OBese87.