Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Low-Heart Alert  (Read 1885 times)

0 Members and 1 Guest are viewing this topic.
Low-Heart Alert
« on: June 23, 2007, 09:23:58 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
Hey
I feel like an idiot asking this question, but how would I make a sound loop when the hearts are low, on Goodnight's Oot heart engine?
I think I might have the solution but I don't know if it's right, and it may consistantly play the sound, so here it is:
Code: [Select]
if global.Heart<=2.75{
sound_loop(global.lowheart_S)}

Thanks a lot:
Mewgull
Logged
Re: Low-Heart Alert
« Reply #1 on: June 23, 2007, 09:29:09 pm »
  • *whistle*
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2224
Surely you could add a second bit of code that if global.Heart>2.75, you could end the loop? I dunno, I'm none too good at coding...
Logged

Antidote

>.>
Re: Low-Heart Alert
« Reply #2 on: June 24, 2007, 04:17:18 am »
  • In all seriousness who's serious?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1485
the thing is when it plays changes depending on the amount of Heart containers you have. so you'll have to add that variable too.
« Last Edit: June 24, 2007, 04:25:14 am by Antidote »
Logged
  • Axiomatic Data Laboratories
Re: Low-Heart Alert
« Reply #3 on: June 25, 2007, 11:42:47 am »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
Bump...
Logged
Re: Low-Heart Alert
« Reply #4 on: June 25, 2007, 03:44:30 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
That looks right, try it it should work.
Logged



i love big weenies and i cannot lie
Re: Low-Heart Alert
« Reply #5 on: June 25, 2007, 04:59:39 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
if I put it in the step event, it will make an annoying sound playing the sound constantly for every step of frames.
But I'll try anyways ;)

EDIT:  Just as I suspected... didn't work...
« Last Edit: June 25, 2007, 05:04:56 pm by Mewgull »
Logged
Re: Low-Heart Alert
« Reply #6 on: June 25, 2007, 05:14:22 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
change it to sound_play, then add an additional check to see if the sound is playing
Logged
Re: Low-Heart Alert
« Reply #7 on: June 25, 2007, 05:21:28 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
Thanks.
But what would I have to put to do the check? DX
I am just a little stressed right now, so I can't think properly, sorry.
Logged
Re: Low-Heart Alert
« Reply #8 on: June 25, 2007, 05:44:31 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1635
I think it's something like if the hearts are less than 1/3 of the total, then the sound plays. So maybe check if the heart number is less than the total div 3 or just divided by 3.
Logged
Re: Low-Heart Alert
« Reply #9 on: June 25, 2007, 06:26:09 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
what would be the code for that? sorry for asking :\
Logged
Re: Low-Heart Alert
« Reply #10 on: June 26, 2007, 12:39:40 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 121
like this

Code: [Select]
if (global.heart)<=(global.totalheart div 3){
    if !sound_playing {
        sound_play(global.lowheart_S)
    }
}
Logged
Re: Low-Heart Alert
« Reply #11 on: June 26, 2007, 02:18:45 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
I had to make a few modification to that code, but thanks for it! :)
I always forget about that little "!" XD

EDIT: It's playing three of the sounds at a time, now :\
« Last Edit: June 26, 2007, 02:21:41 pm by Mewgull »
Logged
Re: Low-Heart Alert
« Reply #12 on: June 26, 2007, 07:26:07 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 121
if you want send me the source and ill fix it.
Logged
Re: Low-Heart Alert
« Reply #13 on: June 26, 2007, 07:47:33 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
I won't send my file that I am actually making my game in, but I will send the engine I used for the hearts.
The code doesn't work there either.
Give me a sec, and I'll upload it in the edit of this post.

EDIT:
Here ya go :):
http://www.freewebs.com/mewgull/OOT%20Heart%20Engine%20v3.gmk
« Last Edit: June 26, 2007, 07:49:43 pm by Mewgull »
Logged
Re: Low-Heart Alert
« Reply #14 on: June 26, 2007, 07:53:36 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1635
Create a variable called "playcount" in your create event, and set it to 0. Then, in the step event, use this code:

Code: [Select]
if (global.hearts)<=(global.totalhearts div 3){
    playcount = (playcount + 1) mod 30;
    if(playcount == 0) {
        sound_play(Low);
    }
} else {
    playcount = 0;
}

It plays it once a second (with a room speed of 30).
Logged
Re: Low-Heart Alert
« Reply #15 on: June 26, 2007, 08:21:12 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 121
my code should work unless your beep is actualy three beeps at once.
goodnight has beeps that loop perfectly on his sound effects page.
Logged
Re: Low-Heart Alert
« Reply #16 on: June 26, 2007, 08:28:56 pm »
  • Personal Text
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1229
Thanks a lot! ^_^
This solves the problem so I will lock this topic to reduce further spam
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.043 seconds with 68 queries.

anything