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:
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:
Finally add a Trigger (2/2). It should trigger when receiving on… -1oxygen
.
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:
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:
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:
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:
–
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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- None
- Reference #1
- Reference #2
- Reference #3
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!