How do I stop events with mouse click conditions

0 favourites
  • 7 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • So I have an event with the following conditions:

    Mouse click on Object

    Variable A = 0

    Among the actions it does is modifying the variable so that clicking on the object a second time no longer triggers the event.

    However, that doesn't work and repeated clicks on the object keep triggering the event, which baffles me. For the sake of testing I've putting the variable's initial number at something other than 0 and the event doesn't trigger anymore, which makes it even weirder in a way. I'm frantically looking for a workaround, but even if I , this is really driving me crazy as the same structure seems to work perfectly fine for me in other situations.

  • We'd have to see the code to help properly.

  • The create object is there just for test purposes.

    Edit: It seems i can't post a link, but it goes like this:

    Conditions

    Mouse - On left button clicked on Object A

    Object B - Variable = 0

    Object C - Variable = 0

    Object D - Variable = 0

    Object F - Variable = 0

    Actions

    Object B - Add 1 to Object B Variable

    Create Object B

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So I have an event with the following conditions:

    Mouse click on Object

    Variable A = 0

    Among the actions it does is modifying the variable so that clicking on the object a second time no longer triggers the event.

    However, that doesn't work and repeated clicks on the object keep triggering the event, which baffles me. For the sake of testing I've putting the variable's initial number at something other than 0 and the event doesn't trigger anymore, which makes it even weirder in a way. I'm frantically looking for a workaround, but even if I , this is really driving me crazy as the same structure seems to work perfectly fine for me in other situations.

    do you have any wait events between them? where are the condition palced in your event sheet? try place it on a top ranked event ... near start of layout .. that wold do the trick.. since will not wait for others events to happen.

    you have to keep in mind when you add wait actions between lines

    it wont stop only that event but also everything that is under it for the exact amount of wait + the amount the time it takes to process all the events till reaches the required action, so for example

    if u have the conditions u gave, and have a wait of 2 seconds and then change value of VariableA and in same time, after first click and while the 2 seconds didnt passed youl be able to trigger the same actions for N clicking speed u have in ur fingers. then the VariableA will change the value.

    try change variableA as soon as the conditions are meet, which is first on top of actions triggered by those 2 conditions.

    try posting urls without or http://www. that will allow u if u need live help u can reach to me via skype at gamecorp.tm or via mail at zgaagz [at] gmail.com

  • The event is at the top and there are no wait events happening while I'm testing this. The clicking triggers indefinitely. As in, if i keep clicking, it keeps happening, regardless of clicking speed.

  • does your event look similar to this?

    http://scirra.ro/examples/eventstrigger1time.png

    dont mind the image point position my brain farted there.

    if it looks like above image should not allow u to trigger the actions after 1st press unless All conditions resets themselves at some point and the conditions are meet again when ur pressing. make sure ur events and event sheets that you may included in the event_sheet u have that specific action to trigger, are not interfering or resetting variableA value to the point where it meets the condition to match the matrices you created for the action to be triggered.

    on short... make sure variableA stays different then 0 after u pressed the object. thats all u have to do. if u sure nothing resetting it back to 0 then u might found a bug. or some cache from firefox. try resetting the browser if that wold help or try testing it in NW.js if u have it installed.

  • I was being stupid. Sorry for pestering about that. The problem was probably that since i was creating new instances of the object and it started with reset variables, the conditions would stil be met. Apologies.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)