Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / RPG Engine - how do I get more then 9 diffrent tiles? (read for clarification)

Author
Message
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 26th Jun 2003 04:13
I'm using a very simple type of RPG engine that reads from a file 1 digit. I can't figure out how to make it read into an array all the digits UNTIL it finds a ,.

Please tell me if I'm not clear enough...
~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
CrayZemon
20
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 26th Jun 2003 06:24
Maybe you could use negative numbers. -9 to 9 will give you a grand total of 19 tiles. Or you could read symbols using strings like "!" "@" "#". The ASCII tabels will probably be your best friend in the second suggestion, but I may still be in the dark on what you're trying to do.

"I need gopher-chucks!!"
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 26th Jun 2003 06:27 Edited at: 26th Jun 2003 06:32
Thats a great idea, except it currently reads only digits into a Number Only variable @_@. Thankx though. I didn't think of doing it that way..256..hmm..


Here is my current code.

==================================================
dim Map(4,4)

mapname$="map.txt"

open to read 8,mapname$
for x=1 to 4
for y=1 to 4
read byte 8,a
Map(y,x)=a-48
next y
next x
close file 8

for x=1 to 4 : for y=1 to 4
paste image Map(y,x),x*32+210,y*32+120
next y : next x

==================================================


If I want to read ascii characters through that method..would I just find the SCANCODE for each letter??

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 26th Jun 2003 17:56
Meh, screw it all. I'll just create an array, save it to the map.txt file, then use LOAD ARRAY to get all the map objects and ect...

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Binary Moon
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: United Kingdom
Posted: 29th Jun 2003 20:14
erm... you're using bytes to store data values? A single byte can be anywhere in the range 0-255. How many tiles do you need?

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 29th Jun 2003 20:27
Yeah, just use a '0' instead of a ','. Then you still have 254 different tiles available.

cuRant PRogekt: a three-de map editer
Why the hell'd you ask me for crying out loud!?!
Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 29th Jun 2003 22:34
Nah, like I said I'm using SAVE ARRAY and LOAD ARRAY...Easier, and also easier for users to edit files if need be.

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.

Login to post a reply

Server time is: 2024-03-28 23:01:18
Your offset time is: 2024-03-28 23:01:18