User Tag List

Results 1 to 4 of 4

Thread: Comparing 2 global values question

  1. #1
    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,249
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)

    Comparing 2 global values question

    So, the more I experiment with this the more confused I get. I'm spreading values on all my enemies and creating them through a fastloop. I set the appropriate enemy to his appropriate shadow spot with a "Compare 2 Global Variables" condition. This works fine.

    Then I am trying to get a single enemy to jump. My jumping code tests for the enemy's position in relation to his shadow spot. But when I use either "Compare 2 Global Vars" or "Compare Enemy Pos to a Var" neither one seems to work.

    Can someone explain the difference between these 2 methods of comparison and which cases you would use either of them in?

    Mobichan

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Comparing 2 global values question

    "Compare two global values" only compares one of every object. It also doesn't filter the selection of any objects, the test either passes or it fails.

    "Object: Compare to alterable value" tests every "object", but only one of any others in the expression side. It filters the "object"s that pass or fail the test, but not any others.

    Don't use "Compare two global", it almost never does what you want.

    If you loop, do:
    Spread value 0 in alt val of "object"

    Start loop "A" for number of "object" times

    On loop "A":
    compare "Object" alt val = loop index (chooses just one "object")
    compare "object 2" alt val = (loop index) or (fixed "object") or (alt val "object") depending on how you linked them. This tests all "object 2" against the one "object" chosen in the previous condition.

  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,249
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)

    Re: Comparing 2 global values question

    Thanks for the explanation. Upon further inspection, my initial spawning code seems to work fine if I compare my variable using either method, but falls apart when I add my jumping code.

    So I guess I need some advice on how to adapt my jumping code. The basic idea follows an example Random posted. It looks like this:

    +Upon pressing spacebar
    -Set JumpTimer(drop shadow) to 15

    +ID of (enemy) = ID(drop shadow)
    -Set Y Pos(enemy) to Y(drop shadow)-JumpTimer2

    +ID of (enemy) = ID(drop shadow)
    +Y Pos of (enemy) < Y(drop shadow)
    -Sub 1 from JumpTimer(drop shadow)

    +ID of (enemy) = ID(drop shadow)
    +Y Pos of (enemy) >= Y(drop shadow)
    -Set Y Pos(enemy) to Y(drop shadow)
    -Change animation (enemy) to Stopped
    -Set JumpTimer(drop shadow) to 0
    -Set JumpTimer2(drop shadow) to 0

    +ID of (enemy) = ID(drop shadow)
    -Set JumpTimer2(drop shadow) to JumpTimer2(drop shadow)+JumpTimer(drop shadow)

    The expected behavior is to have all 3 enemy jump when I press the spacebar. Currently, they don't jump at all. Eventually, I want to be able to tell only one specific enemy (based on its ID) what to do independently.

    Can anyone offer any help?

    Thanks in advance,

    Mobichan

  4. #4
    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,249
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)

    Re: Comparing 2 global values question

    I've uploaded the file here: jumping bug

    The idea is that only one enemy should jump when you press spacebar.

Similar Threads

  1. Question about Global Values for Multiple-Powerup-Object
    By vSv in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th May 2013, 05:34 PM
  2. Total number of Global Alterable Values question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 16th May 2012, 10:08 PM
  3. Quick Global Values/Strings Question
    By CBSection31 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th August 2010, 12:06 AM
  4. Newbie question about global values.
    By Martin in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th May 2010, 10:25 PM
  5. Question about Global values
    By Hordolur in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 16th October 2008, 05:11 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
  •