Trigger an event from another event (maybe using signals?)

Get help using Construct 2

Post » Sun May 29, 2016 4:58 pm

I want to keep all of my sound events in a sound group, but I have a few conditions/events that are specific and I'd like to have a "play sound" event in my soundfx group happen when a condition outside of the group occurs. I tried using signals, but the only way it worked was by having "if true once" as a condition, and that wasn't useful since it only happened once. Can you trigger events in one event FROM another event?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sun May 29, 2016 5:09 pm

Use a function (add a function object), set the triggering event to call the function "sfx" (you can name it what you wish) with whatever parameters you wish as an action. Also pass "sound file" (or some other kind of flag) as parameter 0. Once you get comfortable with using functions you can experiment with multiple parameters.

On function call "sfx":
Define/add a local variable for "sound file" under the function "sfx" called event.
Set "sound file" to function.param(0) (this will retreive parameter 0)
Next do subevents under the function called condition:

on "sound file"=whatever
play sound applicable to whatever
B
15
S
6
Posts: 85
Reputation: 1,195

Post » Sun May 29, 2016 9:38 pm

Pulstar wrote:Use a function (add a function object), set the triggering event to call the function "sfx" (you can name it what you wish) with whatever parameters you wish as an action. Also pass "sound file" (or some other kind of flag) as parameter 0. Once you get comfortable with using functions you can experiment with multiple parameters.

On function call "sfx":
Define/add a local variable for "sound file" under the function "sfx" called event.
Set "sound file" to function.param(0) (this will retreive parameter 0)
Next do subevents under the function called condition:

on "sound file"=whatever
play sound applicable to whatever

Thanks, I forgot about functions! Need to learn a bit more about the parameters :/
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253


Return to How do I....?

Who is online

Users browsing this forum: Cha0tiXGamer, GraveSoul, MaujDeveloper and 7 guests