ZFGC

Resources => Coding => Topic started by: Hosma293 on September 20, 2006, 10:24:51 pm

Title: Room index name from a String?
Post by: Hosma293 on September 20, 2006, 10:24:51 pm
Hey again. I'm just wondering if its possible to get a room index name from a string variable. The way I've gotten it set up is have a variable set to say "1_0", that is like a room coord, and I'd be in the room thats horiz 1 by verti 0 in the overworld. Think of it like a data grid sorta..

if var == "1_0"
--------------
|   | x|   |   |
--------------
|   |   |   |   |
--------------
|   |   |   |   |
--------------
|   |   |   |   |
--------------
x = room.

There so now you know why I need a room name from a string. :P
PS: If there is a better way of doing it, let me know asap :P
Title: Re: Room index name from a String?
Post by: Infinitus on September 20, 2006, 10:33:52 pm
Well what I would do is either have a 2 dimensions array containing the room names in it and then just convert the string to integers and grab the name from the array. Or I would name all the rooms sequentially and then you could easily get the name by extracting the dimensions from the string and multiplying them together.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved