Oxygen Mechanic [5/10]

Guys I figured something out. You can drown! It’s an amazing concept and I was so surprised! Why point this out you ask? Surely everybody knows you can drown? No they don’t. So many underwater games in Gimkit just have you underwater with unlimited oxygen. Now I don’t think that Gims have gills[1] so I figured I’d make this oxygen mechanic.


Step 1: Get in The Water[2]

Devices:

  • 1x Zone

This is so simple, it probably doesn’t deserve to be a step. You are going to take this Zone (1/1) and when player enters the zone, transmit on… startOxygen.

Explanation: When a player falls into an ocean, a lake, a pool, just put this zone around it so that way it starts the system when they fall in.


Start of Summit Two: The Ocean


Step 2: Running out of Oxygen

If you don’t spit it out soon all that water will destroy you![3] Now we need to make these people actually run out of oxygen! Because that’s the whole point… Uh… PENGUINS.

Devices:

  • 1x Trigger
  • 2x Property
  • 1x Respawn

First let’s take our Trigger (1/1) and have it trigger when receiving on… startOxygen and give it a nice delay of 1.[4] It should activate when receiving on… startOxygen and deactivate when receiving on… hideOxygen. Almost done! set activate scope to player. Finally add this blockcode:
image

Now time for our kill Respawn (1/1)! All you need to do is force a player to respawn when receiving on… respawn.
I already know your tactics!
When you swallow you attack with whirlpools that attract prey
but I see a disadvantage, cause I don’t have even have to kill you!
I just have to avoid you, see if you don’t spit it out soon
all that water will destroy you!
[5]

Now add one of our two Properties (1/2) and property name it SecondsTillDrown. Set its property type to number and its default value to 60. :0 we don’t have that long left till we drown!!! Its property scope should be player and when property value changes, transmit on… updateOxygen.

Let’s add our last Property (2/2) and set its property name to DrownChange, make it property type number and give it a default value of -1. Finally give it a property scope of player.

Explanation: Once the player starts this whole system it will first run a trigger. This will change our “SecondsTillDrown” by our property “DrownChange”. We do this because it allows for more functionality on how much oxygen the player loses or gains. Next it will check if the player has 0 oxygen left. If they do, it will reset their oxygen and then respawn them. Now there is a limit to how much oxygen you can hold in your lungs so if seconds to drown is >= 120 we just keep it at 120. If the oxygen is somewhere in the middle, we just loop the trigger!


Step 3: bUbBleS?!?!

feat. @ShadowDragon44 but not really but still kinda?
If your underwater segment is really long consider adding some areas where the player can breathe and regain some oxygen.

Devices:

  • 1x Zone
  • 2x Triggers

First add down our handy dandy Zone (1/1). When player enters zone, transmit on… 1oxygen. When player exits zone, transmit on… -1oxygen.

Now add a Trigger (1/2) that triggers when receiving on… 1oxygen and add this blockcode:
image

Finally add a Trigger (2/2). It should trigger when receiving on… -1oxygen.
image

Bubbles

So ShadowDragon44 is helping me with my platformer game that features this oxygen mechanic and he made this cool bubble animation for me. Here it is:
Screen recording 2024-11-18 2.09.19 PM

So what he did was made 3 circle barriers of different sizes all with alpha 1.00, and collision set to no, and color of #9af7fe. Then he added a text device in each with text of ) and a color of #41d0ec. For the medium and large bubbles add a smaller bubble inside that has an alpha of 1.00 and a color of #61f4ff. Finally for the large bubble add another smaller bubble with a alpha of 1.00 and a color of #2dd5e1.

For each bubble’s components have it show when receiving on… bubble[#] and hide when receiving on… bubble[other#], bubble[other#]. For example:
image

Now add a Trigger (3/2)[6] and have it trigger when receiving on… anibubble, startGame and when triggered, transmit on… anibubble. Now give it a delay of 0.6. Finally add some blockcode:
image

Finally add a Lifecycle (1/0) that on game event Game Start and when event occurs, transmit on… startGame.


Explanation: Every 0.6 seconds it gets a random number 1-3, if that bubble was the previous number selected, it will choose a new number. If it has not, it will broadcast on bubble["bubble"] and then it sets the previous number to the current number.


Explanation: Whenever a player enters this zone it will change “DrownedChange” to 1, which means it will start increasing the oxygen remaining. If they leave it will set “DrownChange” to -1, once again decreasing.


Step 4: Fixing Death

Okay so let’s say that your game has other environmental hazards or respawn devices, it won’t reset their oxygen. In order to fix that we need two things:
Devices:

  • 1x Lifecycle
  • 1x Trigger

First the Lifecycle (1/1) should on event Player Knocked Out and when event occurs, transmit on… died.

Now add the Trigger (1/1) that triggers when receiving on… respawn, di<m>ed. Then add this blockcode:
image


Explanation: Whenever the player is killed by the respawn device OR is knocked out by a sentry or something, it reset the oxygen “SecondsTillDrown” to 60.


Step 5: Making it Look Pretty

soooooooo close… Now we are going to make it have pretty player UI!
Devices:

  • 1x Game Overlay

Add our one Game Overlay (1/1) in the Bottom Left and overlay position. Make the overlay text Oxygen Remaining: 1:00. Set visible on game start to no. Show overlay when receiving on… startOxygen and hide overlay when receiving on… hideOxygen. Now set both scopes to player. Finally add some blockcode when receiving on… updateOxygen:


Explanation: When the amount of seconds till drowning changes, it will run the code. It will set “minutes” to “SecondsTillDrown”/60 rounded down.[7] Then it will set “seconds” to “SecondsTillDrown” - [“minutes” x 60][8]. Now it will set “time” to “minutes” + : + “seconds”.[9]. Now this is a problem most times, have. They don’t fix that and add the little zero in. So if “seconds” is less then 10 it will get a substring from “time” from the first letter to the first occurrence of “:”.[10] and “0”[11] and then finally a substring from “time” after the “:” to the last letter.[12]. Then, it will set the text of the Game Overlay to Oxygen Remaining: + “time”.[13]


Ending the System

To end the system, just have a zone or trigger that transmits on hideOxygen.


Polls

Difficulty
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
0 voters
What references did you get?
  • None
  • Reference #1
  • Reference #2
  • Reference #3
0 voters
Quality
  • :star:
  • :star::star:
  • :star::star::star:
  • :star::star::star::star:
  • :star::star::star::star::star:
0 voters

Outro: You’ve reached the end! Congrats! I’ve been offline because I’m working on this one REALLY big guide! I hope it might come out within the next month and I’m really excited for it! As for this guide, I might add some bonuses tomorrow! Have fun!


  1. Correct me if I’m wrong ↩︎

  2. Reference ↩︎

  3. Reference ↩︎

  4. Unless otherwise noted all triggers should have visible-in game and trigger by player collision set to no ↩︎

  5. Reference ↩︎

  6. HOW?!?!?! ↩︎

  7. 67/60 = 1.116~ rounded down = 1 ↩︎

  8. 67 - [1 x 60] = 7 ↩︎

  9. 1:7 ↩︎

  10. 1: ↩︎

  11. 1:0 ↩︎

  12. 1:07 ↩︎

  13. Oxygen Remaining: 1:07 ↩︎

11 Likes

Amazing guide! I really tried adding this with another guide but this goes more in depth

1 Like

Great guide! Originality is 9/10 or 10/10 prob
Then expiation is probably 9/10
So over all 9.9773635463782

2 Likes

woah this is very cool, and unique

For people who are lazy:
Whenever you enter the water, have a trigger loop transmit on a channel every 1 second that will decrease an item which is the oxygen.

When you have zero oxygen, you respawn.

Ok rating time

mechanism
12/10, i suc.k at blockcode sometimes

explanation
10/10

in-depth
20/10, not explaining myself

humor
5/10, only the bubbles part

originality
7/10, another person made a guide like this

overall:
10.8/10, idk if i did this right, my first time rating

Reference 2 if you don’t get it:
Froyo eats ClicClac’s friends all the time

Hmmm, lemme see.
Deep sea games (WHY ARE THERE NO DARK SPOTS!?)
Water versions of games (Same problem.)

1 Like

The Math:

12 + 10 + 20 = 42

42 / 3 = 14
14 ≠ 15

Feedback on the feedback:
@Spydecraft245 , for your second rating, you should probably add more details to the rating like humor or originality.

1 Like

Oh ok, just gimme a sec

Ok, i fixed it and the math

Very good guide
I personally rate it a 9.6/10, funny thing is I made a simlar guide although it was based on how drowning works in Sonic games. great minds think alike I guess

amazing guide @harharharhar83

1 Like

*eating them

2 Likes

I think you made this a bit too complicated.
You can just have a counter and a trigger loop, every second decrementing the counter until it reaches its target: 0. When it does, it resets and force respawns you.


Overall tho not bad! Similar to this.

That’s what the system was originally. However, I added the timer glow-up and then I added the system so they could regain health standing under the bubbles. Also some things that I didn’t add that I probably will tomorrow, is it drains more oxygen to move and use gadgets. Thanks for your opinion tho! Yeah I saw that when making sure I wasn’t making a duplicate guide.


Erm no.

This was reference two ; )

4 Likes

wait a min I don’t remember gims have a nose or mouth to breath in the first place.

what about the shark gim?!