Alon's Recent Forum Activity

  • 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!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

  • Hello All,

    I'm trying for the first time in my game to work on a smarter enemy than my basic one.

    The idea of making a Machine State make sense to me so the enemy can change his state and animation from one to another.

    So far so good, But since there are many ways to do so I have the feeling I will go lost very soon and will have issues even that I'm very organized in my event sheets, so I would like to ask you if my idea is more complex than it should be or not.

    My Enemy actions, states I will need to play with including animations:

    - IDLE (stop)

    - PATROL (wander, until sight of view is overlapping the Player then change to "ALERT" state)

    - ALERT(stop, when "Ready to Jump" animation is finished: change to "JUMP" state)

    - JUMP (Simulate JUMP, change to "ON_AIR" state)

    - ON_AIR (2 frames loopable as long as the enemy is on JUMP or FALL, not on floor)

    - LAND (stop for a second) change to "IDLE" state) and loop the all state machine again and again..

    Inside my head it works great, but I know it will have issues since I never done that in C3 yet.

    First, I'll make the state machine I'll use strings on instance variables for the enemy.

    Questions:

    1. Do you think this should be done using GROUPS, each group will contain the actions I described above using enable/disable all but one at the time? because I rather have this all thing very organized so I can follow.

    2. From your experience: Do you have any suggestions to make it work with no issues I may ran into?

    Thanks ahead!

  • You do not have permission to view this post

  • I'm not sure if I understand exactly, so I tried something like that:

    I even tried this: (got rid of the sounds to make it easier to follow)

    As you can tell I'm already lost and confused... I have no idea how to fix this mess.

    I'm so close, just need to figure this out and the system I designed should work for the game.

    Any ideas, changes I can tweak will be very appreciated and helpful.

    Thanks ahead!

  • That should work, I don't see the need for the pop event though so that can be removed.

    With or without the pop event I get the same result.

    Any alternative ideas for solution?

    I'm stuck :(

  • UPDATE: I almost got it to work!

    I Re-Shaped the all thing, renamed the variables so I can follow etc..

    THE ONLY THING that isn't working for me is once an Item Moved from the "arr_Items" (default Items) to the "arr_Items_LOCKED" (Unlocked Items) the item that picked and moved is NOT DELETED after it moved.

    On the Debug: when I press F6 it moves any of the 2 unlocked items randomly which is GREAT!

    But it won't delete so I if I keep pressing F6 it will keep adding them to the list.

    Can someone please have a look at the CODE maybe point me how to fix it? I probably missing something or did some error... just when I started to like Arrays.

    HELP please? :)

  • OK, I think I'm almost there... but I don't know how to code the RANDOM pick from the 2nd Array to the 1st and remove the one that picked.

    Here is what I got so you'll have an idea and hopefully can guide me through:

    Above are the Items we begin with "Arr_Items" - All items that can be found by default:

    Next is the trigger: Pick a random NEW ITEM from "Arr_Items_LOCKED" and add (push) it to "Arr_Items", Then, Delete that picked Item.

    I don't know how to do that yet, but I did some progress.

    The Debug shows that both Arrays are set EXACTLY with the items I chose, so at least I got that right:

    please help? :)

Alon's avatar

Alon

Member since 20 Feb, 2014

None one is following Alon yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies