User Tag List

Results 1 to 7 of 7

Thread: Problems with multiple objects shooting

  1. #1
    No Products Registered

    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problems with multiple objects shooting

    I'm making a game. Suffice it to say, I'm having minor difficulties.

    I have ObjectA as the base object. You control it using the racecar movement (right now, set to arrow keys, changing it to WSAD movement). There's a targeting reticule that uses the mouse (thus, fire1 is left click).

    ObjectB, ObjectC, ObjectD are all set on ObjectA. They don't move, but turn (basically, turrets). They always face the reticule, which as I said, is controlled by the mouse.

    Each turret has an individual counter to determine how far along the reload cycle it is (thus, you could hammer off three shots, then wait a few seconds before you next three, or time them out).

    Problem: All three shoot when the player presses fire. I have a fourth counter to determine which one fires. At 0, B shoots. 1 is C, 2 is D. Each event sets the counter higher. Whenever the counter is set to 3, it resets to 0. But all three still fire, and I have yet to figure out a way to do this.

    Also, is there any way to make the turrets turrets turn slower? Remember, you are using the mouse to move, and the base object is always moving (and can turn as well).

    Help!

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jun 2006
    Posts
    1,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with multiple objects shooting

    You'll have to identify which turret you want to fire by picking it either by fixed value or alterable variable. For alterable variable, you'll first need to spread a value across all turrets for that base - and if you have many bases, it will get more complicated still.

    If you go to the old forum archive (link at base of page), MMF 1.5 File Archive, and do a search for 'turret', you'll find loads of related examples. This one in particular:

    http://www.clickteam.com/CTforum/showthr...amp;Main=214394

  3. #3
    No Products Registered

    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with multiple objects shooting

    Thanks, I'll see what I can do with what you gave me, Sarah.

    The counter was supposed to be the alterable variable. I even tried it with the base having the variable, but that didn't work either. I also tried to put a "Every x milliseconds" in it, but that made the shooting sometimes not happen (try clicking once every 5 or 10 milliseconds, doesn't work. Even still, it shot ALL the turrets).

    My goal was to make a game where you fought against multiple enemies - each with one to three turrets. I just don't see a possible way to do it right now. I'll work on it a bit.

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with multiple objects shooting

    You could use the "select random <your object>" condition. This will then pick one of your turrets and let it shoot.

    About the rotating - it really depends on how you do the rotating. If you use the 32 MMF directions then it's more tricky. If you use 360 degree, by making use of the set angle action to rotate it, you can rotate by single degrees (use the advanced direction object for angle calculations).
    But this way it will be harder to make them shoot bullets in the right direction.

  5. #5
    No Products Registered

    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with multiple objects shooting

    the problem is, i want it to shoot from the individual turrets in sequence, not at random.

    so, turretA fires, then turretB, then turretC, on each subsquent mouse click, it selects which turret to fire automatically. and i can't figure out how to do it. i've tried using a counter, using a variable inside the base unit. and i'm pretty sure using a variable to set which turret is active isn't going to work very well, either.

    i'm confused as to how i ever did it before. i had a platform game, when you hit a button, it froze movement for one character, and would let you move a different one. it was pretty much like "the lost vikings" only robots, and also the fact that each was different.

    for the scrolling, i want each turret to always want to look towards the reticule. but i don't want them always looking towards it.

    basically, it's a battleship. i want the battleship's turrets to look towards the reticule, however, i want them to turn slowly towards it, not always moving as fast as they can.

    any suggestions?

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jun 2006
    Posts
    1,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with multiple objects shooting

    If it was me, I'd do all this as prerendered graphics. So I'd have an animation with turret1 rotating then shooting, then another with turret 2 doing the same etc.

  7. #7
    No Products Registered

    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with multiple objects shooting

    that's possible, however, not for the game i'm making.

    the base can rotate. the base is one object, and it moves about the screen.

    each turret is a seperate object. as in, each one has a set behavior, seperated in the event editor. i could modify that, but i'd rather have them seperate. it should, in theory work, but it's not.

    and having each turret rotate + fire, that means that the animations would be messed up. as far as the rotating slow, it's not a big deal. i just want each turret to fire independently right now.

Similar Threads

  1. Multiple PMOs for multiple Objects
    By Blood_Wist in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 31st May 2008, 01:49 AM
  2. Multiple PMOs for multiple Objects example
    By Blood_Wist in forum File Archive
    Replies: 1
    Last Post: 31st May 2008, 01:48 AM
  3. Multiple Turret Shooting With Multiple Targets
    By Brandon in forum File Archive
    Replies: 4
    Last Post: 29th January 2008, 02:34 AM
  4. Need Advice on multiple turrets shooting units
    By maVado in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 28th January 2008, 11:17 PM
  5. Problems with multiple objects sticking together
    By Mantis in forum File Archive
    Replies: 12
    Last Post: 30th January 2007, 05:49 PM

Posting Permissions

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