More than one event to one action

0 favourites
  • 6 posts
From the Asset Store
11 loops of RPG, chiptune/8-bit music. Suitable for any pixel art game.
  • I know this has to be possible, but I've been looking for it but obviously my search parameters are not the correct one.

    I'm debugging my thing, and I'm trying to use a text list or a button style menu.

    But in order to test them nicely, I have to remake events, so is it possible to add two events that do the same actions?

    [On Touched] [Text]           -Actions

    (or) [On Touched] [ButtonX]

    I can do this, duplicating the same actions for separate events, but I'd keep my code tidy if I could merge events like that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's possible with a group. You can create a disabled group "myGroup" and put the actions there + as last action: disable group "myGroup" - all actions in a blank event in the group.

    At both touch events create the action set group "myGroup" enabled

    The groups actions are system actions.. ;)

  • "or" is on Scirra's todo list.

    For now, I don't see anything wrong with copying and pasting events.

  • just use a function

    if event1: call function 1:

    if event 2:   call function 1:

    function 1: do thing   ( needs function plugin)

  • if you have tones of action that are triggered by different events you can also use a local variable to fake a "or"

    +[empty]
      local nubmer or = 0
      +ConditionA
        -> System: set or to 1
      +ConditionB
        -> System: set or to 1
      +Systeme: or = 1
        -> Execute
        -> My
        -> Tones
        -> Of
        -> Action

    Against a simple OR use it's just one more action per condition

    +ConditionA
    +OR
    +ConditionB
      -> Execute
      -> My
      -> Tones
      -> Of
      -> Action

    So it's not so bad

    Of course if it's just one or two action it might be an overkill solution

  • Thanks, guys. I'll test all these shortly. ;)

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