Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (kzhao, AndrewAMD, bigsmack, 7th_zorro), 869 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
background sound don`t stop #258627
03/31/09 23:14
03/31/09 23:14
Joined: Sep 2007
Posts: 52
Tver,Russia
D
dtntr Offline OP
Junior Member
dtntr  Offline OP
Junior Member
D

Joined: Sep 2007
Posts: 52
Tver,Russia
I use game_save("start",0,SV_ALL) for save my level state. When i use game_load, previously background sound(snd_loop) still playing. When i play my level 5 times i have 5 sounds in my speaker. How i can fix this?

Re: background sound don`t stop [Re: dtntr] #258634
03/31/09 23:35
03/31/09 23:35
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
stop the sound before loading???


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: background sound don`t stop [Re: Espér] #258643
04/01/09 05:54
04/01/09 05:54
Joined: Sep 2007
Posts: 52
Tver,Russia
D
dtntr Offline OP
Junior Member
dtntr  Offline OP
Junior Member
D

Joined: Sep 2007
Posts: 52
Tver,Russia
NO.

Re: background sound don`t stop [Re: dtntr] #258702
04/01/09 15:59
04/01/09 15:59
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
snd_stopall(4);

before level loading like sper said or stop jour loop white snd_stop(soundhandle);


"empty"
Re: background sound don`t stop [Re: flits] #258704
04/01/09 16:26
04/01/09 16:26
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Uh... another idea:
how about snd_stop before level saving?

I understand you want it to keep playing the background music while loading a game, and just keep going with that music, not reload the last music.
(That's how I interpreted your "NO." Correct me if I'm wrong)

So your problem is that the current sound gets saved, but it shouldn't.
I searched the manual, and game_save does not say which part you need to deactivate in order to have it NOT save the sound.
I guess that leaves you with 3 options:
-stop the sound before saving, then it shouldn't load a sound when you call game_load. (not tested)
-stop the sound before loading, then it'll play the sound that it was playing when saving the game (not tested)
-try around with the game_save mode and see which one you need to deactivate if you DON'T want to save the sound. you could try a test level for that: loop a sound in main, then have a function that saves the game and one that loads it and use:
game_save("test",1,SV_ALL-SV_VARS);
Replace SV_VARS with the thing you don't wanna save.
i'd try SV_VARS, SV_SYS, SV_VIEWS, SV_FUNCTIONS and SV_LEVEL first.

No idea if this works. Hope it helps though.


~"I never let school interfere with my education"~
-Mark Twain
Re: background sound don`t stop [Re: Germanunkol] #258709
04/01/09 16:55
04/01/09 16:55
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
yes.. but when he stops the sound on saving the game.. he has to start it again when he don´t want to quit the game ^^
So, let the sound run during saving.. and just stop before laoding..


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: background sound don`t stop [Re: Espér] #258712
04/01/09 17:23
04/01/09 17:23
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
How about this. If it doesnt make enough sense, post the whole function containing your "game_load".
NOTE: This code must be in a separate function to your game_save, or the var temp_handle at least must be after the game_save.
temp_handle MUST NOT exist at save_game time.

Code:

function game_loader()
{
   /// whatever else before game_load
   var temp_handle = your_currently_playing_background_sound_handle;
   game_load("???",num);     //your unchanged game_load command
   snd_stop(temp_handle);         //only do this if game_load was sucessful.
   /// whatever else needs doing after game_load
}






"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: background sound don`t stop [Re: EvilSOB] #258810
04/02/09 09:22
04/02/09 09:22
Joined: Sep 2007
Posts: 52
Tver,Russia
D
dtntr Offline OP
Junior Member
dtntr  Offline OP
Junior Member
D

Joined: Sep 2007
Posts: 52
Tver,Russia
Thanks all for ideas.

Re: background sound don`t stop [Re: dtntr] #258934
04/03/09 04:40
04/03/09 04:40
Joined: Jan 2009
Posts: 36
Philippines
U
unknown_master Offline
Newbie
unknown_master  Offline
Newbie
U

Joined: Jan 2009
Posts: 36
Philippines
use function to stop your sound.
ex:
var play;
SOUND* sample_sound="sample.wav";
function sound()
{
play=snd_play(sample_sound,100,0);
}

function sound_stop()
{
snd_stop(play);
}

function main()
{
screen_color.blue=250;
on_b=sound();
on_s=sound_stop();
wait(1);
}

Re: background sound don`t stop [Re: unknown_master] #259991
04/08/09 13:32
04/08/09 13:32
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
or try var_nsave for the sound handle?


~"I never let school interfere with my education"~
-Mark Twain

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1