User Tag List

Results 1 to 4 of 4

Thread: Determine if another identical object's flag is on?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Mar 2013
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Determine if another identical object's flag is on?

    I am currently making a AI system where enemies approach the player and fights when in range of the player character.
    At the moment all enemies approach the player at the same time, even if there's 100 of them.

    Is there any way of determining if one of the enemies flag turns on?
    For example, the first enemy to reach the player turns on a flag on that specific enemy. The rest of the enemies then knows that one enemy is currently fighting the player and holds back until that enemy is dead.

    How should I approach this issue?
    I am having a hard time figuring this out.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Yes, you could make each object detect if there is another object that has a flag that is on, but that sounds like a really inconvenient way of doing what you really want. If no more than one enemy should fight the player at any time, you could simply set a value to 1 when an enemy charges, and back to 0 when it is dead, or set the value to the fixed value of the enemy if it's important to know which enemy is attacking. You can use the same approach if two or more enemies could attack at the same time also, just have more values and pick one that is 0.

  3. #3
    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)
    I would make an active that acts as an enemy manager. It stays invisible and offscreen and just manages flags and vars. Have one var represent the total number of enemies able to attack. Then on your distance check, include an additional check if the var is below the total enemies allowed to fight. If the number is low enough then activate your enemy and increase the var by 1. If an attacking enemy goes neutral or dies, reduce the var by 1. I would do this distance check in a foreach loop.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Mar 2013
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the answers.
    mobichan, does it exist an example file of what you explained? would love to see it in action as i am not quite sure of how to implement this

Similar Threads

  1. Flag limit / flag values looping
    By butterfingers in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 2nd October 2014, 11:03 PM
  2. How to determine computer RAM without using The Big Box object?...
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st February 2012, 01:11 PM
  3. Hardcore Questions regarding identical object overlapping
    By Morbus Crohn in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd November 2011, 07:11 AM
  4. How to determine when the mouse moves off object
    By RCL in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 20th November 2008, 06:37 PM
  5. Activating 1 object out of many identical objects?
    By camelman in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 16th November 2008, 04:42 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
  •