Importing .csv into RMXP database

Started by Memor-X, July 18, 2013, 09:35:02 pm

Previous topic - Next topic

Memor-X

in my game, there is 500 skills i need to make, a lot aren't unique and are just different variations, ie. (using Blizz-ABS)

5 skills are of a particular type of attack (shoot, direct, shockwave)
each of the above 5 skills is of a different levels which each higher level having greater power and greater SP consumption
each element (Fire, Ice, Water) has all types of attacks

here is a sample using 2 elements, 2 attack types
Level 1 Fire Shoot
Level 2 Fire Shoot
Level 3 Fire Shoot
Level 4 Fire Shoot
Level 5 Fire Shoot
Level 1 Fire Direct
Level 2 Fire Direct
Level 3 Fire Direct
Level 4 Fire Direct
Level 5 Fire Direct
Level 1 Ice Shoot
Level 2 Ice Shoot
Level 3 Ice Shoot
Level 4 Ice Shoot
Level 5 Ice Shoot
Level 1 Ice Direct
Level 2 Ice Direct
Level 3 Ice Direct
Level 4 Ice Direct
Level 5 Ice Direct

now apart from the normal attack types that are in Blizz-ABS, i duplicate some to be slightly different, they are

Tracing: Single Homing Attack which is slow but has has a huge explosion (regular homing has normal speed and no explosion)
Blast: Single Direct with explosion and short charge time but long cooldown (normal direct has no explosion and long charge but short cooldown)

also, anything that uses direct attack types takes more SP and anything that targets all takes more SP and has greater attack in exchange for greater charge ups

i have 10 element, 10 attack types and 5 levels of spells, this means i need to create 500 skills which i can fit in the RMXP internal database, proablem is that it's painful cause so much little change is needed between 2 elements

now i can generate a .csv easily enough with all 500 skills, i've done so for MySQL scripts with more inserts than that, so i'm wondering if there is a way to import database into RMXP from a .csv file, and when i say import i don't just mean using an external tool, i also mean copying and pasting a huge chunk of data into the data files in the Data/ Folder since when i generate these 500 skills i can easily change the formatting of them for whatever RMXP need

ie. instead of name,desc,4,2 which is what you normally would have in a .csv file i could have it as Name['name'],Description['desc'],SPCost[4],Element[2] if that is the format RMXP recognizes

KK20

I'm not sure about the whole "reading in the .csv file" but you can make a script that runs before Main that uses a series of loops and stuff to generate all the skills and save it into Skills.rxdata. Then simply reopen the game project (without saving again before closing) and your database has the 500 skills.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Memor-X

Quote from: KK20 on July 21, 2013, 03:07:53 am
I'm not sure about the whole "reading in the .csv file"


it didn't have to be a .csv file, i just said .csv cause it's the easiest to generate and be accepted in most database tools

Quote from: KK20 on July 21, 2013, 03:07:53 am
you can make a script that runs before Main that uses a series of loops and stuff to generate all the skills and save it into Skills.rxdata. Then simply reopen the game project (without saving again before closing) and your database has the 500 skills.


sounds logical, what do i need to do, do i need to load up the skills.rxdata file then add to the variable like this

psudocode

$skills = load(skills.rxdata)
$skills[101] = Skill.new([DATA])


also, how do i save back to the file, is it just the same as creating a save game file but i reference the variable skills.rxdata went into?

KK20

Yeah, it's basically that, just with the proper syntax. And yes, saving data is just the methods File.open, Marshal.dump, File.close.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!