> Hi Tarek.
> Thanks very much for such a detailed example. I appreciate it.
> Even though im still very much a beginner, your example made sense straight away. The way its laid out for sure. Its a really good example. Im just sussing out why it all works together with the events. I do understand somewhat though. I think its the expressions within the events that confuse me the most.
> I learnt not only about uids, but pinning as well. I knew how to pin, but never used the position on a pinbox like this.
> Just going to study this so I know the ins and outs.
> Thanks dude.
I'm just sussing out why it all works together with the events
If you mean how the UID gets created and saved and then Picked when need it.
I gave you two different examples;
1-One for when you create the all the objects on the RunTime is the "On Creation:" Example
Here as the two Objects (Enemy and Health) are created Together you can save directly the "Health.UID" to the Enemy Instance Variable = "Health_UID"
Then whenever you need to Pick the Health Linked to the Enemy you use the "Enemy.Health.UID" where is the UID of the Health that we saved on the Start Of layout
2-The second example is when you have all the objects already created before the Run Time which is the "By Comparing Instance Variables" Example, so you need to link somehow the Two Objects Enemy & Health so we can Pick them and save the UID to the "Enemy.Health.UID" On the start of Layout like we did on Option 1
But the difference here is that we have to Loop throughout all the Health Instances to see who is Linked to Who.
This Option requires more To Do as you have to link them by instance Variable and has to be done on the Editor before Run Time.
If you look at the Enemy Instance Variables you will see "Health_N" and if you look at Health objects Instances Variables you will see "Enemy_N" so these two variables are the one we use to Link them together at the start of the layout so we can save the UID.
If you look at the editor and check all the Objects Variables you will see this:
Health_N = 0 ---- Vs -----Enemy_N = 0
Health_N = 1 ---- Vs -----Enemy_N = 1
Health_N = 2 ---- Vs -----Enemy_N = 2
Health_N = 3 ---- Vs -----Enemy_N = 3
Although you could do this with containers to avoid all extra work is good to know because sometimes depends on the situation you cannot use containers but don't worry you will learn as you go
Here is very simple once you do it once.
Do you know how to Add Image Points right?
Just in case: Open enemy Object on the Animation Editor Like on Picture
-Press on number One 1
-On number 2 I added an Imagen Point with the + Sign and this image point is the second one so it becomes as Index = 1 as you can see on the Picture
-Now while you are still on that image point Move the Position to where you like it to be, see Number 3
And that's all, then when you need to reference any image Point you just enter the Number of the Index of the Image Point.
You can also reference Imagen Points by Name
Instead of set position to image Point =1
You could do
set position to image Point = "Health"
Where "Health" is the name That I give to that Image Point