Forget a random skill [RMVX ACE] [Solved]

Devildimos

I ruin memes for a living
Veteran
Joined
Jul 11, 2014
Messages
82
Reaction score
172
First Language
Eglish
Primarily Uses
RMVXA
Good day ladies and gentlemen.

I am looking for a way to forget a random skill that an actor knows.
Like you get amnesia and you start forgetting things...
But using a variable and make it do a random 1-999 or in my case 1-3000 has a BIG chance to not forget any skills that a actor learned.
However. Some skills I do not want to be forgotten. So we need a bit of control here.
I know I could do this with common event branch but I am not sure if I can get it to work accurately.
Let me just mention that I have over 219 spell and 153 special skill that a single actor could learn.

How can we do this?
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Easy. Put this as a new script.
Code:
class RPG::Skill
  def unforgetable
    note.include?("<unforgettable>")
  end
end

class Game_Actor
  def forget_random_skill
    s_id = @skills.select {|id| !$data_skills[id].unforgetable}.shuffle.shift
    forget_skill(s_id) if s_id
  end
end
Tag your skill you don't want them to get forgotten with <unforgettable>.
To make an actor forget a random skill, use script call $game_actors[actor_id].forget_random_skill
Replace actor_id with your actor id.

Disclaimer: Not tested.
 

Devildimos

I ruin memes for a living
Veteran
Joined
Jul 11, 2014
Messages
82
Reaction score
172
First Language
Eglish
Primarily Uses
RMVXA
Thank you for your fast replay Theoallen.
So far it works great and everything functions.
I love it when I hear someone say... "Easy"
And we none-scripters sit here going branch by breach for each skill...
And you just make it work with 12 lines. :aswt:
Thank you very much.
Disclaimer: tested
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top