Fall damage in gkc?

@Blackfox45666 I tried to figure out how to do this but ran into a bug. Here is my code, but for some reason, it refuses to update the falling variable. With any operator, it outputs no always. Except if I set it to not equal to, it always outputs yes. Does anyone know what’s going on here?

5 Likes

erm hold on im about to go home so ima try to figure the error out later
but i have a feeling it might have to do with the variable being temporary
so maybe try a player scoped boolean property instead of a falling variable

1 Like

anyways see y’all later

1 Like

I tried a variable, that’s why I think it’s a bug.

If you want to try to recreate it here’s the rest.

3 Likes

You can first do something using the amount of time spent falling and then split that up into discrete chunks like minecraft health bars.

I saw that and the first thing I thought was “Woah, Gimkit Quantum mechanics for REAL”

Variables don’t save in between block runtimes.

1 Like

You would just need to compare if the difference between the current y value and the y value one tick ago is greater than a certain value. If it is, then run a damager when the y value is the same for three ticks. (This might have bugs.)

1 Like

So, is this solved? I think there is a possibility you could track the height, and then calculate it based off that. So maybe 5m=1HP. Or, I would use zones to track if someone fell and couldn’t get out and then use another zone at the bottom to deal damage. Just a thought. Might not work.

we have to do:
y change over time.
but how do we detect when we are falling?

oh dang, we are going to need a wire repeater with delay, and than 2 different properties, but with such small time gaps, it wont work

someone host a platform map on wix nd give me perms. i need to TEST

Sorry I’m late(by like 3 hours), but I sorta forgot my idea, so sorry!
EDIT: NVM I remember

Nvm it waaaaay too complicated now that I think of it

I found another bug. While the player is falling, because the Y pos is always less then the last, it always sets the first pos. You need to have “If falling == yes” in the first part of the if.

Yes, the “==” in python means if equal to. “=” in python means set this var equal to this.

Well, block code aside, I think a series of zones, activating and deactivating might work, like the highest zone transmits on a channel with higher damage and deactivates others for the time being, like with a wire repeater, so the higher off you are, the more damage you’ll take, no block code required.

I haven’t read all the replies, so forgive me if I miss something or if this is a repost. All I know right now is that fall damage is very possible, and in fact, it is more simple and memory efficient than pseudo battle mechanics. (I know how much pseudo battle mechanics take, from personal experience.)

Basic Structure

To do this, I’m pretty sure we need a “fall per second” property.

With some block code, we could calculate how much the player falls every second (with block code that runs every second).
Then, another checker checks if the fps (fall per second) equals zero (every 0.1 seconds prob).

If it does equal zero, that would mean the player stopped falling.

There would be another property that stores the same value as the fps property, but delayed.

This way, once the fps reaches zero, a damager could deal a variable amount of damage based on the delayed fps property.

Problems and Solutions

  1. Problem: You would take damage every time you jump.

a. Solution: You could create a block code that checks if the delayed fps property has a value lower than the gim’s “maximum shock capacity”. If it is smaller, then the block code simply doesn’t activate the damager device.

1 Like

someone in the gimkit discord is making fall damage (i think), it seems to work pretty well
im not sure how it works, but i could ask

This is probably possible, the only problem is that you would have to calculate the distance, the certain block type every second. This will be a costly idea.