Alon's Recent Forum Activity

  • It's hard to understand what's going on by your screenshots, but I believe the reason for your problems is "Wait" action.

    You are creating multiple Wait threads, that can clash and produce unpredictable results. You should never use Wait in events like these.

    I recommend adding Timer behavior to your character. Disable controls, start "Ignore" timer, use "On timer" event to re-enable controls.

    The huge advantage of Timer behavior over Wait is that you can control it - you can restart the timer for a longer time if needed, stop it, pause (by setting object time scale to 0), calculate elapsed and remaining time etc.

    I know it's a total mess and hard to find my bug without capx but I appreciate your help, thanks!

    So since I'm still a newbie, I may did something wrong (again) but I tried your suggestion and I translated all my "wait" into Timers instead.

    The timers works just like the wait so I know for first time I did set the Timers correct consider it's new to me.

    The result = Exactly the same issue.

    Here is an example of actual what happens:

    1 - GOOD: When attack on floor or air, character stops (ignored for 0.3 sec)

    2 - GOOD: When touching the Enemy without attack, Knock-Back and Ignored for 1.0 sec.

    3 - THE BUG: When COLLISION WITH ENEMY + ATTACK, the main IGNORE 1.0 sec is not working as I need it. (Animation "HIT" works as it should).

    I'm not sure where is the clash exactly, that is why I don't want to continue add stuff to the game before I solve this major bug.

    I have a strong feeling it's related somehow to the Animation Priority System, but I can't tell...

    I'm still trying disable / enable some to get the idea what break it while scratching my head.

    Any other ideas? tips what can I try to solve this and make the first IGNORE to work over the Attack-Ignore ?

    Thanks ahead for any suggestion or help!

  • Hey All,

    Continue from my latest threads with my journey and learning as I go...

    Now I got into a new issue that I'm scratching my head can't solve it.

    I'm using 2 Separate IGNORE systems on my Player Engine:

    1

    - When the player collide with enemy he will Knocked-Back + IGNORE for 1 second.

    I also made an "Animation-Priority-System" so I can overwrite any other animation like in this case I want it to cancel any animation and play the "HIT" animation while the knock-back is happening.

    2

    - When the player press 'C' = Attack animation starts + IGNORE Player for less than a second.

    I made it so it will stop the Player on any movement including Walk / Jump / Fall while attacking.

    The mechanic's goal is to limit he player so he won't be able to MOVE while attacking.

    Current Status:

    When testing each case of the 2 Ignore, separately they are working GREAT!

    The Problem:

    When the player Jump or Fall while Attack + Collide with the Enemy there is a mess with the 2 ignores and it seems like currently it won't use the "MAIN" ignore as I want (IGNORE #1 with Knock-Back for 1 second)

    The result is mix of both and more like (IGNORE #2 the attack stops) mess it.

    It's probably an animation issue, I did try to solve it with the Animation-Priority-System I made yesterday which saved my Knocked-Back animation, which supposed to be the highest one.

    The animation does work on the highest priority but the IGNORE is NOT... working and I can control the Player while he is on the "Knock-Back" animation which is NOT supposed to happen.

    Again, if I test each IGNORE situation separate they work fine.

    I tried to add stuff such as:

    if Attack Animation is playing or while it is playing and stuff like that, nothing solved the IGNORE issue, the animation plays correct, but not ignored as it should.

    I'm not sure exactly how to fix this and hope you can help me out, I know it's hard without exploring my actual capx which I can't share but I'll do my best to show and give information.

    It's not a super secret capx, I just keep it as it's about to be my official game project, I hope that you understand and willing to help, I appreciate it a lot.

    Thanks ahead and Sorry about my bad English.

  • I CAN'T BELIEVE MY SYSTEM ACTUALLY WORKED!

    update:

    Remember how I was thinking about a crazy "idea" of making an Animation Priority-System on my first post?

    So... I decided to give it a try, basically because I didn't know how to accomplish the other solution which probably would be easier but as a newbie this is what I could think of.

    I wanted to share the Event-Sheet so more people will be able to see the solution and it may help others in the future BUT! I can't fit the all thing in one image when capturing...

    I wish we had a BUILT-IN FEATURE for capturing full event sheets within Construct 3!

    is this feature already there and I'm not aware off? if YES please let me know.

    So far it works like charm!

    I'm glad I didn't have to use fake animations, speed changes and such.

    I got much more control on ANY animation WHENEVER I need, I'm impressed by this tiny system and I hope it won't disappoint me on more complex parts of the game development.

    Here is a visual example:

    I use some slow-motion for my tests, that's why it's slow in some parts.

    And now, for the more complex part:

    "STOP PLAYER when attack on any condition" such as: Attack while Jump, Attack while walk, while fall, etc..

    It's not like the IGNORE, but it should stop the player, I may try SPEED = 0 or something first.

    That's why you see the "Movement" variable / text on my GIF...

    OH MY! I had so many issues with it on my last attempt... now that I Re-Code everything from scratch it may be working, I'll give it a try.

    Any suggestions on this will be great!

    Thanks ahead.

  • Thank you so much for the detailed reply.

    First I would like to try fix it with your suggestion of the conditions the problem is I'm not sure how to do the:

    when hit happens > animation 1 [/code:1lz2jbwn]  for example. I could found compare animation frame I guess it's not the same.
    
    The other thing is:
    My event sheets are separated, one dedicated to the enemies (all enemies, each one in group with anything related to itself and the player) so I will be able to use Enemies family if needed. for now I have only 1 enemy to work with anyway.
    
    So, the collision between the Player and the Enemy is split to 2 events, that's where I scratch my head while my event sheet is very organized.
    
    As you can see on the images attached, the collision is based on the Enemies Event-Sheet.
    While the "IGNORE" works on the Player_1's Event-Sheet. 
    [h2]I disabled "flashing" for this test, it is related to the invincible time which works perfectly fine.
    Line 22 and above is the SAME for the other side of the knock-back no need to show it again.[/h2]
    
    On Player event I selected to show which are the 2 events that if I disable, EVERYTHING WORKS consider walk and idle won't act correct as explained on my original post.
    
    ENEMY EVENT SHEET specific part of the knock-back + ignore for 1 second:
    [img="https://i.imgur.com/TPwsNGe.jpg"]
    
    PLAYER EVENT SHEET - Animation priority issues to fix:
    [img="https://i.imgur.com/YBCOwq6.jpg"]
    
    I'm guessing that I need to mess with the code on the  "Ground animations"  part to solve the issue, 
    But I'm not sure how exactly... noob mode + confusion level = HIGH   
    
       Can you please help me out guide me how to do it or show screenshot? mini-capx?
    Any visual way will probably help me try your solution it make lots of sense to me and I rather try it before the "fake animation" playing with speed and what not.
    
    Thanks ahead!
  • Hey All!

    Continue to my latest thread where I Re-Program the ALL base engine of my game:

    I'm working on the Player's basic mechanics now and how he will react as a platformer while interact with other objects such as enemies.

    Since I can't share the capx, I'll do my best to describe and SHOW the issue and maybe you can help me out here:

    The short version:

    The Problem: Player's Animation Priority is acting weird with a delay.

    When the player collide by enemy: "HIT" Animation stuck on first frame for a bit then playing. My guess is because of the Platform animations priority: IDLE / WALK on floor / not on floor etc..

    The long version where I try to describe best:

    (Sorry about my bad English.)

    I have: INPUT and ANIMATION GROUPS so I can handle the Knock-Back (ignore INPUT on enemy collision).

    So far so good, everything works!

    Originally, the player also Flashing when collide with enemy, but for better visual example on the specific animated GIF I disabled it so you can see the issue.

    THE ISSUE:

    As you can see the on collision the player is "trying" to run the "HIT" animation from beginning but it stops for a few ms and then begins.

    I tried MANY ways to solve this:

    • I made the animation to start when the variable IGNORE is "on" and back to idle when it's "off".
    • I tried when Flashing is on run the "HIT" animation, and back to idle when it's finished.
    • I tried to make a dedicated Boolean variable for the "HIT" animation condition.
    • I tried to cancel other animations while HIT is on, got messed up results.
    • I tried to "force" the HIT animation using every tick.

    All these and other attempts failed... (probably because I don't understand Construct yet, still a newbie)

    In my simple brain it should be easy:

    as long as IGNORE variable is "on" the "HIT" animation is playing. when it's "off" change to IDLE animation.

    Right now on my current code, the IGNORE works on collision for 1 second (with or without Flashing) so it's not depending on the flashing time. there is a "wait 1 second" on the collision event which ignore my INPUT group and it works fine.

    Player "HIT" Animation is 2 frames (loop forever just like idle so I can use stop it when I want)

    My Conclusion:

    After some tests, when I disable these 2 events:

    • Platform is moving + Platform on the floor = Set animation to "WALK" (play from beginning)
    • Platform on stopped + Platform is on floor = Set animation to "IDLE" (play from beginning)

    ONLY THEN the "HIT" animation works correct as it should once the collision happen for 1 second (that's what I want) then back to IDLE.

    BUT... now there are no WALK and IDLE animations because these are the BASICS of my player animation movements.

    I do have other animation conditions such as JUMP, FALL, Landed.

    I disabled every single one to make sure that the problem is related to what I've mentioned above and it make sense that it can't play the "HIT" animation because it must play the other animations first, only THEN it will play the "HIT" that is why there is that DELAY that looks like it freezes the first frame of the "HIT" animation and then when the Player stops it will continue playing it.

    So what is the solution?

    How can I set the priority of the "HIT" animation to take-over all the others while IGNORE variable is "on" ?

    The only way I can think of right now is a bit more advanced for my level but my stuuupid brain tells me to try and build some kind of ANIMATION PRIORITY SYSTEM using a variable to control each animation on specific events to overwrite each other when needed.

    it's nice in theory and all, but please consider I'm still new to Construct and it's I'm learning as I build this game, I still have much more to learn but I hope you can guide me to a simple-as-possible solution.

    Maybe there is a plugin, or built-in feature to solve this?

    maybe my conclusion is wrong and it's not even the issue and the solution is totally different?

    Yes... I'm very confused.

    Thanks ahead for any help!

  • It's a common problem I see on here as the animation checks get way out of hand, branching off into something like if player is on floor, and is not landing, and is not shooting, is not moving, then play this animation, then it becomes impossible to follow. Better to start with basics for these animations and keep it as simple as possible.

    Exactly! so I got most of the animations to work great but I still have this issue now where the Player got HIT by the enemy, so because of all the other conditions (floor / air / negative etc..) it acts weird.

    Plus it works on the Knock Back so I activate the "HIT" animation when the player is on specific time... I hope I'll solve these issues, I didn't even got to the REAL-ISSUE of the attack yet.... (noob-mode!)

  • Yeah I can imagine where the problems are with the inefficient events. As you get better at Construct you can limit the number of things you are checking against. For this you would put conditions at the start of the player's general movement saying that they are not frozen, then if they are frozen you set idle animation. Unfortunately you are now left with a bug that you'll have to debug and find out the problem. The likely cause is the timer not resetting as expected.

    True, that's why I try to organize things in groups so I will have more control. but still it won't solve everything because there are lots of things goin on for all the animations + platform player.

    Unfortunately even without the Timer, and just Boolean the bug was there... that's why I'm trying to re-code it for now, but I get so many other bugs with the animations now.

  • Well maybe not disable the whole behaviour but you can restrict movement by setting max speed to 0.

    I tried that as well, but even that the platform can't move (zero speed) animations are still acting.

    That's why I chose the deactivate / activate groups... again, I'm just a newbie so I have lots of more to learn.

  • If you could post a couple prints on where you have this actions we could imagine whats going on.

    About not posting the capx and etc, worry not. I fully understand your concern.

    About the function, you should really check it. Its REALLY easy. It would be something like this:

    Function freezePlayer()

    .......................................set "locked" to Movement;

    .......................................wait 0.3 seconds;

    .......................................set "unlocked" to Movement;

    Then whenever the freeze has to occur, you call freezePlayer().

    About the Timer behaviour, i think it is overkill. Do you start it whenever the freeze occurs and have a "On timer complete" event to set "unlocked" to Movement ? My first guess would be timers overlaping somehow.

    Since I already start-fresh the all code, I will see where I get to this point once again and then I'll post some pieces of the event sheet.

    I have no problem sharing that, but the capx itself, I'm glad that you understand me.

    I'll keep on update on my upcoming issues... coming soon! (I guess)

    Thank you all for trying to help I appreciate it a lot!

  • Couldn't this just be a single event? When player attacks, disable platform behaviour, wait for 'timer', enable platform behaviour.

    Yes it is, but since my code for the all thing was a complex overall I guess there are clashes so I re-make the all thing again trying to keep it even more organized as I learn.

    That made sense to me on my first attempt, but from what I remember the last time I used disable platform behaviour, my player fall from the floor (solid)... so I skipped that idea and used disable/enable groups.

    Maybe I don't use the disable platform behaviour correct?

  • Thanks for the reply!

    Since I'm still a newbie, I didn't use Functions yet (I know I should, cleaner, re-use etc...)

    My movement is lock and unlocked based on a "on" and "off" (string) like Boolean but I like see it on the event sheet better. it's very much like what you described.

    For cooldown, which isn't the issue in my current major bug, first I did an old fashion cooldown with few lines and variable but then I realized... it's much simple to do with the Timer behavior and it works nice (for now, I didn't mess with it much to ran into issues, so maybe I'll change my mind).

    For now, once again... I'm re-code the all thing from scratch, I know it sounds stupid but it's a good practice for me to learn Construct 3.

    I hope that I will find a different / better approach to make the "freeze while attack" without getting my Player stuck randomly again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello All,

    I will do my best to explain what I did so maybe you can help me find a different solution for my issue.

    Just to be clear: (you can skip this part)

    Since I'm still a newbie who got lots more to learn in Construct 3, After working on my base-engine game focus on the Player mechanics I had so many issues and bugs that I've decided to Re-Code everything with much more organized way.

    So I made dedicated event sheet for the Player and one for the Enemies, I've created groups, comments and even an ON-SCREEN colorful Debug-Text that is really to-the-point for me to follow and test (I know that there is a wonderful debug-mode on C3, but it was hard for me to follow it) ANYWAY! everything is nice and easier compare to my first attempt of the code for my game and I learned new things on the way, good practice.

    So far so good, now... for THE ISSUES:

    I'm pretty sure that I code the all thing wrong and I need a different approach on how to do it:

    The instance (text) variable: "Movement" is set to "unlock" when the player is moving, jumping, etc..

    But when the Player Attacks it will set to "locked!" which will deactivated the INPUT-CONTROLS group and then activated.

    What it does basically is: when the Player attacks while in ANY movement, walking on floor / not on floor while jump, falling, he will stop moving even if you hold the right, left, jump, he stops on mid air or on the floor, do the attack and when the attack animation is done he can keep walking.

    This short example is just a RANDOM time when the player attacks and stuck, It's not happen just when he fall or jump, it could randomly happen just when he attacks on the floor as well:

    That "Movement" instance variable is obviously where the bug is, but I'm sure it's also the wrong way of do the all freeze-player after each attack while moving.

    That's the mechanics I want to make for my game, I know it will be easier to do without it... especially as a newbie but it FEELS exactly as I imagined it on my simple brain.

    The thing is... it's working!

    kind of, because I have a bug that sometimes randomly it will keep the Player on "locked!" which will freezes my Player. it's obviously related to that "MOVEMENT" instance variable I created and it's all over the place on my code, on any move as I explained so I can get rid of it and should find a different approach instead.

    I know it will be impossible help me fix the bug without sharing my capx, the reason I'm not sharing it is because my goal is to make it my official game, I hope that you understand.

    I'm not interested trying to FIX this bug because I already tried and my brain can't figure it out, I hope that you can still help me find a DIFFERENT WAY to code such thing.

    Maybe there is a more simple way? maybe even using some extra Plugin as a shortcut?

    Thanks ahead and sorry about my bad English.

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