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.

Can someone help pointing me in the right direction?

Hi,

A while ago, i submitted a script request, and it doesn't seem like anyone is willing/can help me with it, so i decided to give it a try myself.(after all, it will be good practise for me! :smile:)

What i'm trying to make is a script, that gives the player a "victory point" everytime he wins a battle. the player can then open up the menu, select "customization" and choose a character he wishes to customize. The he can spend theese points to increase the characters stats, or spend them to learn new skills.

The stats are the same for all the characters, but i want the skills to be different depending on what class the characters are. for exaple:
You choose to customize a fighter, in the customization/stats window, it looks the same as for every other character... but in the customization/skills window it will only show skills that the class fighter can learn.
I would also like for it to be so new skills will show up, when the fighter reaches certain levels, and the same for every other class..

I'm certainly not asking you to make the whole script for me, i just need some pointers and tips, on how i could make this happen.
If you have any ideas, big or small, please share them!
I've already started, it's not much, but i have a start! :wink:

Here is the link to the script request, it has more explanation of the script i'm trying to make, it also has pictures, so you can see what i'm trying to do:
Victory points and attributes/skill customization.

Once again, i'm NOT asking you to make the script for me  :tongue2:
Thanks for reading my post.

Over and out - Gando
 

khmp

Sponsor

First thing I would look into is preventing the usual skill learning. So I would take a look at, Game_Actor.initialize, Game_Actor.exp=. Or I could just override Game_Actor.learn_skill with an empty method, but I would keep in mind the game will still use this method through certain event commands. So I probably shouldn't do that.

This piece of code gets me all the skills a class can learn. I would use it to determine what skills are available to the user.
Code:
$data_classes[class_id].learnings

Lets determine all the skill that we can possibly learn.
Code:
# This Array will hold every possible skill the actor's class can get based on level.
possible_skill_ids = []
# Iterate through the skills of this class
$data_classes[actor.class_id].learnings.each do |skill|
  # If we meet the skill level requirements then add the skill. 
  if skill.level <= actor.level
    possible_skill_ids << skill.skill_id
  end
end

Let's filter out what the actor already knows and what he doesn't.
Code:
# Cut out the skill ids that the user already possesses.
unlearned_skill_ids = possible_skill_ids - actor.skills
# If you're worried about repetition. Filter out repeating elements.
unlearned_skill_ids.uniq!

Now lets get the actual skills.
Code:
# Create the array that will hold the skills.
skills = []
# Iterate through each skill the actor hasn't yet learned.
unlearned_skill_ids.each do |skill_id|
  # If the skill is nil don't add it just move onto the next one.
  next if $data_skills[skill_id].nil?
  # Add the skill into our Array.
  skills << $data_skills[skill_id]
end

Now the Array "skills" contains all the skills specific to an actor's class that he doesn't already know. I would read up on RPG::Skill to figure out how I need to access it to get certain information. Probably name, icon, description. Lastly I would definitely take a look at Window_Skill to see how they do some things.

Good luck with it Gando! :thumb: I'm glad that you are attempting something like this.
 
Nice! exactly what i needed.
I'm gonna try to make something out of this and play around a little bit with my script^^
I'll let you know how it goes! :thumb:
Thanks!

- Gando
 

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