But what if i had one object called Slider
With 3 instances of it on scene and maybe ID vars from 1 to 3
I can’t imagine how to do that maybe there are some means to achieve it?
My only idea was to go with If one of these conditions is true
And go Slider var ID = 1 or 2 or 3
But that would not reference which is which but only if any of them have such var
You should be able to pick an object using an object variable as long as you use the object variable condition and not the compare 2 numbers or compare 2 strings. Those conditions do not pick objects.
Also, make sure there isn’t another condition already reducing the pick list. If so, you would have to use pick all first.
In your case, I think using different objects would be the easiest method. Why use 3 events when 1 would do the job?
Keith either i don’t understand your answer or you my question
Color string needs to be built from 3 values
For that you need 3 sliders
I went with having 3 slider objects where each is separate object and not instance copy of itself
And so i in color string only need reference them by their object name
NewSlider.Value() NewSlider2.Value() NewSlider3.Value()
Now i asking is to would it be somehow possible to reference in that string
3 different copies of one slider like for example via instance variable
And then i would still be using one event but also one object (just 3 copies of it) instead of 3 separate objects
I think it is technically not possible in gdevelop but i just ask to be sure
This works because the condition picks just the slider being dragged. It then uses the object name Color ( with the values Red, Green and Blue) to modify a structure. It then uses the structure to build the color.
Hahah ok now i see i did not explain it enough
What was obvious to me is not obvious at all
So all my fault
I meant more like i have only this action ToString(NewSlider.Value())+";"+ToString(NewSlider2.Value())+";"+ToString(NewSlider3.Value())
I ask is there a way to reference different instances of same object
IN ACTION or to be precise in expression itself
I did not understand what you meant by 3 events and that part did not make sense to me
Because you was talking about referencing it in condition
Sou you needed 3 separate events for it
Which was exactly something i wanted to avoid
Again my question was about a way to reference instances in action not condition
Well now i see how NOT clear my question was to begin with
I did fall under impression like
Since we can do CursorX(“LayerName”,)
Maybe we can make something similar to referencing object instances in action
I’m not aware of a way to access the values of different instances with the built-in actions or expressions without changing the pick list or using Javascript. You could make a custom action or expression but that just seems like overkill unless you use it for other purposes or you want to move code from the main event sheet to a function to make it easier to read.