Making events happen only once!

AnkitDhillon

  • Posts: 50
Hello,

Recently, I am getting into a lot of situations where I find an event happening a lot of times while it should only happen once when it becomes true. I have read stencylopedia and there I find that I should make a variable to make the event happen only once but I have so many events which needs to happen only once, so it will be insane to make separate variables for all of those, Please help and tell me what to do!

Thanks.

ETHproductions

  • *
  • Posts: 430
I would do this by making a custom event for each of the different events that need to happen. Then you could just use a trigger event block instead having a different attribute for every one of the events.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Photon

  • Posts: 2697
Can you show us the code/behavior you are using please?
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

AnkitDhillon

  • Posts: 50
@ETHproductions, thanks for the idea, I think its better then making making lots of variables.
@Photon, Actually its a problem which I am facing throughout my game's behaviors. An astonishing bug appears from time to time and after hours of dwelling I find its happening because the event is happening more then once. Do you have any suggestion regarding it ? How do you go about when you want something to be created or drawn only once when a condition is met ? At the moment I use a 'If' to detect if condition is met and then carry out further events.

Thanks a lot for the help.