Okay so a while ago I learned how to make fake arrays, that’s been working pretty well but there are still some things I just haven’t been able to wrap my mind around, try as I might. And it’s kind of hard to explain as well. Basicly what I’m trying to do, is to assign a value to a specific variable determined with a fake array, but to only have it assign the value when the fake array shows a set number together with the name, yet using the fake array in an *if, that checks for it, so I don’t have to make a long series of *ifs to check for said value in maybe 6+ people.
Basicly *if Person A is assigned as cook1, then this check shouldn’t affect Person B assigned as cook2.
(This is the important part right here). So instead of;
*if ((((job = "cook1") or (job = "cook2")) or (job = "cook3")) or (job = "cook4"))
Do blah
I want it to look as;
*if (job = ("cook"&w))
Do blah
I made a non working example as well.
*temp person_a ""
*temp color_a "Grey"
*temp person_b ""
*temp color_b "Grey"
*temp red1 "Red1"
*temp red2 "Red2"
*temp w 1
*label top
Person A:
${color_a}
*line_break
Person B:
${color_b}
*fake_choice
#Set Person A "Red1"
*if (color_b = ("red"&w))
*set color_b "Grey"
*set color_a {("red"&w)}
#Set Person B "Red1"
*if (color_a = ("red"&w))
*set color_a "Grey"
*set color_b {("red"&w)}
#Set Person A "Red2"
*if (color_b = ("red"&w))
*set color_b "Grey"
*set color_a {("red"&w)}
#Set Person B "Red2"
*if (color_a = ("red"&w))
*set color_a "Grey"
*set color_b {("red"&w)}
*goto top
The Idea being that if Person A is Red1, and you try to set Person B as Red1, then Person B will become Red1 and Person A will become Grey, and vice versa. But if Person A is Red1, and you set Person B as Red2, then that shouldn’t affect Person A etc.
It feels like the solution is gonna be really obvious, but this is just one of those things where I can’t see the forest for the trees I guess. The thing is, when I assign “cook”&w to job, then it will still be true whether w is 1 or 2, so the check will still alter the stats for cook1 even if the job in question is cook2, and I don’t want that. I don’t even know why that is, it feels like it should work, checking if A = A, but since they’re derived from the same place, they will always be true.
