Event Occurs Based only if Skill Type is in Party

Runako

Miracle/Magic
Veteran
Joined
May 22, 2012
Messages
126
Reaction score
25
First Language
English
Primarily Uses
RMMV
Hello everybody!!! :kaohi:

Its 12:48 am and I'm sure I'm not alone when I say that I'm grinding diligently on my RPG.:kaopride:

So, I did have a question on how to do something:

How can I unlock different events depending on if a Skill Type is in the party.

For example:
  • Skill type: Prayer is found among active party members
  • Player goes to talk to NPC
  • Possible responses to the NPC read: Listen (Skill type prayer unlocked this), Laugh, Ignore.
  • Let's say we lose the Actor with the Skill type: prayer.
  • Player goes to talk to NPC
  • Possible responses to the NPC now read: Laugh, Ignore
Thank you in advance!!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
There is probably some cunning script call you could make, but there is also a quick and dirty solution, if that helps.

Conditional branches, tab 2, does not contain skill type as such. However, if the actor with this skill type has even one skill before meeting this NPC, then you could use that as your check. But maybe there are several actors with this, and they do not all learn the same skill. In which case you could give them a passive state, without icon or description, and have the conditional check if that state is afflicted. Of course, this depends on you knowing who is in the party. If you don't, then you're back to the script call. As it's MV and I use Ace, I can't help you there.
 

Runako

Miracle/Magic
Veteran
Joined
May 22, 2012
Messages
126
Reaction score
25
First Language
English
Primarily Uses
RMMV
There is probably some cunning script call you could make, but there is also a quick and dirty solution, if that helps.

Conditional branches, tab 2, does not contain skill type as such. However, if the actor with this skill type has even one skill before meeting this NPC, then you could use that as your check. But maybe there are several actors with this, and they do not all learn the same skill. In which case you could give them a passive state, without icon or description, and have the conditional check if that state is afflicted. Of course, this depends on you knowing who is in the party. If you don't, then you're back to the script call. As it's MV and I use Ace, I can't help you there.
Thank you Me a for your insight. I do like the "quick and dirty". Its effective except my characters will be learning skills from their weapons. But I'm going to check it out for my details. Thank you for that!

I was thinking script calls as well. I'll need to take a look at the call list to see if there is anything that my signify a skill type script call.

At first I was thinking of having the character unlock different dialogue options, but for the sake of driving a life-life metaphor, I wanted to have the skill type unlock the dialogue choices.

Meaning, skill types coincide with concepts like: leadership, healing, prayer - So as long as the leadership Skill Type is unlocked amongst the party, then that dialogue choice would be available. But I want to go even further by enabling events contingent on skill type.

Lol. This is definitely my passion because I get excitement thinking about uncovering the solution.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
One step back: how do the actors gain the skill types?

There are several workarounds, but they're based on how the actors get their skills and skill types - the solution @Kes mentioned above for example won't work if the actors get skills from equipment, because those skills are not considered "learned" (because the actor looses them as soon as the weapon is unequipped).

In most cases I would suggest using other tokens that are activated at the same time the actor gets the skill types - this is one reason why there are "hidden items". You can create tokens as items and make them hidden - that will prevent them from ever being visible in the inventory.
However, the events will still react to the condition "item exists", even if that item is a hidden item - and that is much easier than using conditional branches.

However, if you're going this way you need to find a way to identify when the party gains the skill type and add the token item to the inventory at that moment. And there are a few other methods of handling this depending on how the skill types are gained.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
I would probably start with something like Hime's Hidden Choice Conditions plugin (his "Conditional Choice Text" plugin may also be useful to you). This way you can dynamically show or not show single choices, instead of having to make special conditional branches for menus showing "Pray and Proselytize", "Pray and Advise", "All 3", "Advise Only", etc.

As far as what JS expression you would need to determine whether at least one member has any "Pray" skill, I don't know it offhand. This is something you would have the best shot by asking in the "Learning JavaScript" subforum. You would need to look through each skill of each member in the party, and determine whether it's of the appropriate skill type (the skill type is most likely stored as a property of the skill itself). I can start you off: I think you could nest two some() blocks; additionally I believe the reference to your party members array is $gameParty.members() but I don't remember what the call to a member's skills would be.
 

Runako

Miracle/Magic
Veteran
Joined
May 22, 2012
Messages
126
Reaction score
25
First Language
English
Primarily Uses
RMMV
One step back: how do the actors gain the skill types?

There are several workarounds, but they're based on how the actors get their skills and skill types - the solution @Kes mentioned above for example won't work if the actors get skills from equipment, because those skills are not considered "learned" (because the actor looses them as soon as the weapon is unequipped).

In most cases I would suggest using other tokens that are activated at the same time the actor gets the skill types - this is one reason why there are "hidden items". You can create tokens as items and make them hidden - that will prevent them from ever being visible in the inventory.
However, the events will still react to the condition "item exists", even if that item is a hidden item - and that is much easier than using conditional branches.

However, if you're going this way you need to find a way to identify when the party gains the skill type and add the token item to the inventory at that moment. And there are a few other methods of handling this depending on how the skill types are gained.
In short, characters will obtain their [Spiritual] weapons from the bible. When they equipp the [Spiritual] Weapon (which is a scripture, like Luke 2:22), the longer they sit with the weapon or scripture, they familiarize the skill. I was planning at least that the Actors have innate skill types.

I think the hidden item idea is actually pretty effective. I hadn't given it any thought.

I would probably start with something like Hime's Hidden Choice Conditions plugin (his "Conditional Choice Text" plugin may also be useful to you). This way you can dynamically show or not show single choices, instead of having to make special conditional branches for menus showing "Pray and Proselytize", "Pray and Advise", "All 3", "Advise Only", etc.

As far as what JS expression you would need to determine whether at least one member has any "Pray" skill, I don't know it offhand. This is something you would have the best shot by asking in the "Learning JavaScript" subforum. You would need to look through each skill of each member in the party, and determine whether it's of the appropriate skill type (the skill type is most likely stored as a property of the skill itself). I can start you off: I think you could nest two some() blocks; additionally I believe the reference to your party members array is $gameParty.members() but I don't remember what the call to a member's skills would be.
Hime's Hidden Choice Condition is a great option. These suggestions will help me make the most sufficient choice!
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
722
Reaction score
578
First Language
French
Primarily Uses
This should do the trick:
Code:
$gameParty.members().some(function(actor){return actor.skills().some(function(skill){return skill.stypeId === 0})})
Change the 0 to the skill type id you want to check.
0 is skill type none and then the ids are the ones you set in editor via the skill type column in the types tab.
 

Runako

Miracle/Magic
Veteran
Joined
May 22, 2012
Messages
126
Reaction score
25
First Language
English
Primarily Uses
RMMV
This should do the trick:
Code:
$gameParty.members().some(function(actor){return actor.skills().some(function(skill){return skill.stypeId === 0})})
Change the 0 to the skill type id you want to check.
0 is skill type none and then the ids are the ones you set in editor via the skill type column in the types tab.
Gee! Thank you. I'm going to check this out tomorrow after work. Can't wait. This community is probably one of the healthiest May be!
 

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

Latest Threads

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,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top