Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Room index name from a String?  (Read 723 times)

0 Members and 1 Guest are viewing this topic.

Hosma293

Room index name from a String?
« 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
Logged
Re: Room index name from a String?
« Reply #1 on: September 20, 2006, 10:33:52 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
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.
Logged
Pages: [1]   Go Up

 


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



Page created in 0.026 seconds with 38 queries.