brainwavecreations's Forum Posts

  • I got this sorted out perfectly just now. It turned out better to disable deceleration, have Player Slide, Stop, then re-enable default deceleration for Platform Behavior.

    This way, it doesn't matter if the Player is Running, or Walking. Causing it to move it different speeds on the X plane. The player will bounce back the same distance, every time.

    Thanks again for your support & helpful input dop2000 :)

  • > It's odd, because if I do set Vector X to 1000000 or -1000000 the player does move further than say setting it to 100000 or -100000

    Maybe you've set a very high deceleration value? I just tested and couldn't see any difference between vectors 400, 10000 and 10000000. (character max speed=300, deceleration=1000)

    Hmmm. I've got my PlayerBox set at 2000 for Default Deceleration.

    EDIT: Max Speed is 330, acceleration 1500

    EDIT 2: I do have a very high deceleration value for the Custom Movement Behavior. But, I am not using that at all within the PlayerDamage Functions. Purely the Platform Behavior for all movement on Vector X/Y.

    I'm going to play around with it some more this afternoon. If it doesn't make much difference which way the bounce back is achieved. I will just leave it as is. It looks perfect right now, for this use.

  • Platform vector value can not be higher than the max speed. I believe if the max speed is 200, it doesn't matter if you set vector X to 500 or 1000000 - the character will still move at 200 px per second.

    So for the knockback you need to temporarily increase the max speed and possibly reduce the deceleration parameter.

    That's good to know. Thank you for your input :).

    It's odd, because if I do set Vector X to 1000000 or -1000000 the player does move further than say setting it to 100000 or -100000

    I'll play around with the Platform Behavior values within the functions some more. Once, I get back to working on the project tomorrow.

  • Very cool, Tomycase! This looks great :)

    EDIT: Hanging onto this example, for future use/review ;)

  • Hey hey :)

    I'm curious about something, and figured I would make a quick post in the community before I power down for the night. While working on some new gameplay features in my current project. I was messing around with different knock back functions. When the player gets damaged, sending it backwards(relative to enemy.x or projectile collision) and upwards or downwards, by adjusting the Platform Behavior Vectors X & Y. Then flashing, taking damage, putting into Hurt State, etc.

    What I noticed is I need to set the Vector X parameter to an extremely high amount of pixels, to get the result I am looking for. But, the Vector Y can be much much lower. I figure this is because of the Platform Behavior's, default Deceleration property. And, I'm assuming the Platform Gravity has nothing to do with any Friction slow down the player on the X plane, as the value can be far lower for sending the Player upwards on the Y plane.

    Does it really make any difference, whether you are just setting an extremely high amount of value to the Platform Vector X? Or if you temporarily lower the Platform Deceleration, and then use a lower value on the action adjusting the Vector X(positive or negative depending on location to enemy), before setting the Deceleration back to it's default? I store all default platform behavior values for the Player as variables on start of layout, to easily set them back to default. If I ever need to change them for any other actions.

    I'm not really sure if it makes a big difference or not computing/performance wise. I've tried it both ways, and can get the effect I'm looking for either way. Setting a really high value to Vector X, as a positive or negative value. Is just far less action blocks within the function, and keeps the event sheets a bit cleaner. But I'm working on a couple different knockback functions, to keep the event sheets minimal, either way.

  • Castlevania IV was the first SNES game I bought with my own cash, and I played the crap out of it XD.

    Basically it would need to be setup as a linked chain of objects that move in conjunction with the head. Very close to what alextro has provided. The chain links(vertebrae of the skeleton's spine) were loose, and would overlap if they were within range of each other. In the original game anyways.

    Basically the head of the thing would move around in circles, or figure eight motion. While pausing here and there to fire out a fireball from it's mouth. And the chain links attached to the head would dangle and move around. Like a loose hanging chain between the head, and the wall the other end is attached to.

    I've never attempted anything like this sort of animation. But, I wonder if a timeline could be nice for something like this? That is if you want to take the time to animate each key frame, and link into position. And have pauses where it stops and fires out a fireball at the proper times.

    Might be worth playing around with. I wish I had more time, to toy around with ideas like this one. Tomorrow is "my day off", so I'm on the computer least amount of time possible. But, maybe I'll hop on for an hour or so, and have a whack at it.

  • Thanks again lionz! The bug that has plagued me off and on for a couple weeks, is finally sorted! 😃 What a great feeling it is, when you finally figure out what is going wrong, and mucking up a feature in a project.

    I'm learning more and more, how particular Construct 3 is, with the processing of conditions/events from top to bottom. All, I needed to do was delete one entire Event Block, which was unnecessary. Then add a couple more conditions to an OR Block, which checks the PlatformEnemy's state, then sets them each back to "Walking" through a Sub-Condition that checks to see that it is NOT in states "TakingDamage", "Death", and has lost the LoS to the PlayerBox.

    The real clinch, was making sure the check in the parent Block. The one checking to see if PlatformEnemy is in various Attack states was checking states in the proper order. I had all the state checks in there, and still wasn't working properly. Then I moved the check for the "Attack" state, above the "RangeAttack" state check, followed by a "SayNo" state check condition. That last one is used by the Sensei, who takes no damage, and simply wags his head no at the Player.

  • I've got it mostly fixed at this point. I had to just delete a few event blocks. The only issue now is my ninja enemies are not moving back into Walking after they change their attack, or ranged attack state/animation.

    I'm happy with the progress with this bug. It's been irritating me for a while now. But, time for some rest and sleep. I'll tackle the rest tomorrow afternoon.

    Thanks again for all the help lionz. You pointed me in the right direction for sure. I was looking in the totally wrong areas of my Event Sheets.

  • I'm sorry for all the confusion. I'm always super helpful for you trying to help me out lionz. You have no idea haha. I often have trouble conveying concepts, and the way I sort things out in my head into words... Even in conversation.

    It's the state that is not changing, and that means, the animation for that state does not play when it should, during those types of attacks. I update the animation every tick to match what is currently held in the variable, "PlatformEnemyState".

    I think you are absolutely right. It may be LoS like you just said. Actually, now that I type that. I think I may know right where the bug lies. I'll be back later. Thanks so much for all of your time and help again lionz

    I'm the type, to almost never reach out for help, even in real life. But, when I do. You have no idea how much I appreciate it when someone does their best to do so.

  • Basically. When the player attacks using melee or a bullet it works just as desired. I also added that wait 0.1 as a test, and removed it after uploading the screenshots.

    So, with a melee attack, the first attack makes the enemy flash, while playing the "TakingDamage" animation. Then moves back into "Walking" state, or the "Attack" state if the Player is within a set range. Then on the second attack, the enemy fades while playing the "Death" animation(as health reaches 0). Then gets destroyed at the end of the fade behavior(in the behavior preferences). Just like it shows in the EnemyDamage function in the screenshot.

    But.. When I perform the slide attack as in the second screenshot. Where it shows PlayerBox on collision with PlatformEnemy in either "JetpackSliding" or "Sliding" PlayerState. It does everything except play the proper animations. So the first hit with a slide attack. The enemy flashes, loses one health, while moving back into Walking or Attacking animation instantly. On the second hit, the enemy fades while moving back into the Walking state(which are the enemies default state). If player is within range they will go back into Attack state. The Walking, and Attack states are called depending on the distance to the player, and LoS.

    So everything is working as it should. Except the "TakingDamage" animation for that state on the first hit of a slide attack, and the "Death" animation for Death state on the second hit of a slide attack do not play their related animations. They flash, lose health, fade, and destroy at the end of the fade. But, do not play the animations that corelate to their HP values, and the state the function puts them into. But, they do play the animations perfectly fine if hit with the Melee Attack HitBox, or a Bullet object.

    It's really strange to me, because I am using the exact same function. And, as you can see in the second screenshot. I am calling the function the exact same way regardless if it is the Melee Attack, or the Sliding Attack. Animations work just fine for the Melee Attack(and a bullet as mentioned, but not in screenshots), but not for the Sliding Attack, or one other attack. And, I'm calling them in the exact same way. Works for one, but not the other.

    I'm not sure how else to explain it.

  • While using the sliding attack(regular or with jetpack), as well as colliding with enemies with invincibility active. The outcome is: During the first hit, the enemy flashes but goes back into attacking/walking state & animation depending on the usual conditions for those states. During the second hit, the enemy fades while going back into attacking/walking state & animation.

    The function itself works flawlessly for melee & ranged attacks(melee using a spawned hitbox, the ranged being a bullet object), but not for the Sliding attack, or when enemy is taking damage while the player has the invincibility power-up active. To me it seems to be an issue with conditions where the PlayerBox is colliding with the enemies. Either while sliding/jetpacksliding, or while colliding with the invincibility mechanic active.

    The only hitboxes being used is one for the player attacks, then another for enemies' attacks. The ranged attack uses a bullet object for collision. For Sliding Attacks, and Invincibility it's using the PlayerBox. Which has the animated Player as a child laid overtop. The Player itself has collisions disabled, and all collisions are handled by the PlayerBox. the PlayerBox colliding with the enemy during one of two sliding attacks, or during the invincibility power-up is calling the EnemyDamage Function for those two(which are having the issue of not holding the enemies in the proper animations).

    As pictured. I used Trigger once in the Function, as well as a Collision check for the PlayerBox, rather than an Overlapping check. To not have the action performed twice right after each other. Even so, if that was an issue the Melee attack hitbox lingers for 0.2 of a second. Which would be about the time than it takes to slide past an enemy, or run right past them with invincibility activated.

    I've been picking away at this small bug, here and there for a while now. I can post images of entire event sheets if that is more helpful. I'm about to get on for an hour and a half live stream I host every night, in 15min. But, can check back here afterwards.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's for your input alextro

    What is strange is that it works just fine for the melee attack. And, not the sliding attack, or with invincibility. Both TakingDamage, and Death animations play fine on melee attack hitbox collision, and not the other forms of damage(where PlayerBox collides with the enemy(as in sliding or invincible).

    The sliding attack takes off the same amount off of Health variable as the melee attack. So it's not equaling 0, until the second hit of either melee or sliding attack.

    When it reaches 0 on the second hit of a melee attack it plays the Death animation, while fading as it should. I would think both collisions would work in the same way. As they are essentially doing the same exact thing. Running the function, and taking 1 off of the health variable.

  • Hello everyone :)

    I'm having a spot of trouble pinpointing the issue with a bug in my main project right now. I've created an EnemyDamage Function. It should put each Enemy into a state/animation of being damaged if health is above 0, or a state/animation of death if health equal or below 0 and fade.

    It works fine with my Player's melee Attack. When the hitbox overlaps the enemy, they go into their proper animations, and flash, or fade depending on the level of health variable.

    But, if I do the Player's Slide attack into them pictures below, it does not put them into the proper animation for that state. I also have an invincibility pickup for the Player. When the Player runs into any of the PlatformEnemy objects it calls the same function, except takes off 2 health(which puts the enemies health to 0. That also does not work as intended. And again, it's a condition where the Player Box collides with the enemy, with a boolean for invincibility set to true.

    So it seems to be an issue with the Player Box(in particular states) colliding with enemies, where the animations do not change properly on the enemies.

    Screenshot of EnemyDamage Function: EDIT: Please Note: The Wait 0.1 Seconds, and Stop Animation, were put in to try and fix the issue, before taking screenshot below.

    Screenshot of a the Sliding & Melee Attack calling the Function above:

    As always. Any help is greatly appreciated! Thank You :)

  • Sure thing . I often over complicate things too. To the point I can't figure out what I've done wrong XD. Best, to keep it super simple, and work up from there.

    There are a ton of resources online as well, between YouTube and other tutorials on the Scirra website to figure out what's gone wrong. In this case, I just removed most of the Events, and set up something super basic that will work.

  • Not sure if this is at all what you are looking for. But, I made use of your second Event Sheet. And, really simplified what you had going there.

    I set the main layout to "Main Screen" on the project. Depending on whether in Main Screen, or Game, it will play and stop different music tracks when the button is pressed to play or stop.

    dropbox.com/s/10tbe8h93xc2kji/Sound.c3p