Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How could I make variables raise the percent of others at certain amounts?
- Catacaramel
-
Scratcher
42 posts
How could I make variables raise the percent of others at certain amounts?
So I have hunger, thirst, and boredom. I set up a thing where it takes certain sections of the points (such as greater than 8 but smaller than 12 with “and's” connecting them all together) inside of an “if” with something that multiplies another variable, points given, by 1.5, 1.25, .75, or .5. I tried this and it didn't work. Plus it was long. Any other strategies of doing this? It needs at add a certain percent or multiply by a number with a decimal since the points given variable won't always be the same.
- VHorus
-
Scratcher
16 posts
How could I make variables raise the percent of others at certain amounts?
So I have hunger, thirst, and boredom. I set up a thing where it takes certain sections of the points (such as greater than 8 but smaller than 12 with “and's” connecting them all together) inside of an “if” with something that multiplies another variable, points given, by 1.5, 1.25, .75, or .5. I tried this and it didn't work. Plus it was long. Any other strategies of doing this? It needs at add a certain percent or multiply by a number with a decimal since the points given variable won't always be the same. So I have hunger, thirst, and boredom. I set up a thing where it takes certain sections of the points (such as greater than 8 but smaller than 12 with “and's” connecting them all together) inside of an “if” with something that multiplies another variable, points given, by 1.5, 1.25, .75, or .5. I tried this and it didn't work. Plus it was long. Any other strategies of doing this? It needs at add a certain percent or multiply by a number with a decimal since the points given variable won't always be the same.
I don't totally understand what you are trying to do. Could you use scratchblocks to explain what you did that did not work?
- Catacaramel
-
Scratcher
42 posts
How could I make variables raise the percent of others at certain amounts?
I would, but that would take a while. Here's a screenshot instead: http://i.imgur.com/W4uHBAb.png (The CatCare variable is just something that toggles the entire system.)So I have hunger, thirst, and boredom. I set up a thing where it takes certain sections of the points (such as greater than 8 but smaller than 12 with “and's” connecting them all together) inside of an “if” with something that multiplies another variable, points given, by 1.5, 1.25, .75, or .5. I tried this and it didn't work. Plus it was long. Any other strategies of doing this? It needs at add a certain percent or multiply by a number with a decimal since the points given variable won't always be the same. So I have hunger, thirst, and boredom. I set up a thing where it takes certain sections of the points (such as greater than 8 but smaller than 12 with “and's” connecting them all together) inside of an “if” with something that multiplies another variable, points given, by 1.5, 1.25, .75, or .5. I tried this and it didn't work. Plus it was long. Any other strategies of doing this? It needs at add a certain percent or multiply by a number with a decimal since the points given variable won't always be the same.
I don't totally understand what you are trying to do. Could you use scratchblocks to explain what you did that did not work?
- cs156175
-
Scratcher
1000+ posts
How could I make variables raise the percent of others at certain amounts?
why don't you use cubeupload to show the screenshot?I would, but that would take a while. Here's a screenshot instead: http://i.imgur.com/W4uHBAb.png (The CatCare variable is just something that toggles the entire system.)So I have hunger, thirst, and boredom. I set up a thing where it takes certain sections of the points (such as greater than 8 but smaller than 12 with “and's” connecting them all together) inside of an “if” with something that multiplies another variable, points given, by 1.5, 1.25, .75, or .5. I tried this and it didn't work. Plus it was long. Any other strategies of doing this? It needs at add a certain percent or multiply by a number with a decimal since the points given variable won't always be the same. So I have hunger, thirst, and boredom. I set up a thing where it takes certain sections of the points (such as greater than 8 but smaller than 12 with “and's” connecting them all together) inside of an “if” with something that multiplies another variable, points given, by 1.5, 1.25, .75, or .5. I tried this and it didn't work. Plus it was long. Any other strategies of doing this? It needs at add a certain percent or multiply by a number with a decimal since the points given variable won't always be the same.
I don't totally understand what you are trying to do. Could you use scratchblocks to explain what you did that did not work?
- gor-dee
-
Scratcher
1000+ posts
How could I make variables raise the percent of others at certain amounts?
I had a look and it does seem over complicated. I think you may want some ORs instead of ANDs because if, say, hunger was at 2 and boredom was at 12 then none of the IFs arguments would be true.
- footsocktoe
-
Scratcher
1000+ posts
How could I make variables raise the percent of others at certain amounts?
You can always break down a long logic statement into a series of shorter statements. For example,
((A or B or C) and D) or ((A and B) or E)) could become
F = (A or B or C) and D
G = (A and B) or E
and then put (F or G) in the IF THEN block
((A or B or C) and D) or ((A and B) or E)) could become
F = (A or B or C) and D
G = (A and B) or E
and then put (F or G) in the IF THEN block
- Discussion Forums
- » Help with Scripts
-
» How could I make variables raise the percent of others at certain amounts?