evilsaigon

Veteran
Veteran
Joined
Apr 27, 2014
Messages
36
Reaction score
12
First Language
English
Primarily Uses
Hi. I have complete zero knowledge in programming, and I always use events to get what I want. But now, I'm stuck at notetag strings. I'm using Yami's Skillshop plugin, link: http://yed.yami.moe/yed-skill-shop/

The plugin basically allows skills to be bought in a skill shop, and imposing requirements before you can purchase by adding script calls in the skill's notetag.

Problem is I have no idea how to set the requirement strings as "either or"... that means among the listed requirement strings, as long as one of them is fulfilled, the skill can be purchased. For example, this is what I have in my skill's notetag:

<Buy Custom Require>

$gameSwitches.value(17, true)

$gameSwitches.value(18, true)

$gameSwitches.value(19, true)

actor.level > 4

</Buy Custom Require>

In this notetag, game switch number 17 and 18 and 19 must be turned on, and the actor's level must be above 4. Then the skill can be purchased for that actor.

However, what I need is (as long as switch 17 OR 18 OR 19 is turned on) AND actor's level is above 4, skill can be purchased for actor.

How do I type this boolean "or" operation in the notetag? T_____T
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,436
Reaction score
10,868
First Language
German
Primarily Uses
RMMV
I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,699
Reaction score
945
First Language
English
Primarily Uses
N/A
Looks like the notetag is evaluated as JS itself, so the easy way to do it would be to separate the condition by the OR syntax, ||. After briefly looking at the plugin, I would imagine that this should work:

<Buy Custom Require>$gameSwitches.value(17, true) || $gameSwitches.value(18, true) || $gameSwitches.value(19, true)actor.level > 4</Buy Custom Require>From what I can tell, the plugin splits notetags by new lines, so to make an OR condition, you have to have them on the same line, separated by OR ( || ).
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
896
First Language
German
Primarily Uses
RMMZ
Notetags are parsed and interpreted by the plugin, so there is no universal approach to add something. You should ask Yami directly, how to do this.
 

evilsaigon

Veteran
Veteran
Joined
Apr 27, 2014
Messages
36
Reaction score
12
First Language
English
Primarily Uses
@Andar Ah sorry, my bad. Thanks for helping me move!

@Zalerinian Ah so it's the syntax || that functions as "or" condition. Yes it worked nicely, thanks!!
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,088
Reaction score
2,690
First Language
Greek
Primarily Uses
RMMZ
@Zalerinian Ah so it's the syntax || that functions as "or" condition. Yes it worked nicely, thanks!!
You didn't know? :D

&& stands for AND

|  |  stands for OR

!    stands for NOT

As for  XOR... just forget about it for now...

If you will ever need one, check stackoverflow :p
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
896
First Language
German
Primarily Uses
RMMZ
XOR would work like this:

Code:
!(expr1) != !(expr2)
 

evilsaigon

Veteran
Veteran
Joined
Apr 27, 2014
Messages
36
Reaction score
12
First Language
English
Primarily Uses
@lavra I was thinking it should be a commonly used operator by rpg makers, and also I don't see any replies to recent commenters' questions since it's an older plugin, so I thought I'd try my luck here. xD 

@Dreadshadow Those booleans would be helpful for total noobs like me haha.

@lavra I tried your XOR expression (I believe google says it stands for exclusive OR)

<Buy Custom Require>

!($gameSwitches.value(17, true)) != !($gameSwitches.value(18, true))

</Buy Custom Require>

So it ends up when (switch 17 on AND switch 18 off) OR (switch 17 off AND switch 18 on), skill can be purchased.

I can't use for now since I have more than 2 expressions, and they are independent of each other. But interesting point! 
 

Latest Threads

Latest Posts

Latest Profile Posts

Sorry Kitty...I'm practicing my harmonics. RIP your ears.
I noticed they now have a Gremlins cartoon. Nothing like striking when the iron is hot then trying to make a reboot from a movie made 34 years ago.
Up to 40,000,000 people just became felons by bureaucratic decree today in the US. If you own certain configurations of plastic and velcro, best make sure you aren't risking 10 years behind bars. Just had to take back my mom's mothers day gift from three years ago. Fun times, thanks unelected bureaucrats.
Someone help me, how to Failed to load img/system/Window%20%20%E5%89%AF%E6%9C%AC%20(2) .png in joiplay emulator on android
Someone please post some beginner problems so I can act like I'm a veteran and know what I'm doing? (Also someone please stop @Andar and @ATT_Turan from posting on them because they are way too fast?!)

Forum statistics

Threads
131,581
Messages
1,221,230
Members
173,279
Latest member
HorsesEatJellyfish
Top