check if party has a certain skill

ReyBen47

Villager
Member
Joined
Jul 1, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
Hello I need help im trying to figure implement a system similar to xenoblade 2's field skill system and i've encountered to problems using the conditional branch system

1. the checks have to be specific to a character when i want them to be able to be fulfilled by any character

2. checks are being fulfilled even though the only actor who has it base isn't in the party

I don't have any experience with java so i don't know if this can be fixed by writing my own script
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
$gameParty.battleMembers().some(function(actor) { return actor.hasSkill(x); })

where x is the id of the skill, with no leading zeros.

battleMembers() will restrict it to only the first 4
some() will look at everyone and return true if just one meets the requirements

If you only want to look at your living battlers, use this instead:
$gameParty.battleMembers().some(function(actor) { return actor.isAlive() && actor.hasSkill(x); })

And it's Javascript, not Java. They are two very different languages :)
 

ReyBen47

Villager
Member
Joined
Jul 1, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
$gameParty.battleMembers().some(function(actor) { return actor.hasSkill(x); })

where x is the id of the skill, with no leading zeros.

battleMembers() will restrict it to only the first 4
some() will look at everyone and return true if just one meets the requirements

If you only want to look at your living battlers, use this instead:
$gameParty.battleMembers().some(function(actor) { return actor.isAlive() && actor.hasSkill(x); })

And it's Javascript, not Java. They are two very different languages :)
Thank you for replying so fast! it doesn't appear to be working im not sure i've put it in right

◆If:Script:$gameParty.battleMembers().some(function(actor) { actor.hasSkill(65) })
◆Play SE:Saint5 (90, 100, 0)
◆Text:Conall(0), Window, Bottom
: :Leave it to me!
◆Fadeout Screen
◆Play SE:Switch1 (90, 100, 0)
◆Wait:60 frames
◆Play SE:Switch1 (90, 100, 0)
◆Wait:60 frames
◆Play SE:Switch2 (90, 100, 0)
◆Wait:30 frames
◆Play SE:Switch3 (90, 100, 0)
◆Play SE:Chest1 (90, 100, 0)
◆Control Variables:#0021 Lockpicking times += 1
◆Control Self Switch:A = ON
◆Fadein Screen

:Else
◆Play SE:Cancel2 (90, 100, 0)
◆Text:None, Dim, Bottom
: :Lockpicking Traverse Skill Lv1 required

:End
An actor has the skill so I don't know where to go from here.
thank you again for your help!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
ah, you got my post before I added a correction (but you quoted the corrected version :D ). Please look at it again and change your condition to what's there now.
 

ReyBen47

Villager
Member
Joined
Jul 1, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
RMVXA
ah, you got my post before I added a correction (but you quoted the corrected version :D ). Please look at it again and change your condition to what's there now.
It works! thanks a ton!
 

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,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top