Variables IGNORED on Event Sheet ?

  • Without being to play around with it I don't have much I can suggest.

    The only thing I can add is try again with the timers, they do work. I wonder if the issue is that you're setting the state while it's running. Try commenting out the is running event and enable the other 2 and set the state to sleep on layout start. Then time should fire and set the state to awake. Now if something else causes the state to switch back to sleep that's another story.

    If you want me to look at your actual project, I could give you my email so you aren't sharing your project with everyone. Just let me know.

  • Just to show you an example of using timers successfully in my project. Maybe it'll spark an idea for you.

  • Thanks for sharing.

    I actually use multiple Timers on my project not related to this creature and all are working great.

    I just have issues on this specific creature's event sheet and not sure why.

    I even tried my luck on the latest stable release r120 with the C3 Runtime but not only that the game freezes after couple of seconds, I have SO MANY BUGS with the effects and the game looks like a mess so I got back to C2 Runtime until it will be stable.

    I'm not seeing anything on your timer that or on mine that isn't suppose to work, but maybe I can't see it...

    I don't know what should I try next, I mean for now it works without the timers, but it still ignores the set variable action on the event sheet which is not what I like when I'll need to tweak it later.

    It's like construct is looking on the Instance Variable properties as 1st priority, and ignore the event sheet but... WHY?? :|

    Also, of course... it doesn't make any sense why the Timers are not working and ignored as well on the event sheet, even if I change the order of these actions to the top of the event sheet = nothing!

  • One last thing I'll throw out. I can't tell from the screen shots you included if this event sheet is the main one or an included one. If it's not the main one, are you sure you included it ?

    Other than that I'm at a loss without being able to see the project.

  • Yes it is an included one, and it is included on the main event sheet.

    I do this for better organize.

    Also, anything related to this creature (or other enemies) is ONLY on this event sheet, that's why I love the include feature so much.

    Yeah... I'm still scratching my head, I guess I'll have to stay with this error because I have no idea why it's happening, even when it's not related to the state machines it's still ignoring the event sheet and look at the Instance Variables properties as 1st priority.

    It's limiting me, especially if I'll need to change variables or Timers on the event sheet. :(

  • So... I did a test, I thought it may help you rhg1968 helping me :)

    I tried the exact same code as the image above, but I did 2 different tests:

    1 - I replaced the Instance Variable with a Local Variable = Same result (ignore the event sheet)

    2 - I replaced the Local Variable with a Global Variable = IT WORKS! (listening to the Event Sheet)

    Any ideas why only the Global Variable works is not ignored while Instance and Local variables are ignored by the event sheet? I'm curious because I would like to learn from my mistakes.

    Timer is still ignored on the event sheet = a mistory!

  • I couldn't see where you defined the variable in the event sheet screen shots. If you want to have a local variable maintain it's value between tick event or each time the event sheet is executed, you need to mark the local variable as static. Otherwise it gets reset with time through the event sheet

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I couldn't see where you defined the variable in the event sheet screen shots. If you want to have a local variable maintain it's value between tick event or each time the event sheet is executed, you need to mark the local variable as static. Otherwise it gets reset with time through the event sheet

    I didn't know that! I always used the default settings of the variables, because I didn't understand the different options from the manual very well (blaming only myself, not the manual).

    So now with STATIC checked, it works as Local, which is MUCH more organized as I put it on the Creature's Group.

    This is very helpful rhg1968 thank you!

    To be honest, I'm still not sure why the event sheet ignores the Timer but at least I can work with the Local Variable now.

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