How to do multiple ifs at the same time


#1

I want to make it so that my surname chooses the hair color and my gender also changes what is said.

example of what I tried.
*if ((gender=“male”)and(surname=“Novak”))
“Look at those cute dimples and that scruffy blonde hair!”
*goto male_name

*if ((gender=“female”)and(surname=“Smith”))
“Look at that cute nose and that long flowing hair!”
*goto female_name

Does anyone know the correct way of doing this?


#2

I think I understand what you want…

try using

*if

*elseif

*else

statements, these should help, I apologise if that’s not what you’re looking for.


#3

Not exactly i was just over thinking it and did it wrong. I got it, thank you anyways.


#4

Lol, no problem, I guess?

Anyway the problem you showed wasn’t exactly wrong, so I got a little confused hehe.


#5

If you’re trying to do multiple Conditionals that lead to the same factor, I found a small trick that involves a lot of parenthesis:
(((Race = “rawr”) and (((ability =“a”) or (ability = “b”)) or (ability = “c”))) or ((Race =“Human”) and (((ability =“Edge”) or (ability = “d”)) or (ability = “e”))))

Basically, It’s encapsulating each of the conditionals into one. and then recreating the original Q1 or Q2. With Q1 being its own conditional.


#6

There are a couple ways to go about doing that, at least ones that I can recall off the top of my head. I prefer simplicity.

 
*if (gender "male") and (surname "Novak") 
  Look at them dimples, and oh the hair! 
  *goto male_name 
*else 
  "That nose is just the cutest thing, and that silky hair!" 
  *goto female_name 

Note I simply put else, assuming there’s only male and female. Otherwise…

 
*if (gender "male") and (surname "Novak") 
  Look at them dimples, and oh the hair! 
  *goto male_name 
*elseif (gender "female") and (surname="Smith")
  "That nose is just the cutest thing, and that silky hair!" 
  *goto female_name 

The above can be continued to more *elseif according to each gender choice you have. The last can be an *else to show if none of they are none of the above options. The final means is going basic.

 
*create male false 
*create female false 

*if (male) and (surname "Novak") 
  "Look at those cute dimples and that scruffy blonde hair!" 
  *goto male_name 
*elseif (female) and (surname = "Smith")
  "Look at that cute nose and that long flowing hair!" 
  *goto female_name 

*comment An = might be needed before the quotations otherwise the quotations can be removed and replaced with an equal sign. Course I haven't ran any code tests lately so... 

Kinda changed the description the first time round, don’t mind that. :wink: Hope this helps. Anything more complex or if you’re actually looking for comparisons or otherwise just let us know.


#7

Here this was answered a long time, but it also answers your question. That thread has examples on how to make the conditions as well as how the logic of the conditions works