Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
switching maps in RPG
#1
i have read a few RPG tutorials, and most are very different then each other, and i think that the method used on this site would be good for starting out, but it never told you how to switch maps. i have tried experimenting with the code, but i just couldn't get anything to work for me. any suggestions?
the mind is a beautiful thing, use it and make the world a more beautiful place.
Reply
#2
Well...First, make a subroutine that loads maps. Have it take one argument (which will specify what map to load).
Create lots of maps (I make mine with DATA), and then, according to the argument, use the 'RESTORE lineLabel' command to read the map DATA from a certain point where that map DATA starts (look up RESTORE in QB help for more information).
So, and example:

Code:
SUB loadMap (mapNum)
map1:
'All of map #1's DATA goes here
map2:
'All of map #2's DATA goes here
map3:
'etc. etc. etc.
'Check argument for which map. If 1...
RESTORE map1
'If 2...
RESTORE map2
'If 3...
RESTORE map3
'And go on to load the new map into your map array, or your equivalent.
'Remember to use a FOR loop which will know when to stop READing DATA (assuming all maps are the same size).
'Then adjust all other variables to the new map.
END SUB
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#3
myself... I'd have it take two or three args.. or four..

two: name, location index (map stores preset locations)
three: name, x, y.
four: name, 0 or 1 (0 = use location, 1 = use x/y), location index , anything // x, y
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#4
WOW
Agamemnus does what I do!

(does that mean I'm a good progger?) :lol:
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply
#5
Better to avoid DATA and have em stored in a file.
Reply
#6
Thank you, thank you. You're too kind. :king:
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#7
use OPEN #, CLOSE #, INPUT #, LINE INPUT #, LOF, EOF, GET # or PUT # to read files, you know? Wink lol just kidding
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)