Alon's Forum Posts

  • Are you interacting with the wake up timer in any other spots in the event sheet ?

    Nope, my intention is that as soon as a stage begin (any stage that this creature may appear) the timer will start running on the start of the layout.

    For now I only used it here, but since it's not working... I disabled it.

    I REALLY rather use a timer instead of the variable anyway.

  • I also wanted to point out that if your expecting that timer to happen more than once it won't. The value of 8 is only being set once on the start of the layout.

    Yes, the idea is that it will work only once as soon as a the STAGE (layout) begins, not more than that.

  • True, the state-machine is a mess, the only reason you see same negative on other states is because it's the only way I could make it work after so many tests, and it is working.

    But I still don't understand why the Event sheet ignores the Timer or the Instance Variable... I'm so confused by now.

  • First of all thank you so much for trying to help kriand and rhg1968 I appreciate it!

    I bet you right and it is on something else on my "already confusing" event sheet, consider it's the first game I ever make while learning C3 (so far it'super fun!).

    To be honest, I rather just use a timer instead of the manual variable, so here is the state machine I made for the creature "Flymo" it is a bit of a mess, but it works.

    Maybe something in the state-machine makes the Event sheet to ignore the TIMER or the Instance Variable?

    Because it is weird that IT IS WORKING from the properties but not when I set the variable on the event sheet itself... any ideas?

    Here is my current update event sheet:

    The variable stops at ZERO as it should, it works great!

    BUT! it IGNORES what I set on start of layout 'On start of layout' set 'Wakeup_Timer' to 8.

    I even tried to combine the start event above on the state machine, no different.

    I'm still scratching my head why would the Event Sheet IGNORE the values, BUT still works fine as it's priority is to look at the Instance Variables properties?

    and why does the TIMER (disabled from line 166-168) does not work?

    If you have any ideas or a direction I could try, please share your helpful tips, THANKS AHEAD! :)

  • Any ideas, I just got rid of the 'Trigger Once' and it does stop on 0 so that's a progress, but

    it is NOW LOOP to the 'SLEEP' state once it's on zero...

    And the other REAL issue.

    Why the Event Sheet ignores the Start of Layout where I want to SET the initial value?

    I think it's the same error or bug why the TIMER behavior is totally IGNORED as well (you can see it's there disabled) that's why I made it manually with a variable.

    Any ideas or suggestions how to make the event sheet to NOT ignore the variable?

    I also tried this, Same issue:

    It's stuck on a LOOP, Once it's 0 it's getting back to "SLEEP" instead of "AWAKE" like it worked with the 'Trigger Once'.

  • If you'll look carfuly in the image above, in line 171 I did set when it's LESS or EQUAL to 0 >>> Set to 0.

    So it's supposed to set it to 0 once the creature AWAKE.

    BTW - I did try to set it the way you suggested but it still ignores the SET to 0.

    But it is IGNORING this as well on the event sheet.

    I cannot understand why, but it makes everything much harder for me because the Event sheet ignores the variable, but NOT from the properties... so where is the error?

  • Hey all,

    So, I ran into this weird issue, I'm not sure what I'm doing wrong.

    I've tried to make a simple TIMER for the creature to change states from "SLEEP" to "AWAKE" and I'm not sure why it didn't work, nobody answered on my other reply so I tried something else.

    So I made a manually Timer using an instance variable for the creature and subtract 1 every second, simple and it works.

    THE PROBLEM:

    I usually like to set my initial numbers on my event sheet instead of the properties.

    No matter what I type on the Event Sheet to tweak the new instance variable for the timer I made, it's ignoring it and ONLY follow the one on the properties.

    I checked on the Debugger and it also keep counting down -1, -2, -3 etc.. forever, instead of SET to 0.

    So, what am I missing, what am I doing wrong that ANYTHING for this instance is ignored, but only works from the properties?

    And how can I fix that, please help?

    Thanks ahead! :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • UPDATE:

    I've managed to solve issue #1, the solution was pretty simple (I still have much more to learn)

    Basically I've added another sub-group so I can ONLY DISABLE it's input, but not all the PAUSE group:

    So issue #1 is solved and that's a nice progress for me.

    But issue #2 is more tricky for me to understand, because I still want to control with KEYBOARD or JOYPAD on a MENU selections but... these will also affect the player, sounds like a CLASH between the inputs.

    Any idea how I separate or FOCUS on the MENU SELECTION without affecting the player?

    I think it might be the same concept of sub-groups... but I'm still not sure how to do that, if anyone have any experience with multi-input control over each other please share your wisdom!

    In the meanwhile I'll try to solve this, but help is always welcome!

  • Hey all,

    I made a simple PAUSE for my game using the 'P' key to toggle which works perfect:

    As you can see on the image, I also disable the PLAYER's input for both keyboard and joypad while pause is TRUE. so far so good. But now I'm scratching my head for some issues I don't know how to solve.

    1 - I have some timescale affecting most of the game but not all, EXAMPLE:

    When the Player collecting a special object the game is PAUSE for a quick second, it will PAUSE the game except that MESSAGE SPRITE that appears with fade-in and fade out, than the PAUSE is false again.

    So it works great, BUT! I can interrupt it if I'll press 'P' while it happens, which I don't want the 'P' to be able to interfere this action.

    So how do I "BLOCK" any input of the keyboard so it won't affect this mini-pause during the game?

    2 - In some other point of the game I want the game to PAUSE, Show a MENU to let the Player select an option (with the arrow keys or joypad) BUT! as you can see the current PAUSE will disable the Player's input so I can't do anything.

    And if I will enable it, it will move the MENU OPTIONS WITH THE PLAYER... both will be affected.

    So how do I make only 1 input affected at a time, like a PAUSE MENU inside a PAUSE that I described.

    If anyone can help me solve these 2 questions I'll appreciate it, Thanks ahead!

  • Thanks for your advice and example NetOne, it sounds like a good solution!

    I'm not sure why, but it's not working for me...

    here is what I tried, the enemy keep sleeping, never awakes:

    * I also tried without "Is Timer.." just to see if that was the issue, but I get the same result.

    I don't want to mess with my State-Machine for this creatures as it's very complex already, that's why I just wanted a simple TIME RESTART.

    Can you tell me what I do wrong, so I'll try to fix it and make it work with a Timer?

    Thanks ahead!

  • Thanks for your advice mOOnpunk I appreciate it but to be honest it's more confusing to me.

    Also, I don't want to mess with the animation / frames since my state-machine are based on these already and it will make a hard time for me to follow.

    Isn't there a simple action that Replicate what the 'Restart' button on the Debug mode does?

    it seems like it resets the all game / application including the TIME.

  • Hey All,

    I have this creature which is on "SLEEP" state, and once the TIME of the game = X seconds the creature will change state to "AWAKE" and then "FLY" and do it's state machine actions...

    Usually I test the game on normal Run / Preview and when I ran into issues I use the Debug Mode.

    When I test the game (without debug mode) I made "F5" key to Restart the Layout. it won't RESET the time of the game, so my creature will SLEEP forever now...

    But when testing in Debug Mode, using the RESTART button, it will actual reset the time of the game and EVERYTHING WORKS GREAT!

    MY QUESTION:

    How can I reset the layout AND THE TIME of the game using the same "F5" key? (without debug mode)

    I tried to look for Reset Game or Restart App or something, but didn't find... am I missing something?

    I have a feeling that I'm missing a very basic option, please guide me. :)

    Thanks ahead!

  • Thanks for the help sizcoz I appreciate it!

    As I mentioned above, I made it work with 2 lines without 'FOR' or 'FOR EACH' loops, and the documents didn't help me with their text examples because I'm more visual anyway that's why I hoped that someone to explain when I'll use 'FOR EACH' and when 'FOR'.

    Also, when I use 'FOR' loop what is the index start and end means? still didn't understand it exactly, I mean... number of instances? or number of times it will run the loop? I'm not sure exactly but a would love to finally understand when I should use 'FOR' and 'FOR EACH' because I feel like I'm missing a really powerful and useful way to code when skipping them.

  • Hello All,

    I made this simple test using Line of Sight, I want it to affect on each one of the instances of the enemy.

    The LineOfSight Range = 64, Cone of view 360 so it will be easy to test.

    I added a visual way to TEST this: Frame 0 = Eye is Closed, Frame 1 = Eye is Open.

    What am I missing on the "FOR EACH" code ?

    I think I don't use the "FOR EACH" the right way, but.. I thought it should be as simple as I did.

    Can you please EXPLAIN what I am I doing wrong on the code and how to fix it using "FOR EACH" ?

    EDIT:

    I guess even after reading about 'FOR' and 'FOR EACH' loops, I still don't get it... (I'm still new to this)

    Yes, it WORKS with 'FOR' loop, but it made more sense for me that "FOR EACH" will work because of EACH instance of the enemy, but I'm now more confused than ever.

    Also, it works without ANY of the loops, just the two conditions. so if I understand correctly most actions works by default "per instance" or "for each one of the instances" but I'm still very confused and would love to understand based on this example if possible about 'FOR' and 'FOR EACH' please?

    I'll appreciate if someone will be kind enough to explain this to me based on THIS example I post above (with the GIF). Thanks ahead!

  • Hey All,

    As I'm learning Construct while working on my game, I appreciate the amazing fact that there are many ways to code the same thing and it's very dynamic and amazing to me.

    So, while I'm working on my game there is a part of the code where I have X amount of instances of the same enemy should be chosen randomly and change direction.

    THIS CODE is working perfect, but... one of my goals is to see if I can "compress" some of my code to have more efficient to my eyes and on the way learning new ways to do the same thing.

    This is the current code: (works great!)

    Notice the Red Enemies Wandering:

    If you'll look carefully on the GIF, Every single instance of this enemy is picked randomly and not just ONE at the time but it could be few, each one is affected individually by this code which is exactly what I wanted.

    Now, my CHALLENGE is to find a shorter code using "FOR EACH" and maybe "PICK" combined?

    Could this be done without additional Variables? that will be magic!

    I didn't find a good way to make it work with FOR EACH and PICK: my results always chose ONE at the time. means once it PICKS an instance, it affected ONLY ONE of them at the time, so the others either ALL stopped, or ALL continue walking without stopping at all, which is not what I wanted to do unlike the (working perfect) example above.

    Can you please help me Re-Code the same example using the built-in "FOR EACH" + "PICK" events and maybe make this magic in a shorter, simple code? it will be a GREAT way for me to learn as well.

    This should be interesting, PLEASE add either example file, GIF or a snapshot of the code so I can give it a try.

    Once again: I know, it works, I should leave it like that... but it's a great way for me to learn other ways using FOR EACH and PICK and see different thinking from you guys with much more experience than me.

    So the shortest code, the less variables, the better! but do it YOUR way and I'll give it a try.

    Thanks ahead!