The_Lucky_Mutt wrote:
Honestly, seeing as I've just started, I could work around any format you guys use as long as it gives me all the data.
Well, the only format we use on the web at this point is a format that was easy to process with PHP. And at this point, there is no way for your program to get at that data. So something will have to be written especially for it (which won't be hard) so I might as well write it to have the exact output that would be easiest for you.
To incorperate the PHP into the flash it (optimally) would generate a text file that uses MIME format, (i.e. '&FloorData=$FloorData&MonsterPos=$MonsterPos').
Is that what LoadVars reads in? My Flash is a bit rusty.
Also, (so much for using whatever format), it would be more helpful if, as you suggested earlier, instead of me calling getroom.php?roomID=3241, I could call getroom.php?holdID=1&levelID=21&roomID=12 or somthing of the like.
Hmm... The problem there is, where did you get that levelId and roomID from? Here's how I did it for the forum room pics:
1) Get List of holds. Allow the user to pick one.
2) For selected hold, get a list of levels. Allow the user to pick one.
3) For the selected level, get a list of rooms, along with their offsets and IDs. This way, I can present them in a way the user can choose a room by looking at the level. When they click on a room, I know what its ID is, so I use that in step 4:
4) Draw a room, solely by its ID.
I'm open to helping in whatever way is best for you, but I'd suggest something along the same lines:
getholdlist.php : returns
&holdid[0]=1&holdid[1]=2&holdname[0]=Dugan's%20Dungeon&holdname[1]=Schik's%20Dungeon
The name's there for you to present to the user, and an id is there for further database queries.
getlevellist.php?holdid=1 : returns
&levelid[0]=17&levelid[1]=18&levelname[0]=First%Level&levelname[1]=Second%20Level ...
Ditto.
getroomlist.php?levelid=18 : returns
&roomid[0]=115&roomOffsetX[0]=-1&roomOffsetY[0]=1 ...
Here, you have an id for each room, and it's offset (i.e. once north, once east). So you know which room you'll be in if the user exits a room north, for instance.
Finally,
getroomdata.php?roomid=115 : returns
&otiles[0][0]=1&otiles[1][0]=2&otiles[2][0]=1& ...
- or -
&otiles="
aaaabbaaddaabadaaaabf..."
Does this make sense?
I don't know if this exact format works, if you can do arrays like I'm showing in my examples. But somehow, you need to know what levels are in a hold, what rooms are in a level, and the relative positions of the rooms. This is getting way too long, so I'm going to stop here. If I'm way off base and thinking either too much or not enough, feel free to smack me and tell me to shut up.
So yeah, there I my two bits, give me yours.
01. Okay, I'm a geek. And a dork to boot.
____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--
Mahatma Gandhi