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,998
Reaction score
1,042
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,424
Reaction score
2,136
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,424
Reaction score
2,136
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

Remember to do your 0,01% progress on your game today!
Went to see Jujutsu Kaisen 0 yesterday, it was cool. The movie wasnt really a masterpiece, it had some pacing and characterization problems, but overall I enjoyed it, maybe because it was the first anime film I have ever been to in the cinema lol. The battle animation & music were top-notch. I havent seen much of the anime so people who watched the entire season would probably like it more.
MainMenu.PNG
Finally satisfied with the main menu xD

The plan was to have battle sprites in the menu...But these faces from Ocean's Nostalgia look pretty damn good imo. (Will have to adjust for them ofc and maybe recolor to match the overworld/battle sprites more)
It's always disturbing to me to see my cat eating something off the bathroom floor.

Forum statistics

Threads
121,988
Messages
1,145,735
Members
160,259
Latest member
Leonson
Top