User Tag List

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

Thread: Direction vs Counter

  1. #1
    No Products Registered

    Join Date
    Aug 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Direction vs Counter

    Hi all!

    I have a problem. I put an active object with 32 directions.
    There's a counter to display the object's current direction.
    How can i set the counter to 0 when the object's direction is "up"?
    Everytime the "up" direction is 8, and the "right" is the 0. Why?
    It worked well in the Klik&Play but i haven't got any solution in the MMF2.
    I hope you understand my problem, and sorry for my bad english skills.

    cheers,
    p

  2. #2
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2010
    Location
    Yonkers, New York, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In MMF 2, the "starting" direction, which faces to the right, is zero. Top/right is 4, and directly up is 8. MMF 2, is providing you with correct information when you understand what it considers to be zero (right facing).

    The numbers for each direction look kind of like this:

    12 8 4
    16 0
    20 24 28

  3. #3
    No Products Registered

    Join Date
    Aug 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx for the reply!
    i know the logic of the mmf2, but i don't know the solution.
    i'm trying to make a little drum machine with pots, and its important to get the 0 when the direction is "up".
    i can set the counter on each direction, but that's not the best.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Start of frame,.. set animation direction to ----> Equals Zero. Or if you would like to upload your mfa, we can take a look at it for you if you are stuck. Also you could set the counter to direction minus 8.

  5. #5
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Alway ---> Set counter to "Dir('Active)" -8

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2010
    Location
    Yonkers, New York, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, you want to redefine 0 as up, left as 8, down as 16, and so forth? I can't understand why.

    Anyway, I think ProdigyX is basically right with a small change.

    if the direction value of the object >=8 ---> Set counter to the dir value of the object -8
    if the direction value of the object <8 ---> Set counter to (the dir value of the object -8) + 32

    I think that's how it works. If you just subtract 8 from the value all of the time, you will sometimes get a negative direction value such as 6 - 8 = -2. Adding 32 should make it 30. Otherwise, a negative direction in MMF 2 will cause a tear in space time.

  7. #7
    No Products Registered

    Join Date
    Aug 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    forgot something and its important. the counter's minimum value is 0 because i'm making a synthesizer project, and if the counter is negative the sound generator don't work.

  8. #8
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2010
    Location
    Yonkers, New York, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My directions should always give you a positive number. Try it out.

  9. #9
    No Products Registered

    Join Date
    Aug 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks man, its working
    but there's another problem, how can i invers the counting? i mean, the "up" is 0 and the next directions to right are +1?

    potz.mfa

  10. #10
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2010
    Location
    Yonkers, New York, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wonder if we're re-inventing the wheel.

    Okay, add this:

    If counter is > 0 and < 16, then set the counter to 32 - counter value
    If counter is > 16, then set the counter to 32 - counter value

    So, with the direction being adjusted with the actual direction value of 8 (up), now equal to 0, let's test it. An adjusted value of 8 would turn out to be on the opposite side of the circle at 24 (32-8=24).

    Try it out. My brain hurts. I was sorely tempted to just say, for example if direction = 16, then set counter to 8. Then repeat the whole process 32 times.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Get Direction (Please Help)
    By Captain_Harris in forum iOS Specific Example Files
    Replies: 0
    Last Post: 13th May 2013, 02:30 PM
  2. Adding Half a Counter's Value to Another Counter
    By soloman in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 28th June 2010, 10:30 AM
  3. Set Direction on HWA doe's nothing
    By dragonguy in forum Hardware Accelerated Runtime
    Replies: 4
    Last Post: 20th October 2009, 12:25 AM
  4. Direction
    By Brovic in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th June 2009, 03:06 PM
  5. Direction example
    By Ravenius in forum File Archive
    Replies: 0
    Last Post: 14th March 2008, 07:53 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
  •