Mod Ren'Py Universal Ren'Py Mod / URM [2.6.1] (mod any Ren'Py game yourself)

5.00 star(s) 46 Votes

Tiur

Well-Known Member
Nov 13, 2021
1,317
3,640
Hello,
I have a variable with kay_sic==“yes”
View attachment 4915777
or in the mod the variable is set to “no.”
View attachment 4915778
The game considers it to be “yes.” I tried to create it again, but nothing worked.
Is this a coding error in the game itself? It seems that the developer is forcing us to take this path.
The game is: Doors part 2
Are you sure the game's considering it to be "yes"? That condition is terribly-written. Mixing AND and OR without parentheses is a recipe for misunderstandings just like this one.

As written, that condition is True if kay_def is "yes" (which it is), or if all three of kay_sic, lunaroute, and kay_dom are "yes". If this isn't what the dev intended, then yes, it's a logic error (as in, a dev mistake rather than a code error; the code is doing exactly what it was written to do).

In the absence of parentheses, Python evaluates the main three logical tests in this priority: OR > AND > NOT

So because that condition is "A AND B AND C OR D", it gets read as "((A AND B AND C) OR D)". If the intent of the dev was that it instead be (A AND B AND (C OR D)), they should have used parentheses, because that's how logical OR works in Python.
 

Ptroll

Newbie
Jan 22, 2021
31
37
I think it's a developer error.
It doesn't matter because part 3 starts with a questionnaire, and there's no save at the end of part 2!
It was for my own personal knowledge.
Thanks for your responses.
 
Last edited:
  • Like
Reactions: Boehser Onkel
5.00 star(s) 46 Votes