CannedEssence's Recent Forum Activity

  • If you see "green arrow" in condition field it would fire once time. Use global variable or method do not have green arrow, it would do action in every tick.

    Thanks for the suggestion. However, as I said in my previous reply, it's not the event condition that's keeping the function from firing for each instance of the "Sprite" object. For example, look here:

    <img src="http://cannedessence.com/public_images/functionIssue2.jpg" border="0" />

    Notice how I got rid of the "green arrow" trigger condition. However, if you try this out in the capx, you'll see that it is still only calling the function once per tick, passing only the first instance.

    Once again, if I did not have that function call, it would perform the action for the whole batch. It is entirely related to the function call from what I can tell, but I don't know why.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I'm having some difficulty understanding what you're trying to achieve here, but it looks like the function will only run once because you have it set to on mouse click. If you wanted it to keep running you would need to set up a variable and if it was true then run the function every tick, if it was false stop the function.

    The hasMoved variable is an instance variable, so the event should pick all objects with their hasMoved set to true. If you uncomment the disabled action, you'll see that it does in fact successfully do that.

    This generic project is designed to isolate the function call as the problem. If I hadn't used that onrightclick trigger, but a different means of picking all the objects, it would do the same it is doing now.

    So it appears that it is picking all the objects, but only calling the function once, passing the first object's uid.

  • CAPX: iu.box.com/s/kkldjgprvbys5hk97fs1

    I've created this sample to isolate a problem.

    Essentially, when more than one objects are picked in an event, and I try call a function with the UID as the argument, it seems to only call the function once.

    Thanks, any help would be appreciated.

    UPDATE: Added image below in case you can't see CAPX

    <img src="http://cannedessence.com/public_images/functionIssue.jpg" border="0" />

  • Whats wrong with a function, and/or a wait?

    So, you're suggesting with a function I would do:

    Event: Buttmode == True

    etc conditions...

    Main Event Actions:   CheckForExtraButt()

                          ButtPoints += 10

                          ButtMode = False

                          ExtraButt = False

    Function ExtraButt()

        Event: ExtraButt == True

          Actions: ButtPoints += 1000

    Is that correct?

    With that workflow I would have a separate function for each simple if condition I needed to check before the other actions.

    Not sure what you mean by a "wait". Are you saying to add to the main event's conditions a wait .5 seconds or something? So that the sub-event gets asynchronously checked?

    Thanks for all the tips

  • Hmm... I guess an empty sub-event would do the trick... I'm just getting into this, and somehow I'm kind of scared of the "tricks" I'm going to have to do.

    Thanks for the suggestion!

  • Sorry, let me revise my original example. I got carried away with the butts. Add an action to main events where ExtraButt is also assigned to false

  • Hi, I couldn't find the answer by searching.

    I'd like to make my sub-event trigger immediately after the event fires, then do then perform the main event actions.

    For example:

    Preferred:

    Event: Buttmode == True

    etc conditions...

    Sub-Event: ExtraButt == True

        Sub-Event Actions: ButtPoints += 1000

    Main Event Actions: ButtPoints += 10

                          ButtMode = False

                          ExtraButt = False

    How it is now:

    Event: Buttmode == True

    etc conditions...

    Main Event Actions: ButtPoints += 10

                          ButtMode = False

                          ExtraButt = False

    Sub-Event: ExtraButt == True

        Sub-Event Actions: ButtPoints += 1000

    If main event actions fire first, then the sub-event won't fire because ButtMode is assigned to false. How do I move the sub-event up before the main event actions?

    Thanks!

CannedEssence's avatar

CannedEssence

Member since 17 May, 2013

None one is following CannedEssence yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies