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
39,147
Reaction score
12,420
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
39,147
Reaction score
12,420
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 Posts

Latest Profile Posts

Kes
Came up with a good name for something. Checked on internet - device trademark filed in India 2017. Back to the drawing board.
I want to see the Features of the new RPG Maker.. NOW!!
Can't wait for it!
KDS
Check out some gameplay of a game iam working on :)
Me : "Wearing glasses is annoying."
*put out glasses*
Also me : "Keep mistaking 0, 6 and 8."
oh god, a new version of RPG Maker is coming soon already....

Forum statistics

Threads
98,126
Messages
949,491
Members
129,407
Latest member
DCHang
Top