Database Struct Generator (DSG) - *Now uses arrays*

You must understand the Game Editor concepts, before post here.

Database Struct Generator (DSG) - *Now uses arrays*

Postby Hblade » Wed Jan 16, 2013 4:46 am

Welcome! I'm happy to release DSG for those who want to quickly set up a large struct database, literally you can create over a million structs with a breeze.

Why is this useful?
Imagine, you can instantly create 30 enemy types, easily create player types, item types, you name it using this.

How it works:
This generates a file of your choice, and structs of your choice into a file. Open the file or import the .c file into Game Editor global code.




Screenshot:
screen.png



Example output:
Code: Select all
struct UserData {
    //your vars here
    int tempvar;
};
struct UserData StructDataArray[15];
#define usrData0 StructDataArray[0]
#define usrData1 StructDataArray[1]
#define usrData2 StructDataArray[2]
#define usrData3 StructDataArray[3]
#define usrData4 StructDataArray[4]
#define usrData5 StructDataArray[5]
#define usrData6 StructDataArray[6]
#define usrData7 StructDataArray[7]
#define usrData8 StructDataArray[8]
#define usrData9 StructDataArray[9]
#define usrData10 StructDataArray[10]
#define usrData11 StructDataArray[11]
#define usrData12 StructDataArray[12]
#define usrData13 StructDataArray[13]
#define usrData14 StructDataArray[14]


hope this helps

In action Example:
Code: Select all
struct UserData {
    int hp, mp, atk, def, mag, agil, luck, xpdrop, golddrop;
    char*name;
};
struct UserData StructDataArray[5];
#define monster0 StructDataArray[0]
#define monster1 StructDataArray[1]
#define monster2 StructDataArray[2]
#define monster3 StructDataArray[3]
#define monster4 StructDataArray[4]





void SetData()
{
    monster0.name="Goomba";
    monster0.hp=05;
    monster0.mp=02;
    monster0.atk=03;
    monster0.def=03;
    monster0.mag=02;
    monster0.agil=03;
    monster0.luck=05;
    monster0.xpdrop=15;
    monster0.golddrop=25;
 
    monster1.name="Green Koopa";
    monster1.hp=10;
    monster1.mp=05;
    monster1.atk=05;
    monster1.def=05;
    monster1.mag=04;
    monster1.agil=07;
    monster1.luck=07;
    monster1.xpdrop=25;
    monster1.golddrop=35;

    monster2.name="Red Koopa";
    monster2.hp=15;
    monster2.mp=12;
    monster2.atk=13;
    monster2.def=13;
    monster2.mag=12;
    monster2.agil=13;
    monster2.luck=15;
    monster2.xpdrop=35;
    monster2.golddrop=65;
 
    monster3.name="Blue Koopa";
    monster3.hp=25;
    monster3.mp=22;
    monster3.atk=23;
    monster3.def=23;
    monster3.mag=22;
    monster3.agil=23;
    monster3.luck=25;
    monster3.xpdrop=55;
    monster3.golddrop=95;

    monster4.name="Yellow Koopa";
    monster4.hp=35;
    monster4.mp=32;
    monster4.atk=33;
    monster4.def=33;
    monster4.mag=32;
    monster4.agil=33;
    monster4.luck=35;
    monster4.xpdrop=75;
    monster4.golddrop=115;
}


I quickly was able to set up at least 5 basic enemies.

Download:
GENERATOR.zip
(59.44 KiB) Downloaded 144 times
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Database Struct Generator (DSG) - *Now uses arrays*

Postby gamemakerdude » Thu Jan 17, 2013 4:57 am

hey this is pretty sweet! thanks hblade
User avatar
gamemakerdude
 
Posts: 72
Joined: Thu Sep 13, 2012 4:12 pm
Location: Texas
Score: 7 Give a positive score

Re: Database Struct Generator (DSG) - *Now uses arrays*

Postby Hblade » Thu Jan 17, 2013 6:59 am

glad you like it =)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron