# Character Points and Overlays?

I’m trying to code a section where overlays do or don’t display based on how many points a character has. For some reason, it’s working for some of the overlays, but not for all of them. Even though it’s the same exact code. Can someone tell me what I’ve done wrong?

if (BETSY < 1) {
&overlay BETSY create
&overlay BETSY opacity 1 in 0
&overlay 5156305046798336_BETSY shifts to 233 455 in zone 2
&overlay 5156305046798336_BETSY scales to 0.523 0.523
&overlay BETSY moves to layer 6
}
if (CHARLES < 1) {
&overlay CHARLES create
&overlay CHARLES opacity 1 in 0
&overlay 5156305046798336_CHARLES shifts to 65 458 in zone 2
&overlay 5156305046798336_CHARLES scales to 0.468 0.468
&overlay CHARLES moves to layer 6
}
if (CHARLOTTE < 1) {
&overlay CHARLOTTE create
&overlay CHARLOTTE opacity 1 in 0
&overlay 5156305046798336_CHARLOTTE shifts to 191 356 in zone 2
&overlay 5156305046798336_CHARLOTTE scales to 0.400 0.400
&overlay CHARLOTTE moves to layer 6
}
if (FANNY < 1) {
&overlay FANNY create
&overlay FANNY opacity 1 in 0
&overlay 5156305046798336_FANNY shifts to 5 365 in zone 2
&overlay 5156305046798336_FANNY scales to 0.482 0.482
&overlay FANNY moves to layer 6
}
if (GEORGE < 1) {
&overlay GEORGE create
&overlay GEORGE opacity 1 in 0
&overlay 5156305046798336_GEORGE shifts to 70 176 in zone 2
&overlay 5156305046798336_GEORGE scales to 0.523 0.523
&overlay GEORGE moves to layer 6
}
if (HENRY < 1) {
&overlay HENRY create
&overlay HENRY opacity 1 in 0
&overlay 5156305046798336_HENRY shifts to 91 50 in zone 2
&overlay 5156305046798336_HENRY scales to 0.536 0.536
&overlay HENRY moves to layer 6
}
if (JAMES < 1) {
&overlay JAMES create
&overlay JAMES opacity 1 in 0
&overlay 5156305046798336_JAMES shifts to 35 278 in zone 2
&overlay 5156305046798336_JAMES scales to 0.400 0.400
&overlay JAMES moves to layer 6
}
if (JANE < 1) {
&overlay JANE create
&overlay JANE opacity 1 in 0
&overlay 5156305046798336_JANE shifts to 150 455 in zone 2
&overlay 5156305046798336_JANE scales to 0.495 0.495
&overlay JANE moves to layer 6
}
if (JOHN < 1) {
&overlay JOHN create
&overlay JOHN opacity 1 in 0
&overlay 5156305046798336_JOHN shifts to 238 277 in zone 2
&overlay 5156305046798336_JOHN scales to 0.495 0.495
&overlay JOHN moves to layer 6
}
if (KATE < 1) {
&overlay KATE create
&overlay KATE opacity 1 in 0
&overlay 5156305046798336_KATE shifts to 238 150 in zone 2
&overlay 5156305046798336_KATE scales to 0.455 0.455
&overlay KATE moves to layer 6
}
if (MARY < 1) {
&overlay MARY create
&overlay MARY opacity 1 in 0
&overlay 5156305046798336_MARY shifts to 141 278 in zone 2
&overlay 5156305046798336_MARY scales to 0.441 0.441
&overlay MARY moves to layer 6
}
if (NAN < 1) {
&overlay NAN create
&overlay NAN opacity 1 in 0
&overlay 5156305046798336_NAN shifts to 0 174 in zone 2
&overlay 5156305046798336_NAN scales to 0.427 0.427
&overlay NAN moves to layer 6
}
if (ROBERT < 1) {
&overlay ROBERT create
&overlay ROBERT opacity 1 in 0
&overlay 5156305046798336_ROBERT shifts to 183 55 in zone 2
&overlay 5156305046798336_ROBERT scales to 0.495 0.495
&overlay ROBERT moves to layer 6
}
if (SUSAN < 1) {
&overlay SUSAN create
&overlay SUSAN opacity 1 in 0
&overlay 5156305046798336_SUSAN shifts to 161 181 in zone 2
&overlay 5156305046798336_SUSAN scales to 0.523 0.523
&overlay SUSAN moves to layer 6
}
if (THOMAS < 1) {
&overlay THOMAS create
&overlay THOMAS opacity 1 in 0
&overlay 5156305046798336_THOMAS shifts to 82 355 in zone 2
&overlay 5156305046798336_THOMAS scales to 0.482 0.482
&overlay THOMAS moves to layer 6
}
if (WILLIAM < 1) {
&overlay WILLIAM create
&overlay WILLIAM opacity 1 in 0
&overlay 5156305046798336_WILLIAM shifts to 7 52 in zone 2
&overlay 5156305046798336_WILLIAM scales to 0.495 0.495
&overlay WILLIAM moves to layer 6
}

Only 5 out of the 16 overlays display.

You can’t use “if” for all the conditions. The middle ones would use “Elif” and the last one “else.” Though, I personally only use “If” and then “Elif” as I like to write out the names of the gains being used.

Guide to If/Else/Elif

I assumed it worked like the flags, where I can if for each because they’re separate conditions. I don’t want only one overlay to appear. I want them all to unless the points have been set above zero. That’s what I was trying to get to.

Oh, if it’s just an either-or, I would combine all the above commands into one if condition (may have to use labels and/or if statements within if statements) and then have another branch for if they’re below zero like you said.

Any idea what that might look like? And why only some of my overlays are showing?

I assumed only some of your overlays are showing because using only if statements and not elif or else, the code can skip over some of your branching. That’s how I coded for a while and my test runs would always mess up. I’ve never tried the method you’re using though. I have an idea, but I can’t really type it out as I’m on break at work. I’ll bump in case someone else may know what’s going on and be able to help you, though!

They are also tappable overlays, though I haven’t coded that part yet. Which makes it even more complicated.

Bump!

Does the script have less than a point in all 16 characters? It might be some of your characters have null points in this one episode, especially when you are coding on the web previewer, the points do not transfer.
If so, you can just reset all the 16 characters points to 0. You can remove it later on after you’re done with testing.

@/BETSY =0
@/CHARLES =0
.
.
.

if (BETSY < 1) {
.
.
.

1 Like

I’ll try it!

Oh my god, it worked! Thank you so much!

Now I just have to figure out the rest of my unnecessarily complicated code.

1 Like