Robert-Developer_of_Bis

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
575
Reaction score
344
First Language
English
Primarily Uses
RMVXA
Hello. I'm using Tsukihime's Choice Options, as well as a ton of other scripts that are almost certainly unrelated, as none of them that I know of affect the Show Choice option. Well, except for Tsukihime's Large Choices, but I assume they made these scripts compatible... Anyway! The script itself works fine, but it seems either it's missing a feature, or I'm simply doing it incorrectly. Take a look at this:

Ruby:
hide_choice(1, "$game_party.has_item?($data_items[76])")
hide_choice(1, "$game_switches[140] == true")

You would think that this code would make it so that if either of these conditions is true, then choice 1 will be hidden. However, it seems that the script will only choose the latest hide_choice affecting a single choice, so you cannot have two. I then tried:

Ruby:
hide_choice(1, "$game_party.has_item?(
$data_items[76])" || "$game_switches[140] == true")

I thought this would work as the statement is only one hide_choice. It seems logical to me, anyway. But, somehow, this ALSO results in only the second conditional being adhered to... I know it is not the syntax of the first conditional that is the issue, because if I remove the second conditional, the first one works every time.

So, my question is: Is there a way to do this? To have the option become hidden if either of these conditions are true?

Thanks for reading, and, as always, for any help you can give me. Have a nice day! :)
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,988
Reaction score
1,038
First Language
English
Primarily Uses
RMVXA
Try
Ruby:
hide_choice(1, "$game_party.has_item?($data_items[76])" || "$game_switches[140] == true")
Never mind didn't see properly the second code you posted.
Looking at the code it seems that it takes whatever is in quotes last. Then does an eval on that so ShadowDragon should be correct.
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,410
Reaction score
2,132
First Language
Dutch
Primarily Uses
RMMV
this is a wild guess, while it uses " code " and you use it 4x, so might this work:

Ruby:
hide_choice(1, "$game_party.has_item?(
$data_items[76]) || $game_switches[140] == true")

but you have to use it in 1 line, not seperately as far I can read
the issues they have.

as "code" || "code" seems to be 2 argements. (so far I read the comments).
 

Robert-Developer_of_Bis

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
575
Reaction score
344
First Language
English
Primarily Uses
RMVXA
I'm afraid that doesn't work. The first conditional is still totally ignored in favor of the second. Surprisingly, the script accepts all three versions so far without crashing. Impressive.

On a side note, I'm sorry I didn't reply sooner. I'm a little sick and I fell asleep.

Hold on now, I just found something. I swapped the order of the two conditionals, and it STILL only looks at the switch conditional...

Found the issue! A recent addition was screwing it up. ShadowDragon's solution works! Strangely, I had tried that exact solution earlier and it didn't work then. Not sure what the difference between then and now is, but thank you! Thank you so much!
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,410
Reaction score
2,132
First Language
Dutch
Primarily Uses
RMMV
I dont know any ruby code, but through the comments, they had the same
issue for 2 or 3 checks, but "code" = 1 argements, so to make it 3 or more
"code || code && code " = 1 argements, something to keep in mind.

while it was a wild guesson the comments they made, I'm happy it worked
out for you and the issue you found.

Good luck on your project :)
 

Latest Threads

Latest Profile Posts

Beep-Beep-Motha-facka.gif

Just finished and uploaded the delivery truck base/sprite sheet. I've been steadily replacing the default assets with early modern alternatives. The air-ship for a biplane, horse-drawn wagon for a delivery truck, and next a sailboat for a steam-powered passenger liner (think of the SS Olympic and RMS Titanic).
I caught a shiny magikarp on pokemonGO today AND finally saw Detective Pikachu and it was so cute and I'm still so hype AHHHHH!!!
one of the coolest things I've learned from the forums is the ability to give yourself a hitbox. I have a move you can do on the fields. shoulder tackle. thanks to the forums, that tackle triggers self A switches on some events. NPC's and the environment now react to the tackle. awesome.
I really liked how this one turned out! :kaopride:
WYqMPf6.png

Character (Yes, this is a character): Nibiru the Primal Being from Yugioh.
Dragon Quest style enemy selection plugin work in progress:

Quest_Targeting.png

It's a simple targeting system from the NES era. Select an enemy group; single-target skills will target the first enemy in that group.

Quest-Targeting-Animated.gif

Forum statistics

Threads
121,936
Messages
1,145,285
Members
160,207
Latest member
RiceKun
Top