H
Halas
Guest
So I am trying to learn Arrays, and it definitely is something that is hard to wrap my mind around.
What I am trying to do is create an array for an RPG character to handle his levels and stats.
So each level, the player will get one ability point to put into stats.
What I have so far, is not much at all. haha, but please let me know if I am doing this correct and what my next steps would be.
I have an object that if the player picks up, gets experience.
if not instance_exists(other) exit;
audio_play_sound(a_expr, 1, false);
with (other)
{
experience += 1;
if (experience >= max_experience)
{
level += 1;
experience = experience - max_experience;
max_experience += max_experience;
Cabilitypt += 1;
}
now, for the array. Where and how should I set this up?
I'd like it to be something like.
If (Cabilitypt <= 1)
{
Levelup_script;
}
Levelup_script
Now I need to add in, I think strings to draw the choices and for the player to select the choice. Am I heading in the correct direction?
What I am trying to do is create an array for an RPG character to handle his levels and stats.
So each level, the player will get one ability point to put into stats.
What I have so far, is not much at all. haha, but please let me know if I am doing this correct and what my next steps would be.
I have an object that if the player picks up, gets experience.
if not instance_exists(other) exit;
audio_play_sound(a_expr, 1, false);
with (other)
{
experience += 1;
if (experience >= max_experience)
{
level += 1;
experience = experience - max_experience;
max_experience += max_experience;
Cabilitypt += 1;
}
now, for the array. Where and how should I set this up?
I'd like it to be something like.
If (Cabilitypt <= 1)
{
Levelup_script;
}
Levelup_script
Code:
/// Create Choices
/// Character Stats 2D Array
/// 0-Levels (50)
/// 1-Vitality (Health, Stamina)
/// 2-Intelligence (Mana, Spell damage)
/// 3-Strenght (Melee Damage)
/// 4-Dexterity (Ranged Damage)
/// 5-Defence (Reduced Damage taken)
/// Initialize
for (var i = 50; i < array_height_2d(Player_Stats); ++i;)
{
for (var j = 6; j < array_length_2d(Player_Stats, i); ++j;)
{
Player_Stats[i, j] = -1;
}
}
Now I need to add in, I think strings to draw the choices and for the player to select the choice. Am I heading in the correct direction?