|
-
Flash Incompetent
[AS3] Enemy Database
Without loading from any external files, does anyone have any suggestions as to what the best way to store a large amount of enemies' stats, name, skills, et cetera?
-
Pumpkin Carving 2008
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
Flash Incompetent
I thought XML was only used by loading external files, am I incorrect in that assumption? I can't seem to find any examples of XML within AS files...
-
save where?,- if its on the internet perhaps better inside a databse like using mySql /php and flash. Or in combination AMFphp.
XML would be my choise as well if its just offline and local- because its easier to handle alone with flash.
-
Senior Member
If you are using flex you can embed xmls in your swf.
If you are using cs3, you have to create a .as containing the data. It should be possible to create a string containing the Xml data in this class.
-
Pumpkin Carving 2008
Personally I try to keep every server side, so preferably, I'd go with a single Data class of sorts with a look up table embedded therein. If that wasn't an option (like you wanted longer-term saving) I'd go with php/MySQL 100%.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD
WEI Score: 7.6
-
Hype over content...
If you're storing it internally ( External xml would be a lot better, that's why everyone's mentioned it already ) and not using as3 then just store them as objects and shove them in an external .as file(s)
Squize.
-
FK founder & general loiterer
 Originally Posted by Sietjp
If you are using flex you can embed xmls in your swf.
If you are using cs3, you have to create a .as containing the data. It should be possible to create a string containing the Xml data in this class.
TELL ME TELL ME TELL ME pleeeese how to do this 
Ive recently moved to flex for my dev environment and I will never go back... its awesome... now If I can learn how to embed all my xml data inline... my life will be somehow complete....
-
Senior Member
You can use this
PHP Code:
<mx:XML id="xmlSource" source="data.xml"/>
or also the embed tag I think
PHP Code:
[Embed(source="data.xml")]
-
Senior Member
I would probably make an associative array and fill it with Enemies.
You know make a Enemy class with the properties you need like HP, ATTACK, etc.
enemies["imp"] = new Enemy("Imp", 100, 10, 300);
Simple and beautiful and useful because you can extend the Enemy class further and get everything needed with one line from the array.
Last edited by hatu; 10-07-2008 at 01:08 PM.
-
Flash Incompetent
I decided to go with XML for now, as it seems to do the job. Currently it's being loaded from an external file but I'm curious just for hypothetical(if I were to EVER finish a game) and I wanted to upload to a site like newgrounds, I presume they don't accept xml files separately, so my xml would have to be in a dedicated location and I'm curious if that's true, would I have to worry about bandwidth? (not that I'm saying my game would be so awesome that I'd have billions of views, just curious if its something one would have to take into consideration)
Anyways, thanks for all the input, feel free to continue discussing!
ChaseNYC
-
if the server is crap,- just upload the xml on your server. Be sure though to add the server policy XML file too otherwise you can't load data from other servers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|