I have three white boxes which contain an instance variable called "Slot". This variable contain the slot number which is actually a UID number of another sprite.
there are 4 different duplicate sprite instances with unique UID and they represent the slot for white boxes. The problem is white boxes has to be adjusted after moving towards their slots...all white boxes moves to the slots but all adjusted their self to wrong slots...
I am using set angler toward slot(Sprite.slot).X and slot(Sprite.slot).Y
where slot is the sprite name, Sprite is the white box and Sprite.slot contain the unique UID for the slot.
For detail please check my project file
set val default value to 0 instead of 14. You select by IID with sprite(x), not UID
Thanks a lot , changing my logic from uid to IID worked fine. But why they dont display IID like UID through property sheet i had to display their numbers on run time to use it.
Because IID's are just indexes of objects. Manual explains it better. :)
I'd recommend you use UID's and use the 'pick by uid' condition instead of referring to IID's in expressions. Referring to things in expressions is coderish way of doing things and not necessary in C2 :)
I am new to construct2 can you show me any example because previously i was using unique id but i was unable to select the object in expression. My logic was simple that each white box contain a unique id of bottom yellow boxes where they get adjust...
Here is what I was talking about: dl.dropboxusercontent.com/u/19921470/testmyfile.capx
Develop games in your browser. Powerful, performant & highly capable.
Just one thing, if you're wanting to stop them clicking to slots that don't match, you might need to check again the UID/Slot # on the overlap test :
<img src="http://i.imgur.com/FiN06pq.png" border="0" />
Thanks everyone for contributing your experiences , i really appreciate that.