[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2006-05-21T13:34:45-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/1453 2006-05-21T13:34:45-05:00 2006-05-21T13:34:45-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11654#p11654 <![CDATA[Need help with RPG!]]> Statistics: Posted by Theophage — Sun May 21, 2006 1:34 pm


]]>
2006-05-20T23:26:58-05:00 2006-05-20T23:26:58-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11652#p11652 <![CDATA[Need help with RPG!]]> Statistics: Posted by crazydrivr — Sat May 20, 2006 11:26 pm


]]>
2006-05-20T15:33:43-05:00 2006-05-20T15:33:43-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11651#p11651 <![CDATA[Need help with RPG!]]>
I know it is more fun to make an RPG from scratch, but here is a program that called "ASCIIQUEST Editor" by Jace Masula that you might be interested in anyway. It is a (relatively) simple RPG maker written in QBASIC that uses colorful ASCII text as the graphics. Check it out here: http://qb45.think-new.com/asciiquest.php

I just came across it today and it looks COOL!

Statistics: Posted by Theophage — Sat May 20, 2006 3:33 pm


]]>
2006-05-10T12:25:41-05:00 2006-05-10T12:25:41-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11565#p11565 <![CDATA[copy and paste]]> Statistics: Posted by Zim — Wed May 10, 2006 12:25 pm


]]>
2006-05-08T16:10:01-05:00 2006-05-08T16:10:01-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11553#p11553 <![CDATA[Need help with RPG!]]> Statistics: Posted by crazydrivr — Mon May 08, 2006 4:10 pm


]]>
2006-05-07T22:44:32-05:00 2006-05-07T22:44:32-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11542#p11542 <![CDATA[Need help with RPG!]]>
IF INT(RND*10)=9 then wanderingMonster

This gives us 10 possibilities (0-9) and if the result is 9, go to the wandering monster sub. This makes a wandering monster appear approxiamately one out of every 10 steps the player makes.

Also, I forgot to mention that in the re-written program above, I moved the CLS statement when I really didn't need to.

Statistics: Posted by Theophage — Sun May 07, 2006 10:44 pm


]]>
2006-05-07T22:18:16-05:00 2006-05-07T22:18:16-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11541#p11541 <![CDATA[Need help with RPG!]]>

Code:

SUB wilderness    DIM wild$(15)  wild$(1) = "|------C--------------------|"  wild$(2) = "|....T.....T...T....T.......|" 'there are I's scattered all over.  wild$(3) = "|..T........T.T...T...T.....|" 'they represent trees.  wild$(4) = "|...........................|" 'yea i no, bad trees.  wild$(5) = "|....T.....T...T....T.......|"   wild$(6) = "|..T........T...T...T...T...|"   wild$(7) = "|...........................|"   wild$(8) = "|....T.....T...T....T.......|"   wild$(9) = "|..T..........T...T...T.....|"   wild$(10) = "|...........................|"   wild$(11) = "|....T.....T...T....T.......|"   wild$(12) = "|..T........TTT...T...T.....|"   wild$(13) = "|...........................|"   wild$(14) = "|...T......T...T...T........|"   wild$(15) = "|---------------------------|"    row = 2  column = 8    lOCATE 17, 1  PRINT "This is the Wilderness."  lOCATE 18, 1  PRINT "MONSTERS RESIDE HERE..."  LOCATE 19, 1  PRINT "YOU MAY HAVE TO FACE A FEW."    DO    CLS    LOCATE 1, 1    FOR COUNT = 1 TO 15      PRINT wild$(count)    NEXT count    LOCATE row, column    PRINT CHR$(1) 'also if you have any ideas on a movable character that doesn't smile all the time?        oldRow = row    oldColumn = column        DO      keyed$ = INKEY$    LOOP UNTIL keyed$ <> ""        SELECT CASE keyed$    CASE IS = "w"      row = row - 1    CASE IS = "s"      row = row + 1    CASE IS = "a"      column = column - 1    CASE IS = "d"      column = column + 1    CASE IS = "m"      CALL menu    END SELECT        SELECT CASE MID$(wild$(row), column , 1)    CASE IS = "T"      row = oldRow      column = oldColumn    CASE IS = "-"      row = oldRow      column = oldColumn    CASE IS = "|"      row = oldRow      column = oldColumn    CASE IS = "P"      CALL nextcity    END SELECT      LOOP UNTIL keyed="C"END SUB
Okay, I filled in more of the map (of course) and I changed the dashes to periods to represent clear terrain. I changed the trees to "T"s because they look more like trees to me, and because "T" can stand for "tree". :) You also had a stray quotation mark just before the chr$(1) that I deleted.

Also, it didn't seem like you had your map borders quite right. The sides used the "|" character, but the top and bottom needed special characters of their own. since I changed the "clear terrain" character to a period and since the top and bottom already consisted of dashes, I used dashes for the top and bottom borders.

Speaking of your second SELECT CASE section, it didn't have an END SELECT so the loop wouldn't loop. I also assumed that going back on the "C" spot would take you out of the wilderness, so I changed that case to make it a more structured exit.

It is good programming practice to enter and exit loops, subs and other structures at one (and only one) point. This means that even if you have a couple of places before the end where you could exit, you need to make some sort of flag to let the rest of the structure know that it has ended, but not actually exit until the end. So in a later version, you'll have to have a flag for the "C" case and the "P" case to let it know that the player has left the map, and then to let the main program know what to do once it is out of the wilderness sub (meaning the flag will probably be a global variable).

As for the player's ASCII character, rogue-like games often use a "@" to show this is where you are "at". I just had another thought, how about using the clubs playing card character for the trees? Or the spade? You could also use the heart as the player!

Now given this much, I will try to add in some random monster stuff in the next post.

Statistics: Posted by Theophage — Sun May 07, 2006 10:18 pm


]]>
2006-05-07T20:53:44-05:00 2006-05-07T20:53:44-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11540#p11540 <![CDATA[Need help with RPG!]]>
CLS

DIM wild$(15)
wild$(1) = "|------C--------------------|"
wild$(2) = "|-----I-----I---I----I-------|" 'there are I's scattered all over.
wild$(3) = "|--I--------I---I---I---I-----|" 'they represent trees.
wild$(4) = "|------------------------------|" 'yea i no, bad trees.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~'skipping down
wild$(15) = "|----------------------------|"

row = 2
column = 8

lOCATE 17, 1
PRINT "This is the Wilderness."
lOCATE 18, 1
PRINT "MONSTERS RESIDE HERE..."
LOCATE 19, 1
PRINT "YOU MAY HAVE TO FACE A FEW."

DO

LOCATE 1, 1
FOR COUNT = 1 TO 15
PRINT wild$(count)
NEXT count
LOCATE row, column
PRINT "CHR$(1) 'also if you have any ideas on a movable character that doesn't smile all the time?


oldRow = row
oldColumn = column

DO
keyed$ = INKEY$
LOOP UNTIL keyed$ <> ""

SELECT CASE keyed$
CASE IS = "w"
row = row - 1
CASE IS = "s"
row = row + 1
CASE IS = "a"
column = column - 1
CASE IS = "d"
column = column + 1
CASE IS = "m"
CALL menu
END SELECT

SELECT CASE MID$(wild$(row), column , 1)
CASE IS = "I"
row = oldRow
column = oldColumn
CASE IS = "_"
row = oldRow
column = oldColumn
CASE IS = "-"
row = oldRow
column = oldColumn
CASE IS = "P"
CALL nextcity
CASE IS = "C"
EXIT SUB

LOOP
END SUB


Ok. This is what I have for this level area. I want monsters in this area only. I also only want it so that the monsters can only attack you when you move and they wont show on the map. Also make it so that if you walk onto the same area if you restart the program that there won't always be the same monster in the same area. And if you notice I dont want ascII code 1 but it is the closest i have to a character that takes only one space. Any ideas?

Statistics: Posted by crazydrivr — Sun May 07, 2006 8:53 pm


]]>
2006-05-07T20:27:19-05:00 2006-05-07T20:27:19-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11536#p11536 <![CDATA[Need help with RPG!]]>
Can you copy and paste some of your code? It's easier for me to edit already written code than to come up with it from scratch.

Remember, to get a random number from one to ten, you would write something like:

Number = INT(RND*10)+1

Statistics: Posted by Theophage — Sun May 07, 2006 8:27 pm


]]>
2006-05-07T20:19:49-05:00 2006-05-07T20:19:49-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11535#p11535 <![CDATA[Need help with RPG!]]> Statistics: Posted by crazydrivr — Sun May 07, 2006 8:19 pm


]]>
2006-05-07T20:15:17-05:00 2006-05-07T20:15:17-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11534#p11534 <![CDATA[Need help with RPG!]]> RANDOMIZE TIMER somewhere at the beginning of the main module. That's where I put it.

When you do random numbers, the random number generator makes a particular sequence of numbers that appears to be random based on a certain seed value. The problem is, the seed value is the same everytime you run the program, so the random numbers will always have the same values everytime you run the program.

What the RANDOMIZE TIMER statement does, is change the seed for the random numbers based on whatever the internal clock is reading. This means that the random number sequences will be different everytime you run the program, unless you start it at exactly the same time (I think it's down to the second) every day. Now that you know how to keep your random numbers random, lets look at how to get them with the RND statement:

To generate a number from 1 to 6 and assign it to a variable called Number, you would write:

Number = INT(RND*6)+1

RND picks a random floating point (that's a number with decimal places) number from 0 to a little less than 1. Multplying this by 6 gives you a random floating point number from 0 to a little less than 6. Since we wanted only integers (numbers without the decimal places) we enclose RND*6 in the INT (integer) function. This chops off the decimal places (not rounds, just chops them off) and gives us a number from 0 to 5. Finally we add 1 to this to give us our desired 1 to 6 range.

Suppose you wanted to pick a random number from three values like 30, 45, and 60. (I used this in a program just today!) Notice that these three numbers are equal to 2*15, 3*15, and 4*15. This means that if I can just make a random number from 2 to 4, then multiply that by 15, I'll have the numbers that I want. To do this, I wrote:

Size = INT(RND*3)+2*15

I did RND*3 because there are three numbers from 2 to 4. INT(RND*3) would give me one of three numbers from 0 to 2, so I had to add 2 to that to give me a number from 2 to 4. Lastly I multiplied that by 15 to give me a number that is either 30, 45, or 60.

Statistics: Posted by Theophage — Sun May 07, 2006 8:15 pm


]]>
2006-05-07T19:52:22-05:00 2006-05-07T19:52:22-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=11531#p11531 <![CDATA[Need help with RPG!]]>
I also realized that i need help with some more things. For starters, i need to put an area of random encounters (monsters) in a sub. I know I need RANDOMIZE TIMER and RND commands but don't really get how to use them. (I want unlimited encounters, and only possible to get into a fight if you move a space).

The last thing I need help with is that I want to have a status screen from the menu you can pull up. But I also want exp to appear on that screen and it needs to be totaled up from the sub where the monsters will go.

For you who know what Final Fantasy is, that is basically how I want my random encounters to occur.

If anyone can help me with anything, even a little would really help!

Statistics: Posted by crazydrivr — Sun May 07, 2006 7:52 pm


]]>