User Tag List

Results 1 to 6 of 6

Thread: homing torpedos & nested loops

  1. #1
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Oct 2006
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    homing torpedos & nested loops

    Alright, I've put a good hour into trying to figure out what's wrong with my torpedos and loops, and now it's time to ask for help.
    -------------
    OBJECT
    Torpedo

    VAR
    Torpedo.TargetID
    Torpedo.ID
    Torpedo.Angletotarget

    OBJECT
    Ship

    VAR
    Ship.ID

    ------------------
    What I'm doing now is looping through each torpedo, then starting a new loop to loop through each ship.

    Always
    --Start Loop Torpedo (1 to #Torpedo)

    On Loop "Torpedo"
    --Start Loop Ship Select

    On Loop "Ship Select" /Should there be an On Loop Torpedo here?
    Torpedo.ID = "Torpedo".Index + 1
    Torpedo.TargetID = "Ship Select".Index + 1
    Ship.ID = "Ship Select".Index + 1
    --Torpedo.AngletoTarget = Atan2

    The torpedo then uses the angle to slowly turn towards the target.

    It just doesn't work for some reason. Any suggestions. Likely a stupid error on my part.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: homing torpedos & nested loops

    Did you spread value in all the torpedos' and ships' ID values before you started the loops? I'm sure you did, but I don't see it here.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Oct 2006
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: homing torpedos & nested loops

    Yes, I did, the ID tagging is working perfectly.

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: homing torpedos & nested loops

    Hmm, I can't make out what it could be from the way that code is formatted. Could you uplod an example with only the ships and torpedoes and thier code so we can see what it is?
    Working as fast as I can on Fusion 3

  5. #5
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Oct 2006
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: homing torpedos & nested loops

    Can do once I get home.

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: homing torpedos & nested loops

    You need to select the right torpedo first. So you need to change:

    On Loop "Torpedo"
    --Start Loop Ship Select

    to

    On Loop "Torpedo"
    +Torpedo.ID = "Torpedo".Index + 1
    --Start Loop Ship Select


Similar Threads

  1. Nested ForEach loops?
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th March 2017, 05:05 PM
  2. Nested Foreach loops
    By Pixelthief in forum Fusion 2.5
    Replies: 6
    Last Post: 8th June 2014, 05:52 AM
  3. Nested Loops and cycling properly
    By rubes in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th January 2013, 04:48 PM
  4. Nested loops and get loopindex
    By Shadoku in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th September 2007, 04:13 PM
  5. nested loops
    By westray in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 14th December 2006, 04:00 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
  •