Hi, I am trying to make an if else kinda thing but it ain’t working. Can someone help?
(Don’t mind the error in the location, just an error from screenshotting)
Thank you!
Hi, I am trying to make an if else kinda thing but it ain’t working. Can someone help?
(Don’t mind the error in the location, just an error from screenshotting)
Thank you!
This is how the if/else command works. Delete line 5-12 and try using the code below and see if it works. What did you name your choice earlier? Put it where I put CHOICENAME, and then the main choices “green, silver” should be typed the exact way you did when you were coding the choice.
if (CHOICENAME is “green”) {
@OLIVIA changes into party 1
} elif(CHOICENAME is “silver”) {
@OLIVIA changes into party 2
} else {
@OLIVIA changes into party 3
}
If the code above doesn’t work, go to the previous chapter where you had the readers choose the outfit in the first place and check if the choices are the same. For example, if in the previous chapter the choices were “Green” “Silver” and “Blue”, then the if/else code would have to be “Green” “Silver” and “Blue” and not “Green” “Silver” and “Blue” with a full stop or “green” “silver” and “blue” with lowercases. It has to be the same.
try just removing line 5
If you are using if/elif/else to remember a prior choice, you do not need to type the word “choice”
It’s just
if (CHOICENAME is “COLOR” ) {
@.CHARACTER changes into OUTFIT_COLOR1
} elif(CHOICENAME is “COLOR2”) {
@.CHARACTER changes into OUTFIT_COLOR2
}
else {
@.CHARACTER changes into OUTFIT_COLOR3
}
Replace @.CHARACTER with your character’s name and the “CHOICENAME” and “OUTFIT_COLOR1,2,3” with whatever you named the outfits, name of choice that you are trying to remember.
Thank you so much
Does it work now?
Yes, thanks!