How do I make a good drain health over time system?

1 favourites
  • 5 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • basically in undertale there is this mechanic called kr, which acts like a poison effect. I have figured out many things about it like how it maxes out at 40 kr (or in my case ns) but the problem is I don't know how to make it so that the ns can not exceed 40.

    undertale.fandom.com/wiki/Attack_Types this website goes into better detail about how kr works, and I would like something similar top it

    also, I got my pc to have the file data so I can finally share the project so I can make it easier to help you know what is going on

    drive.google.com/file/d/1DZ5_vfkR5YoruiPKjfyN7dpA9QA1id3e/view

    So basically what the problem is is that I don't know how to make it so that ns caps out at 40 and not just increase infinitely

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not got time to check the file but in general terms you would say if ns greater than 40, set ns to 40.

  • I did that but for some reason instead of it setting it to 40, it sets it to 44

    also how do I make it so that instead of the health bar's width shrinking on both sides, it just does it on the left side?

  • You have conflicting event conditions. You have conditions that say if natural selection is greater than 0 then do x, as well as conditions that say if it is between a range of values then do y but it is still doing x.

    You should create relevant sub events under you initial condition of 'Natural selection is > 0'

    You can also remove the every tick condition from a lot of those events as the other conditions will be checked every tick regardless

  • You have conflicting event conditions. You have conditions that say if natural selection is greater than 0 then do x, as well as conditions that say if it is between a range of values then do y but it is still doing x.

    You should create relevant sub events under you initial condition of 'Natural selection is > 0'

    You can also remove the every tick condition from a lot of those events as the other conditions will be checked every tick regardless

    Can you give me an example of how I can do this? I don't quite understand what you mean by relevant sub events since I don't know which bits of code I need to fuse together, separate, delete, or make a sub event out of.

    edit: I figured it out, thank you so much!

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