Jump to content

Importing game info into DB


sheeppimpdaddy

Recommended Posts

Hi

 

I'm relatively new to PHP, only really done reverse engineering of code snipets but i've got myself stuck :(

 

I want to take some game data and insert it into 3 seperate SQL DB's With the ability to cross reference between each DB. The DB's will be Players, Planet, Alliance (I'll work on the interface to link all 3 data blocks after i've learned this and coded the meat of the others)

 

To start i'll try the planets DB. I've uploaded a full system and an empty one to show comparison.

 

I need to target the last blocks of info which start on different lines depending on how many planets are colonized in that system. They start with for example with [12:385:01]. The 12 is galaxy no, the 385 is solar system and the 1 is planet no. There are 14 galaxies with 400 solar system per galaxy and 16 planets per solar system, so a lot of data and manual inputs :D

 

This block then needs to be input into the DB's in the appropriate places to be recalled at a later date. As the number of planets is fixed i suppose the DB could be set up before hand with the planet list and then added to when the systems are manually input into this script (aint got a clue)

 

the data bits i need:

 

planet location - planet name

owner/player name

Temp

Alliance

 

I guess it would have to be done with an if statement as any planet that is Uninhabited has none of this data and the script might throw a paddy at this bit.

 

If anyone can help it'd be much appreciated I just don't have a clue where to start or how to do it :(

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/176307-importing-game-info-into-db/
Share on other sites

Are you asking how to automate the process of taking all that textual data and inserting it into tables in a database? If so, I would suggest using regular expressions to parse your text files and then put insert the data.

 

Depending on what type of information you need about each tier of your planet system, you might want a separate table for planets, galaxies and solar systems.

 

Are you looking for tutorials?

Are you asking how to automate the process of taking all that textual data and inserting it into tables in a database? If so, I would suggest using regular expressions to parse your text files and then put insert the data.

 

Depending on what type of information you need about each tier of your planet system, you might want a separate table for planets, galaxies and solar systems.

 

Are you looking for tutorials?

 

Unfortunately I need to paste each system in by hand for the script to place into the DB, any other method would get me banned from the game :(

 

Basically each planet will have an espionage report which i'd like to link eventually and then each player needs to be linked to both, planets and alliances. But i thought if i could get this working right then i would be able to work the rest out with a little guidance (tis the way i learn by trial and error :D) as most of the coding will be similar so easy to change as long as i understand why the code does what it does :D

 

Because i don't know php that well, i don't know what to look for in tutorials. Even worse I don't even know the function i'd need to target a piece of text and put that in a DB lol.

 

The DB side of things i can research as thats kinda simple to look for i know what it is lol.

i've found an easier way to present the data to the script :D yippee lol

 

I can now go line by line which makes things easier for me, and i've already found a member who had this way explained to them so i kinda got a good idea when i get most of the code done and working i'll post in here to show how i'm getting on :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.