Event not working right

I just had another issue with this event solved in another topic but this question seems unrelated enough that I thought it'd be best to start a new topic to ask it.


I have a custom level up event set up for all my actors and in that event they should learn skills based on their stats. That works fine, I can get each actor to level up and the first skill you learn will not be learned again when you level up after you learn it the first time; that is exactly what I want to happen. My problem is with skills 2 and above. Even after learning them; and yes I checked the actor does learn the skills, they tell you every time you level up that you learned those skills again. Every skill is set up the same so I don't know where my problem is. Here is a screen shot to show you the event.


Variable 490 is the partymember number, and variable 486 is the skill id number.


This is the branch script🙁I didn't use the forum code option because for some reason it leaves out the zeros)


$gameParty.members()[$gameVariables._data[490]].skills().indexOf($dataSkills[$gameVariables._data[486]]) != 0;


Event Set Up.png


The first one you see in this event works perfectly, it's only learned once. All of the others are learned every time you have their required stat points and I don't know why?


Thank you for any help.
Have you tried switching the Conditional Branch: actorStats_ATK >= 5 (10, etc.)? Because basically this is saying if it is 5, do this...also if it is 6 do the same thing. If 7.... If 8... all the way to 10. Then the next one is the same thing. If you set it to actorStats_ATK == 5 (10, etc.) it should only do it once. I'm not sure why it would do it once the first time but continuously the second time, could be a glitch. Not sure if this will fix your problem, but that's what I would try.
Have you tried switching the Conditional Branch: actorStats_ATK >= 5 (10, etc.)? Because basically this is saying if it is 5, do this...also if it is 6 do the same thing. If 7.... If 8... all the way to 10. Then the next one is the same thing. If you set it to actorStats_ATK == 5 (10, etc.) it should only do it once. I'm not sure why it would do it once the first time but continuously the second time, could be a glitch. Not sure if this will fix your problem, but that's what I would try.

Thanks but I need it to work if it's higher than 5 as well. I don't want the player missing that ability because they have 6 atk instead of 5.
Thanks but I need it to work if it's higher than 5 as well. I don't want the player missing that ability because they have 6 atk instead of 5.

I was afraid you'd say that. lol. What about putting another conditional on there that checks if the skill has been learned yet, and if it has been, then obviously do nothing, otherwise learn the skill + message?
I was afraid you'd say that. lol. What about putting another conditional on there that checks if the skill has been learned yet, and if it has been, then obviously do nothing, otherwise learn the skill + message?

That's what that first conditional branch should do.
That's what that firat conditional branch should do.

Stupid question then: Are you changing the "486" everytime?


Nevermind, I realised what you did there. What about then changing the Control Variable by +1 everytime you learn a skill?
Stupid question then: Are you changing the "486" everytime?


Nevermind, I realised what you did there. What about then changing the Control Variable by +1 everytime you learn a skill?

The skill variable is set to the skill ID that the conditinal branch is checking.


So the second skill I have there for example, the variable is set to skill 6 which then the event checks to see if the actor does not know that skill.


If they don't then the skill is taught to the actor, if they know the skill already it should skip teaching the player the skill and check the next one.


For some reason this doesn't work past the 1st skill and the player learns skill 2 and up every time.
For some reason this doesn't work past the 1st skill and the player learns skill 2 and up every time.

Okay, I know I don't have a fix, but I always trouble shoot my problems, so sorry for throwing things out there. That almost sounds like you are creating an array somehow and by calling to check 486, it checks the whole array. Weird. Also, any reason you decided to use script calls instead of just straight up variables?
Okay, I know I don't have a fix, but I always trouble shoot my problems, so sorry for throwing things out there. That almost sounds like you are creating an array somehow and by calling to check 486, it checks the whole array. Weird. Also, any reason you decided to use script calls instead of just straight up variables?

I appreciate your help.


The reason I'm using script calls is because it shortens the event. Without the scrip call I can't have it check the actor based on a variable and I can't have it check if a skill is not learned.
Without the scrip call I can't have it check the actor based on a variable and I can't have it check if a skill is not learned.

I understand you want a shorter event, but you should be able to check all that with variables. It looks like you have one of these scripts set up for each individual character, right?


Variables ---> Game Data ---> Party ---> Member #'s ID <---you actually won't need this.


Variables ---> Game Data ---> [Hero]'s ---> ATK


Conditional Branch ---> [Hero] ---> Skill learned


You can simply put 2 conditional branches like you have now that should do the same thing:


Conditional Branch: [Hero] is [Skill] learned


    Conditional Branch: Variable [0001: HeroATK] >= 5
I understand you want a shorter event, but you should be able to check all that with variables. It looks like you have one of these scripts set up for each individual character, right?


Variables ---> Game Data ---> Party ---> Member #'s ID <---you actually won't need this.


Variables ---> Game Data ---> [Hero]'s ---> ATK


Conditional Branch ---> [Hero] ---> Skill learned


You can simply put 2 conditional branches like you have now that should do the same thing:


Conditional Branch: [Hero] is [Skill] learned


    Conditional Branch: Variable [0001: HeroATK] >= 5

Yeah that was how I was originally going to do it but I decided against it because I have 70 skill that any of the actors can learn and I'd like to keep at much as possible from having to change in each event. 


I have 12 characters, each with their own level up event, and 70 skills that any of them can learn. The way this is set up now, it can tell who's leveling up and who's learning what skill on its own just by copy and pasting this event into the other characters level up events.


If I can't find another solution I will set it up as you suggested, I was just hoping to avoid that many changes per event.

Original thread: https://forums.rpgmakerweb.com/threads/event-not-working-right.60473/