Author Topic: Oxygen Level  (Read 3949 times)

saiwong3268

  • Level 6: Milder
  • *
  • Posts: 119
    • View Profile
Oxygen Level
« on: December 05, 2019, 07:01:46 PM »
I am working on a water area. However, what I've found is that I am too focused on avoiding enemies that I forget to check my oxygen level and die through lack of air.

Can you implement a way that
when low on oxygen to get some sort of ALARM sound ? (The alarm sound can turn off when you
go up to the surface or get enough oxygen through bubbles).

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 835
    • View Profile
Re: Oxygen Level
« Reply #1 on: December 05, 2019, 07:13:33 PM »
find an option "Loop Command" and try something like this:
if air < x
{
play sfx = y
loop = staggered
}

where x describes what number do you want your alarm to start, and y stands for a sound effect used.

"loop = staggered" does an action every 5 frames, so that might be too fast. I think it'll work, but you don't know untill you check. :)
« Last Edit: December 05, 2019, 07:16:04 PM by Gizgord »

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Oxygen Level
« Reply #2 on: December 05, 2019, 07:23:11 PM »
I'm not sure if that will work. I wondered if that might work, but I doubt it. It's worth a shot though!

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 835
    • View Profile
Re: Oxygen Level
« Reply #3 on: December 05, 2019, 07:42:24 PM »
it does not, you hear this alarm above water. I tried:

if swimming = true
and if breath < 5
{
sfx = 5
loop = staggered
}

seems like it should work, but it doesn't. maybe you need to use a timeline.
« Last Edit: December 05, 2019, 07:47:14 PM by Gizgord »

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Oxygen Level
« Reply #4 on: December 05, 2019, 07:48:19 PM »
The and conditional is incorrect. It should be & breath <5. And I didn't think you could cause commands to loop by doing loop=staggered.

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 835
    • View Profile
Re: Oxygen Level
« Reply #5 on: December 05, 2019, 08:12:07 PM »
The and conditional is incorrect. It should be & breath <5. And I didn't think you could cause commands to loop by doing loop=staggered.
I'm reading all commands from the page, and both "and breath <5" and "loop=staggered" are written down.

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Oxygen Level
« Reply #6 on: December 05, 2019, 08:15:51 PM »
I wasn't aware of the breath command. And I'm aware of the loop constant and staggered commands. I just didn't know that it'd loop commands you wrote down. I thought it only worked in area beginning commands.

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 835
    • View Profile
Re: Oxygen Level
« Reply #7 on: December 05, 2019, 08:25:29 PM »
that may be the case. either way, I can't get it to work. not great with commands. :P

saiwong3268

  • Level 6: Milder
  • *
  • Posts: 119
    • View Profile
Re: Oxygen Level
« Reply #8 on: December 05, 2019, 10:37:52 PM »
I was looking at the command line tutorial

https://theplatformbuilder.com/Conditionals/


maybe try:

if swimming = true &  breath < 5
{
sfx = 5
loop = staggered
}


does this work ?

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Oxygen Level
« Reply #9 on: December 06, 2019, 12:17:42 AM »
It might! Try it out and loop it in the loop command for the sandbox level. Find it by clicking settings. I believe it's at the top right.

War

  • "The top player is here!"
  • Level 20: Nobom
  • *
  • Posts: 1490
    • View Profile
    • My website
Re: Oxygen Level
« Reply #10 on: December 06, 2019, 06:53:54 AM »
Creepy memories from Sonic 1...
Hey, wassup wassup? My name is Warrior555MainsGanon (but just call me War) and I'm the main guy behind Megaman Zero Online and the upcoming Matt's Adventure! I don't speak often here but I'm a very friendly lad so if you wanna talk, don't hesitate!

saiwong3268

  • Level 6: Milder
  • *
  • Posts: 119
    • View Profile
Re: Oxygen Level
« Reply #11 on: December 06, 2019, 11:35:45 AM »
I finally got it to work with the following:

if swimming = true
{
if breath < 3000
{
sfx = 5
loop = staggered
}
}

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 835
    • View Profile
Re: Oxygen Level
« Reply #12 on: December 06, 2019, 12:10:28 PM »
really, it does work?
you're a Mastermind, that's what you are.  :o  ;)
« Last Edit: December 06, 2019, 12:10:39 PM by Gizgord »

War

  • "The top player is here!"
  • Level 20: Nobom
  • *
  • Posts: 1490
    • View Profile
    • My website
Re: Oxygen Level
« Reply #13 on: December 07, 2019, 08:22:16 PM »
I finally got it to work with the following:

if swimming = true
{
if breath < 3000
{
sfx = 5
loop = staggered
}
}
Good job! Antikore should be proud of you!
(and a bunch of Sonic fans should be eternally grateful to you ;))
Hey, wassup wassup? My name is Warrior555MainsGanon (but just call me War) and I'm the main guy behind Megaman Zero Online and the upcoming Matt's Adventure! I don't speak often here but I'm a very friendly lad so if you wanna talk, don't hesitate!

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Oxygen Level
« Reply #14 on: December 07, 2019, 11:16:42 PM »
??? I'm not sure how to interpret that.