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,999
Reaction score
1,044
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,461
Reaction score
2,156
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,461
Reaction score
2,156
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 Posts

Latest Profile Posts

It's been so long since I had to us a logical AND (&&) that I needed to look it up to see if that was even a thing you can do. But hey, I have dynamic UI now so that's nice.

[Literally everything] is not defined.
Some neat things I made.
Shown to you in the form of an awful Windows Movie Maker Video.
1653453172179.png
Another amazing plugin by Dsiver! Thank you!

Salvage plugin. Craft something you decide you no longer need, or find an item you have no interest in, salvage it for scrap and resources. As you salvage items, gain EXP and level up. The higher your level, the better odds you have at succeeding, and the more material you'll actually acquire.

Forum statistics

Threads
122,115
Messages
1,146,617
Members
160,397
Latest member
Ruihiro_Jirishima
Top