Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Skill Points Help

I'm trying to do a remake of another game, which will remain nameless. The only problem is that I need a way to give each character a skill point every time they level up, and give new characters x skill points when they join, when x=character's level. Any help is helpful...
 

oboys

Member

Wrong forum. You can easily do this with events by having an event variable per character storing the number of points that have been used so far. The number of remaining points is then the level minus the number used. You may then construct the usual map with events for spending the points.

A trick for event systems:
Unfortunately, you cannot have event commands affect a character specified by a variable. This complicates matters since you then will have to repeat commands with minor changes. There are more or less sophisticated ways to deal with it (I don't know how eventers deal with it). The simplest, and dirties, is to insert an extra line 20 in Game_Actors:
Code:
 

actor_id = $game_variables[1] if actor_id == 9

 
This makes it so that whenever you select actor number 9 in an event command, it will actually mean actor number X where X is the contents of variable 1.
Example:
@>Parameters [9th char], Attack + 10
@>Control Variables [0001] += 1
Go up to this event and use it. The first time, nothing will happen (cause the variable is 0 and there's no actor number 0). The second, Ralph (#1) will get an extra 10 attack. The third, Ulrika (#2) will get an en extra 10 attack, etc.

This should simplify your events considerably.
 
oboys":1tokgogm said:
Wrong forum. You can easily do this with events by having an event variable per character storing the number of points that have been used so far. The number of remaining points is then the level minus the number used. You may then construct the usual map with events for spending the points.

A trick for event systems:
Unfortunately, you cannot have event commands affect a character specified by a variable. This complicates matters since you then will have to repeat commands with minor changes. There are more or less sophisticated ways to deal with it (I don't know how eventers deal with it). The simplest, and dirties, is to insert an extra line 20 in Game_Actors:
Code:
 

actor_id = $game_variables[1] if actor_id == 9

 
This makes it so that whenever you select actor number 9 in an event command, it will actually mean actor number X where X is the contents of variable 1.
Example:
@>Parameters [9th char], Attack + 10
@>Control Variables [0001] += 1
Go up to this event and use it. The first time, nothing will happen (cause the variable is 0 and there's no actor number 0). The second, Ralph (#1) will get an extra 10 attack. The third, Ulrika (#2) will get an en extra 10 attack, etc.

This should simplify your events considerably.

This is not what I'm looking for. I need something that will add a variable every time I level up, because the skills will be completely different depending on character. For instance - Character 1's skills: Fireball, Firewall, Firestorm. Each time you level up, you can use points in any of the 3 skills.
 

oboys

Member

Example:
UseCountChar1 = 0.
If Char 1 level = 10, then there are 10 - 0 = 10 points left.
Let's say 5 points are used so that UseCountChar1 is set to 5.
If Char 1 level = 10, then there are 10 - 5 = 5 points left.
If Char 1 level = 11, then there are 11 - 5 = 6 points left.
Let's say 3 points are used so that UseCountChar1 is set to 8.
If Char 1 level = 11, then there are 11 - 8 = 3 points left.
Note that you do not need to change anything when they level up, only when points are used. This is easier to do with events.

You would of course keep one variable per character. UseCountChar1, UseCountChar2, ... To handle the separate skill trees, you simply devote a different map or different region of a map for the various characters. Take a look at how other games implement skill trees with events.
 
oboys":jm6sn33t said:
Example:
UseCountChar1 = 0.
If Char 1 level = 10, then there are 10 - 0 = 10 points left.
Let's say 5 points are used so that UseCountChar1 is set to 5.
If Char 1 level = 10, then there are 10 - 5 = 5 points left.
If Char 1 level = 11, then there are 11 - 5 = 6 points left.
Let's say 3 points are used so that UseCountChar1 is set to 8.
If Char 1 level = 11, then there are 11 - 8 = 3 points left.
Note that you do not need to change anything when they level up, only when points are used. This is easier to do with events.

You would of course keep one variable per character. UseCountChar1, UseCountChar2, ... To handle the separate skill trees, you simply devote a different map or different region of a map for the various characters. Take a look at how other games implement skill trees with events.

I'm having a hard time following what your saying. What variable is used? Which character is that for?
 

oboys

Member

Presumably Character 1 since the points are compared with the level of Character 1. Note that my last past was an example of what I wrote in my first post, "You can easily do this with events by having an event variable per character storing the number of points that have been used so far. The number of remaining points is then the level minus the number used. You may then construct the usual map with events for spending the points."

Another option would be to allocate a batch of variables to be skill point variables. For instance, to let Variable 101 be the skill points that Actor 1 has, Variable 102 the skill points Actor 2 has, etc. You may want to avoid using the variables in 100-199 for other purposes. To have these variables update, simply add to Game_Actor's level_up and level_down methods:
$game_variables[100 + @actor_id] += 1 # or -= 1 for leveling down
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top