Help With Condition Scripting

Missing

Warper
Member
Joined
Mar 13, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Hey, everybody, I'm new here. I've just decided to dive into MV and needed some help with a particular problem I'm having.


My basic goal is to be able to dynamically check if a specific actor has a specific skill learned. Basically, I need to be able to set a variable, and then check if the actor who's index corresponds with that variable has learned a specific skill. So if I wanted to check if Actor 4 has Skill X, I could set the variable to 4. If the Actor in question has learned the skill, I would turn a specific switch on.


After doing my own research into this, I learned a few things. I know that it is possible to achieve the results I want using some long form eventing. I COULD create an individual conditional branch checking every actor for the skill I have in question. The problem is, I have a lot of skills that need checking, and more importantly, I have a LOT of actors that will need checking. To create conditional branches for every possible occasion would take forever. Don't get me wrong, I'm totally willing to do it the long way if necessary, but I wanted to see if this was possible using scripting first. 


Second, I think the following script call has something to do with what I'm trying to accomplish:


$game_actors[X].skills.include?($data_skills[Y])


However, I'm not entirely sure how to properly use this. Could I put this into the script option of the Conditional Branch action to create a custom condition? If so, could I possibly replace the actor index [X], with a variable? I could totally be barking up the wrong tree here, since my knowledge of such things is limited. 


If I'm being dumb, feel free to set me straight. Otherwise, thank you to anyone who is willing to help. 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
The syntax you've used is correct for Ace, but not for MV.


If you want the actor id in variable 5, and you want to know if they've learned skill 8, the correct command would be:

Code:
$gameActors.actor($gameVariables.value(5)).isLearnedSkill(8)
 

Missing

Warper
Member
Joined
Mar 13, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
The syntax you've used is correct for Ace, but not for MV.


If you want the actor id in variable 5, and you want to know if they've learned skill 8, the correct command would be:

Code:
$gameActors.actor($gameVariables.value(5)).isLearnedSkill(8)


This is exact thing that I needed. Thanks mate, you just saved me a lot of time and trouble. 
 

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top