Need help With Yanfly Skill Core

Aries-The-Fool

Villager
Member
Joined
Feb 13, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
am currently making a partner special similar to the ones used in Neptunia Rebirth, I want to restrict the skill with custom requirement by checking if not only that the two required party members are alive but also if they are in Battle/Active members.

I tried finding a solution on my own but I keep getting errors, am not really experienced with js code but I try what I can to use what I do know.

<Custom Requirement>

if !$gameActors.actor(1).isStateAffected(1)) and !$gameActors.actor(2).isStateAffected(1) {

value = true;

} else {

value = false;

}

</Custom Requirement>
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
It would help if you tell people what errors you keep getting...
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
The general idea is correct with your code, but two syntax issues to work on:

  1. There is no 'and' keyword in JavaScript. The correct syntax for 'and' is &&
  2. The parentheses aren't quite correct on your conditional statement, for example you have 4 'left' parentheses and 5 'right' parentheses in the same conditional statement, those have to be the same amount of course. And the whole conditional statement should be surrounded by one set of parentheses
 

Aries-The-Fool

Villager
Member
Joined
Feb 13, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
The general idea is correct with your code, but two syntax issues to work on:

  1. There is no 'and' keyword in JavaScript. The correct syntax for 'and' is &&
  2. The parentheses aren't quite correct on your conditional statement, for example you have 4 'left' parentheses and 5 'right' parentheses in the same conditional statement, those have to be the same amount of course. And the whole conditional statement should be surrounded by one set of parentheses
Worked flawlessly! thanks for the help, do you happen to know where I can look up other javascript keywords? I feel like i'm going to encounter another issue like this eventually so having a good place to search for correct keywords would help a lot.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
any of the hundreds or thousands of javascript academies and tutorials around the internet.
Javascript is one of the languages used for programming websites after all
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
am currently making a partner special similar to the ones used in Neptunia Rebirth, I want to restrict the skill with custom requirement by checking if not only that the two required party members are alive but also if they are in Battle/Active members.

I tried finding a solution on my own but I keep getting errors, am not really experienced with js code but I try what I can to use what I do know.

<Custom Requirement>

if !$gameActors.actor(1).isStateAffected(1)) and !$gameActors.actor(2).isStateAffected(1) {

value = true;

} else {

value = false;

}

</Custom Requirement>

<Custom Requirement>
if ( $gameParty.aliveMembers().contains($gameActors.actor(1)) && $gameParty.aliveMembers().contains($gameActors.actor(2)) ) {
value = true;
} else {
value = false;
}
</Custom Requirement>
 

Aries-The-Fool

Villager
Member
Joined
Feb 13, 2018
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
<Custom Requirement>
if ( $gameParty.aliveMembers().contains($gameActors.actor(1)) && $gameParty.aliveMembers().contains($gameActors.actor(2)) ) {
value = true;
} else {
value = false;
}
</Custom Requirement>
That's an even better solution thanks!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top