User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: But it looked so simple!

  1. #1
    Clicker Multimedia Fusion 2
    Fralex's Avatar
    Join Date
    Sep 2008
    Location
    Melrose, MA
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    But it looked so simple!

    I was really pleased with how much better DavidN's FastLoop platform engine was than the built-in Platform movement. And then I thought, "Hey! With a few minor changes, I could create computer-controled enemies that can do everything the player can!" Problem is, it can't differenciate between identical "Enemy" instances. How can I prevent every enemy from stopping falling just because one of them hit the ground?

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,729
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    For duplicates Spread Value. This will give a different ID to each of the enemies.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker Multimedia Fusion 2
    Fralex's Avatar
    Join Date
    Sep 2008
    Location
    Melrose, MA
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    I think I tried something like that already. But just to make sure, I'll see if that works.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,112
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    it WILL work if you use spread value. at the start of the frame (or on enemy creation) you need to spread a value (call it say, enemy ID) so that tgf can differentiate between each enemies collisions.

  5. #5
    Clicker Multimedia Fusion 2
    Fralex's Avatar
    Join Date
    Sep 2008
    Location
    Melrose, MA
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    Err... What should I do after spreading a value?

  6. #6
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    The whole setup of events should generally look like:

    Always
    -> Spread value 0 in Alterable Value A of object [Enemy]

    Always
    -> Start loop "moveEnemies" NObject("Enemy") times

    On loop "moveEnemies"
    + Alterable Value A of [Enemy] = LoopIndex("moveEnemies")
    -> (Perform events related to movement of enemy in here)

    The action "Spread value" gives each Enemy object a unique value in the alterable value that you give it, starting from the number you give it - so if there were four Enemy objects and you spread value 0 in them, they would be assigned values 0, 1, 2 and 3.

    The fastloop event goes through each of the Enemy objects and selects them in turn, so that only one of them is selected at a time to perform events on. Make sure that you use the "Compare alterable value" condition of the Enemy object here, instead of the "Compare two general values" condition, so that the enemy is actually selected by the event. And, as said above, it's recommended to rename the alterable value to "ID" or something so that you can tell what it's used for.

  7. #7
    Clicker Multimedia Fusion 2
    Fralex's Avatar
    Join Date
    Sep 2008
    Location
    Melrose, MA
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    So... by " NObject("Enemy") ", do you mean the "ID" value of the Enemy?
    And then I just stick " On loop "moveEnemies" " in front of every event?

  8. #8
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    Nobjects("Enemy") is an expression in the Special object - it counts the number of Enemy objects that exist.

    Put "On loop "moveEnemies" and "ID("Enemy") = LoopIndex("moveEnemies")" in front of every event that you want run in the fastloop, unless the event already has an "On loop" event that's called during the moveEnemies fastloop. In this case, you only need to add the "ID("Enemy") = LoopIndex("moveEnemies")" condition.

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    spread a value and then loop through them like DavidN suggested. It's a killer with multiple objects but that's the only way to do it in MMF2 sadly (unless you can deal with MMF2's inbuild object identification on collision... argh)

  10. #10
    Clicker Multimedia Fusion 2
    Fralex's Avatar
    Join Date
    Sep 2008
    Location
    Melrose, MA
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: But it looked so simple!

    I meant to try this out sooner, but there was a problem with my computer's memory and I couldn't work on my game for a while. Anyways, I just tried what you said, but I think I'm doing it wrong still. Now nothing moves.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Simple INI example
    By happygreenfrog in forum File Archive
    Replies: 0
    Last Post: 18th December 2013, 06:55 PM
  2. Issue or not? Blur shader always looked like this?
    By Fuuriokun in forum Hardware Accelerated Runtime
    Replies: 7
    Last Post: 24th May 2013, 05:58 PM
  3. Has Clickteam looked into PlayStation Mobile compatibility for PS Vita releases.
    By ViktoROBO in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th October 2012, 05:47 PM
  4. This is probably really simple...
    By dMGalaxy in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 3rd July 2011, 11:45 PM
  5. Simple Ai
    By Martin in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th February 2008, 05:33 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
  •