User Tag List

Results 1 to 5 of 5

Thread: Left Mouse click with additional condition problem

  1. #1
    No Products Registered

    Join Date
    Sep 2006
    Location
    Germany
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Left Mouse click with additional condition problem

    I have a very strange problem and I try to explain in detail what I am curious about.

    I have Two conditions followed by a lot of events:

    User Clicks with Left Mouse Button on Active Picture (Inventory)
    + Groupitemvalue ( " INI ", "Cursor", "ItemID") = 0

    User Clicks with Left Mouse Button on Active Picture (Inventory)
    + Groupitemvalue ( " INI ", "Cursor", "ItemID") > 0

    I have 12 Active Pictures on my Frame which indicates 12 Inventory Slots, I spread a Value through them on Start of Frame, thats works fine.

    I have a loop that looks up an Ini File 12 times and reads the item from the Ini:

    [Cursor]
    ItemID=0
    [1]
    ItemID=4
    [2]
    ItemID=5
    [3]
    ItemID=1

    etc.

    That works fine.

    now what I want to do with both conditions is that I want to move Items from one slot to another. Therefore I put up a Cursor Group into the INI file.

    Now on

    User Clicks with Left Mouse Button on Active Picture (Inventory)
    + Groupitemvalue ( " INI ", "Cursor", "ItemID") = 0

    It reads the ItemID from the clicked Active Picture and writes it to the Cursor Item in the Ini. After that It puts in a 0 into the current ItemID clicked.

    User Clicks with Left Mouse Button on Active Picture (Inventory)
    + Groupitemvalue ( " INI ", "Cursor", "ItemID") > 0

    Does the Way around. It reads from Cursor and writes to the clicked Field.

    I hope you could follow me until here.

    Now if I change:

    User Clicks with Left Mouse Button on Active Picture (Inventory)
    + Groupitemvalue ( " INI ", "Cursor", "ItemID") > 0

    to be a RIGHT ! click it works, with both conditions to LEFT click it does not work.

    and I wonder why?

    I mean "Groupitemvalue ( " INI ", "Cursor", "ItemID") > 0" or "Groupitemvalue ( " INI ", "Cursor", "ItemID") = 0" there is a difference.

    I simply don't understand why

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Left Mouse click with additional condition problem

    I'm pretty sure I know what you're talking about, and if so, it's a problem that I often run into.

    Basically what I think you're saying is going on is this: If you click on the active picture it checks those two events and then afterwards it changes the value. The problem is that the events are run so close together that it does one event straight after the other.

    Let's simplify this example... If you had an active object, and you had two events:

    On left click on active
    + Counter = 0
    Then set counter to 2

    On left click on active
    + Counter = 2
    Then set counter to 4

    Now what would happen is that when you run the program and click the active, the counter would be set to 4. That is because of the event order, the first event is true, and the counter is set to 2. But then the next event is also true and counter is set to 4.

    Here is my work around; you introduce another countdown timer in the form of an alterable value, I'll call it Timer for simplicity. Now look at these events:

    On left click on active
    + Counter = 0
    + Active.Timer = 0
    Then set counter to 2 & set Active.Timer to 3

    On left click on active
    + Counter = 2
    + Active.Timer = 0
    Then set counter to 4 & set Active.Timer to 3

    Active.Timer > 0
    Then Active.Timer = Active.Timer - 1

    Now if you run it again, you will have to click the counter twice in order for it to go to 4. If you used the condition "Repeat while left mouse button is pressed." Then it would tick through very fast, but it would still be visible. You can set the alterable value to 1 and it still works, but I like having the security of another 2 frames.

    So just add timers to the actives. I hope this fixes it.

  3. #3
    No Products Registered

    Join Date
    Sep 2006
    Location
    Germany
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Left Mouse click with additional condition pro

    Yes you are right, you have to check from another location to make this work.

    In my Case I added a counter and used another objects flag to be on and off if the value of te counter is 1 or 0.

    Also I added them in front of the click condition to make it work:

    Internal flag 0 is off
    User Clicks with Left Mouse Button on Active Picture (Inventory)
    + Groupitemvalue ( " INI ", "Cursor", "ItemID") = 0

    Internal flag 0 is on
    User Clicks with Left Mouse Button on Active Picture (Inventory)
    + Groupitemvalue ( " INI ", "Cursor", "ItemID") > 0

    Thanks.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Left Mouse click with additional condition pro

    I'm glad that you fixed it. Just keep in mind however that a flag might not always work, because if you have

    Mouse button down on object
    + Flag 0 is off:
    Set flag 0 on

    Mouse button down on object
    + Flag 0 is on:
    Set flag 0 off

    Then you have the same problem. It works in your case though because of the Left Mouse Button Click. Be sure to show us your project when you're finished

  5. #5
    No Products Registered

    Join Date
    Sep 2006
    Location
    Germany
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Left Mouse click with additional condition pro

    Right

    Just added

    TempTimer = 1
    --> Set flag 0 off

    TempTimer = 2
    --> Set flag 0 on

    And added TempTimer in my previous Conditions

    Works like a charm


    btw.

    Im working on my Burntime Remake ( http://www.burntime.org ) and after 2 years of preparation I might actually be able to finish it

Similar Threads

  1. Pong: How to have ball stick to paddle and launch when left click of mouse
    By rubes in forum Multimedia Fusion 2 - Technical Support
    Replies: 26
    Last Post: 14th June 2016, 03:10 PM
  2. MMF2 - Random Object Creation and Left Mouse Click Question/Issues.
    By peejaygee in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 31st December 2013, 12:32 AM
  3. Mouse movements and left click
    By videogiochi in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th January 2011, 03:38 PM
  4. shooting at a mouse object with left click
    By vincent in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 21st June 2009, 04:24 AM
  5. Sub App Mouse click problem example
    By TreeHugger in forum File Archive
    Replies: 8
    Last Post: 28th October 2007, 05:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •