User Tag List

Results 1 to 8 of 8

Thread: Ai system for every Ai

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Lukiester's Avatar
    Join Date
    Feb 2014
    Location
    Melbourne
    Posts
    373
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Ai system for every Ai

    Hey, i am currently making a ai system for my ai in game and it is nearly complete however it is only for one enemy. Is there a way of instead doing the same thing for every individual enemy making it for every ai, i just dont want to have to do it for every ai.
    Thanks Lucas

  2. #2
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,062
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    you've gone too far - but yes- you make the enemy a group - and apply all the code to the group instance - looping through them

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Lukiester's Avatar
    Join Date
    Feb 2014
    Location
    Melbourne
    Posts
    373
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help

  4. #4
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Make all the enemies have a group qualifier, then in the event editor. Do:

    Always: Group > Count : For each object loop named ["AI_"+AI_NAME("Group")]

    AI_NAME is a string variable inside each enemy object named like "pig", "skeleton", "thief", etc.

    Then do:

    e.g.

    Group> Count : On for each loop named "AI_pig" >>
    (Your AI events)

    This will make it so EVERY enemy inside the group qualifier will have a loop for themselves so it will not mix them up.
    I know this might be kind of hard to understand, but I've done this for my enemies in my game, and it works perfectly.

    danjo is correct about his post, from what I can tell.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Lukiester's Avatar
    Join Date
    Feb 2014
    Location
    Melbourne
    Posts
    373
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    sorry im not quite sure about the strings and there names, could i please have an example?

  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)
    I think BartekB is trying to say you should put your enemies in the same Qualifier group (under the Events tab of your object's properties is where you set the Qualifier group). Then create an Alterable String in each enemy and call it "AI_SOMETHING" (SOMETHING = EnemyA, EnemyB, etc). Then run code in the following format:

    +Number of Qualifier.group > 0 <--(if there is at least one member of Qualifier.group left)
    - Start ForEach loop ("AI_" + "AI_SOMETHING") <--(This is making the name of the ForEach loop specific to each enemy)

    +On ForEach loop (for Qualifier.group) "AI_EnemyA"
    - Do EnemyA actions

    +On ForEach loop (for Qualifier.group) "AI_EnemyB"
    - Do EnemyB actions

    +On ForEach loop (for Qualifier.group) "AI_EnemyC"
    - Do EnemyC actions

    This assumes each enemy has unique actions. If they all do exactly the same thing but just look different, then you only need one ForEach loop and you can forget the unique string approach. In that case, just add all enemies to a single Qualifier group and run a ForEach loop on them all.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Lukiester's Avatar
    Join Date
    Feb 2014
    Location
    Melbourne
    Posts
    373
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    i dont really get it but whats the difference between just starting a for each loop on the qualifier?

  8. #8
    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)
    Running a ForEach on the Qualifier treats all the Qualifier group's members as being the same type of object. If all the members of a Qualifier are meant to follow the same AI rules, then using a ForEach loop on a Qualifier is just fine. However, if you plan on having different members of the Qualfier follow unique AI rules, then you will want to run a ForEach loop on each enemy type individually. This means if you have 3 different kinds of enemies (for example a slime, troll and dragon) and they all follow their own rules, you would want to run a ForEach loop on ALL slimes, then a ForEach loop on ALL trolls and finally a ForEach loop on all dragons. If you try to simply run a ForEach loop on a qualifier containing the slime, troll and dragon, you won't easily be able to separate out the 3 types of enemies to run their unique AI. Mind you, using Qualifiers has some downsides, especially if the members of the Qualifier are going to need to interact with other members of the same Qualifier. In that case, you are better off just running a unique ForEach loop on each unique enemy type.

    I hope this is helping you understand. It is not a super simple thing to make an example of because AI that is complex enough to use ForEach loops like this is going to be, well... complex.

Similar Threads

  1. working on a system need help plz
    By bybyblue in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 20th September 2011, 08:33 PM
  2. Log-in System
    By grayhuskie53 in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 12th October 2007, 06:00 AM
  3. AI HELP! Using the "LKP" system.
    By Attan in forum File Archive
    Replies: 2
    Last Post: 20th July 2007, 09:08 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
  •