Color data in text strings aren’t accepted by my art pad

project link:

what is happening in the project, and what do you want to happen instead? i am attempting to replace three initially set hsb variables in each square of my art pad to one string variable. for example, the top left square in page 2 is set to hsb(0, 100, 100) [red], which i used to represent by setting a “hue” variable to 0, a “saturation” variable to 100, & a “brightness” variable to 100. however, to more easily add more pages to the art pad, i decided to represent it with a string instead: “,000100100”, and have the three variables automatically set themselves. however this is not working & i don’t know why, so i figured i’d turn to the mighty power of degug to help me. what’s actually happening [as opposed to the desired result] is that the variables are not setting as intended, and are staying at their default values of all 0, which are interpreted as black [hsb(0, 0, 0)].

screenshots of code:

3 Likes

[should probably point out i would not be having this problem if we had color variables]

3 Likes

between 1 to 4, then 4 to 7, then 7 to 10. that will fix it

2 Likes

ohh i thought it was inclusive on both sides

e: it still doen stot work
e2: *does not [what the goigly]

2 Likes

nah, i work it like a cursor and that works pretty easily - in front of a string the cursor is at position 0, and for every letter the index increases by 1

2 Likes

thats weird, lemme actually go into the project (lol) and see whats wrong

2 Likes

To see what’s going on, place a show pop-up before the set blocks and set it to the color data, and see if it displays the expected text…

2 Likes

w…? what…? they all thirty-two said “0” [one for each square] & then the top row worked & the other squares turned black

i am confused

1 Like

oh, simple mistake, just move the variable on top of the set position block - framing error

inside “im a square” put a check once if to check if the string is empty or not
you didnt use the string variable for the squares that turned black

5 Likes

The set position block takes a frame to complete, so the other when game starts rule ran before the variable had a chance to update…

1 Like

thanks tri! i actually realized i could turn each color from 9 digits to 7 by subtracting 1 from s & b. [and use “-1” for the case that either equal 0]

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.