1 Attachment(s)
How can I set the RGB of an object to the current value of the line selected on list?
Hi clickers,
I have a list that randomly changes the selected line every 00-01' and it has the following entries:
GetRGB(255, 0, 0 )
GetRGB(255, 165, 0 )
GetRGB(255, 255, 0 )
GetRGB(0, 255, 0 )
GetRGB(0, 255, 255 )
And I want to have my white colored object change to the color of the randomly selected line on the list and then delete the line.
In the event editor I clicked "Effect --> Set RGB Coefficient", but I am NOT able to get the "OK" button to light up and accept my following expression:
Val( List Select$( "RGB_LIST" ) )
So clearly it's wrong and I'm not doing this correctly. Any ideas on how I can get this stage of my project working?
To explain this stage in my game entitled "Visual Acuity" in detail...
This stage there will be a box at the top of the screen that will randomly select either "Match Color" or "Match Number" and the player will have to shoot the object that corresponds to that requested.
In this Match Box (as I call it) I will have ONE of five objects appear... each object is a picture numbered 1, 2, 3, 4, 5 and it is colored white so I can change the RGB to one of 5 randomly selected colors on that list (Red, Orange, Yellow, Green or Blue).
Below the Match Box at the bottom of the screen I will have the 5 objects 1, 2, 3, 4, 5 appear and each will also have a random color applied to it (and color not to be repeated in the bottom 5 numbers).
To have an idea of what I mean, I did something similar on another stage in my project called "Reaction" where the player only had to hit the circled target of the same color:
https://youtu.be/VzJ1ERwMQoo?t=2m36s
Attachment 17439
In that "Reaction" stage I had 6 permanently colored targets and I used two Global Values "colorSelected" and "targetHit". When the target in the Match Box is selected at random I pulled the Alterable Value of that object (simply a permanent number 1, 2, 3, 4, 5, or 6 assigned to each color) and placed it into the Global Value "colorSelected". Then after the player hit the target it changed the Global Value "targetHit" and then I ran event named "Check" just 00-01' after the target was shot by the player comparing the two Global Values to award or subtract points from the player's score.
I'm thinking for this stage "Visual Acuity" I will need maybe 3 Global Strings instead "typeSelected", "valueSelected" and "targetHit". Each Object will have two Alterable Values (Color and Number) and the "typeSelected" will determine which of the two to change the Global String "targetSelected" to and then again delay an event 00-01' to check it after but I will have to figure that out later and cross that bridge when I get to it.
This is definitely the most complex of the 10 stages so once this one is out of the way I should be able to finish building the 4 remaining stages and start dealing with the transitions issue I came across. Hahaha. so much work ahead...
Any guidance or ideas would be spectacular. I appreciate your time! Thanks everyone.
How can I set the RGB of an object to the current value of the line selected on list?
Scheodinger has a great solution. In the past, I've used a different method, though I think I'll switch to the Schrodinger Approach from here on out. Mine relies on string parsing, which seems less than ideal now.