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
30,366
Reaction score
7,204
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,096
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
30,366
Reaction score
7,204
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 Profile Posts

Finally finished my first big game since joining the forums! Please check out Petal Knights! https://forums.rpgmakerweb.com/index.php?threads/petal-knights-playable-now.117898/
Back home now :cutesmile:

Many thanks to all my fellow game devs. for all the support during this crazy time.

Feeling a bit rough but much better then bein' hospitalized at least.

Now time to get back to the code :D
Added skill ranges, and very basic implementation of scope, with a rule called "empty tile" that simply returns true if the selected tile is empty (has a battler), and false otherwise


This means movement range and attack ranges are all automatically implemented.

More info: https://himeworks.itch.io/grid-battle-system/devlog/167442/devlog-3-basic-skill-range
Stone masons are hard at work creating beautiful sculptures for your games...
When you realize @Kupotepo is a champion among RM Web users, and it all makes sense now:

Forum statistics

Threads
100,465
Messages
976,273
Members
132,082
Latest member
nwr
Top