-
Object ID
I came from GameMaker and know it was pretty simple to do on it but I can't seem to figure out how to do it on MMF2.
I want have it so that I can create an object, assign it an ID via it's alterable value and be able to keep track of it with it's ID. I have assigned it no problem, but let's say, if I wanted to have an event that when I click on an object it checks the ID and moves the selection box to the appropriate object. Thanks for any help.
-
Re: Object ID
User clicks on object
+ If object Alterable Variable (or your ID)=1
Set Selection box to the correct object
Marv
-
Re: Object ID
thanks for the reply.
I know the answer was pretty obvious, I'm just still getting use to how MMF handles stuff : \
-
Re: Object ID
What are you using your ID value for? You dont need it unless you have multiple objects that are the same and you need to isolate them and apply actions to each one independently.
if you want to do something like the following, then you dont need an ID value at all.
If you simply wanted to move the selection box to the object when it is clicked all you need is
+ User clicks on 'object'
- Set Xpos of 'selection box' to Xpos of 'object'
- Set Ypos of 'selection box' to Ypos of 'object'
The downside to the above is that it will only move the selection box when the user clicks on the object. If the object is contantly moving around the map, then you would be better doing something like the following:
+ User clicks on 'object'
- Set flag 1 to ON
+ Flag 1 of 'object' is ON
- Set Xpos of 'selection box' to Xpos of 'object'
- Set Ypos of 'selection box' to Ypos of 'object'
Flag 1 is used to determine wether the current object is selected. If it is, then the second set of events will be activated and it will update the position of the selection box every MMF frame.
hope this helps. I can much more technical if you like, so feel free to ask me anything else. if you are interested in using IDs to control multiple objects, I strongly suggest you research the Spread Value function, as well as fastloops.