User Tag List

Results 1 to 7 of 7

Thread: Objects shooting individually.

  1. #1
    Clicker Multimedia Fusion 2
    MangoMan's Avatar
    Join Date
    Oct 2011
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Objects shooting individually.

    I'm making an RTS game, and I'm a little new to MMF2, and I have a problem. When you press a key, a specific active object is created, and is supposed to shoot every three seconds. It works, but when there are two or more of the same object, they always shoot at the same time, but I want them to shoot at different times, like any other RTS. How can I do this?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Objects shooting individually.

    The best way is to keep the timer independent for each object shooting. For instance, use an alterable value that counts up to (if your game runs in 50 FPS) 150. Once 150 is reached, fire the object and reset to 0.

    That way, only when that individual object has waited that many frames (roughly 3 seconds) will it fire, and only that object will fire.

  3. #3
    Clicker Fusion 2.5

    Join Date
    Mar 2007
    Posts
    495
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Objects shooting individually.

    What's above is exactly right.
    When the object is created you also set that value to Random(150).
    That will keep them firing ever 3secs (at 50 frames/second) but they will have a random offset as to when in that 3-second-window they begin to fire.

  4. #4
    Clicker Multimedia Fusion 2
    MangoMan's Avatar
    Join Date
    Oct 2011
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Objects shooting individually.

    I'm sorry, I don't know how to use alterable values, or what condition to change them in. Do I change them in the always condition?

  5. #5
    Clicker Fusion 2.5

    Join Date
    Mar 2007
    Posts
    495
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Objects shooting individually.

    If you right-click under your object in the event editor, you can see alterable values in the dropdown list. Inside there, you will see Add, Subtract and Set.

    You should be:
    - adding 1 always,
    - setting to 0 when value is greater than 150 and (optionally)
    - setting to Random(150) in the same event as where the object is created.

  6. #6
    Clicker Multimedia Fusion 2
    MangoMan's Avatar
    Join Date
    Oct 2011
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Objects shooting individually.

    Thanks, guys!

  7. #7
    Clicker Fusion 2.5

    Join Date
    Mar 2007
    Posts
    495
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Objects shooting individually.

    Did you get it working the way you wanted?
    It's quite a good effect when it works. I have it on the turrets in my game, which can be onscreen for a while.

Similar Threads

  1. Multiple duplicate objects overlapping, not individually responding to Qualifiers.
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 5th July 2012, 10:20 PM
  2. Using FastLoops to handle objects individually ( not working )
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th February 2012, 10:11 PM
  3. Treating objects in Qualifiers individually
    By Gunnar in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd January 2010, 08:28 PM
  4. Need to control copied objects individually
    By Bernardo3D in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 3rd October 2009, 01:18 AM
  5. Help with shooting objects
    By SkyMan25 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 25th June 2008, 03:23 AM

Posting Permissions

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