User Tag List

Results 1 to 4 of 4

Thread: Object ID

  1. #1
    No Products Registered

    Join Date
    Mar 2009
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Object ID

    User clicks on object
    + If object Alterable Variable (or your ID)=1

    Set Selection box to the correct object

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    No Products Registered

    Join Date
    Mar 2009
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 : \

  4. #4
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •