• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Design Method of storing data sets, such as enemy info

S

Snayff

Guest
Evening all,

I am currently working on implementing skills and I wondered if there was any advice for what method to follow to do this. At the moment I am thinking of using an instance variable for each player attack which will hold the currently equipped skill's name. Then I would use that name to reference a data set (ds_map?).

So the basic process would be:
  1. Query which skill is equipped in the attack pressed
  2. Use that skill name to query the data set
  3. Retrieve information required such as damage, range

Does that sound reasonable? Are there more efficient methods of approach?

I have looked in to storign the data in a .csv or other external tool but I think the question regarding the method remains the same, regardless of what data set is being queried.

I look forward to hearing your thoughts! As ever, any feedback is appreciated.

-Snayff
 

Reign

Member
Use a ds_grid since it's faster and instead of using a key in the form of a string, use a numerical ID for each skill which you could define as an enum or global variable. After that, you could funnel the ID through a switch statement to retrieve or set the appropriate information with a script.


Not sure I understand what you're trying to do, but I'd do something like this->

enum Skills
{

pistol = 0,
shotgun,
rifle
}

var _skill = Skills.pistol;

switch(_skill)
{

case 0:
show_debug_message("pistol");
break;
case 1:
show_debug_message("shotgun");
break;
case 2:
show_debug_message("rifle");
break;
}
 
Last edited:
Top