evilsaigon

Veteran
Veteran
Joined
Apr 27, 2014
Messages
34
Reaction score
11
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
36,278
Reaction score
9,703
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
944
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
890
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
34
Reaction score
11
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,684
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
890
First Language
German
Primarily Uses
RMMZ
XOR would work like this:

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

evilsaigon

Veteran
Veteran
Joined
Apr 27, 2014
Messages
34
Reaction score
11
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

So I finally played Persona 4 to see what it's all about. I'm like wait...what the...this is JOJO!
Map025.png

The second settlement you'll visit in my newest game. The small village of Teytal.
sketch 4 an opening cinematic in my gameeee >:]
Untitled_Artwork_16.jpg
oh god how do I add pictures on here it keeps saying i need a link <--( suddenly forgot how technology works )
avery wip.png

"i have to work in like 5 hours ... let's start the main character's face set"
--me, an adult for the past 20 years

Forum statistics

Threads
123,163
Messages
1,154,508
Members
161,520
Latest member
wazazawa
Top