Jump to content


Photo

More Issues With Supersound.dll And Saving


  • Please log in to reply
4 replies to this topic

#1 Neonlare

Neonlare

    GMC Member

  • GMC Member
  • 49 posts

Posted 21 June 2009 - 01:46 AM

Hola, I've been working on my game and although it appeared I had fixed my problem with the Supersound.dll plug-in, it appears now that even with it being situated in the very first room that boots up, on loading a game no sound plays at all. It does play when a new game is made though, but on loading the game it does not appear to want to function.

Here's the code I have for the objects in question.


Obj_Save is clicked on to save the game.
Information about object: obj_save

Sprite: spr_save1
Solid: true
Visible: true
Depth: 3
Persistent: false
Parent: <no parent>
Mask: spr_dense

Create Event:
align position to a grid with cells of 16 by 16 pixels

Mouse Event for Left Pressed:
if obj_cursor.cooldown is equal to 0
	  if global.menu is equal to 0
			if obj_cursor.mode is equal to 0
				  execute code:

if instance_number(obj_armour2text) > 0 then object_delete(obj_armour2text);
if instance_number(obj_smith2text) > 0 then object_delete(obj_smith2text);
				  save the game in the file save


Obj_Sound runs in the background, the very first thing to boot up in the game before the title screen where the game can be loaded. My code is very, very sloppy in this section, as I was trying to get transition of music between areas via alarms.

Information about object: obj_sound

Sprite: spr_womans
Solid: false
Visible: false
Depth: 0
Persistent: true
Parent: <no parent>
Mask: <same as sprite>

Create Event:
execute script SS_Init with arguments (0,0,0,0,0)
execute code:

toshadone = 0;
fadeout = 0;

handle = SS_LoadSound("town.ogg", 1);
itemjing = SS_LoadSound("gotitem.ogg", 1);
donehere = SS_LoadSound("finishedhere.ogg", 1);
forest = SS_LoadSound("forest.ogg", 1);
area1 = SS_LoadSound("area1.ogg", 1);
hector = SS_LoadSound("hector.ogg", 1);



Alarm Event for alarm 0:
execute code:

SS_LoopSound(donehere);
SS_SetSoundVol(donehere, 6000);
SS_ResumeSound(donehere);
alarm[1]=10;

Alarm Event for alarm 1:
execute code:

SS_SetSoundVol(donehere, 7000);
alarm[2]=10;

Alarm Event for alarm 2:
execute code:

SS_SetSoundVol(donehere, 8000);
alarm[3]=10;

Alarm Event for alarm 3:
execute code:

SS_SetSoundVol(donehere, 9000);
alarm[4]=10;

Alarm Event for alarm 4:
execute code:

SS_SetSoundVol(donehere, 10000);

Alarm Event for alarm 5:
execute code:

if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 9000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 9000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 6000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 9000);
if global.music = 4 and global.area=4 then SS_SetSoundVol(forest, 9000);

if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 9000);

if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 9000);

alarm[6]=10;

Alarm Event for alarm 6:
execute code:

if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 8000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 8000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 7000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 8000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 8000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(forest, 8000);

if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 8000);

if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 8000);
alarm[7]=10;

Alarm Event for alarm 7:
execute code:

if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 7000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 7000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 8000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 7000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 7000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(forest, 7000);

if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 7000);

if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 7000);
alarm[8]=10;

Alarm Event for alarm 8:
execute code:

if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 6000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 6000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(hector, 10000);
if global.music = 2 and global.area=0 then SS_SetSoundVol(forest, 10000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 10000);
if global.music = 2 and global.area=2 then SS_SetSoundVol(forest, 10000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(forest, 10000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 6000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 6000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(forest, 6000);

if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 6000);

if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 6000);

alarm[9]=10;

Alarm Event for alarm 9:
execute code:

if global.music = 2 and global.area=0 then SS_StopSound(donehere);
if global.music = 4 and global.area=1 then SS_StopSound(forest);
if global.music = 3 and global.area=1 then SS_StopSound(forest);
if global.music = 1 and global.area=1 then SS_StopSound(forest);
if global.music = 2 and global.area=3 then SS_StopSound(hector);

if global.music = 3 and global.area=1 then SS_StopSound(forest);

if global.music = 2 and global.area=2 then SS_StopSound(area1);

if global.music = 2 and global.area=0
	{
	 SS_LoopSound(forest);
	 global.area = 1;
	 }
if global.music = 1 and global.area=1 
	{
	SS_LoopSound(donehere);
	global.area = 0;
	}
if global.music = 2 and global.area=0 
	{
	SS_LoopSound(forest);
	global.area = 1;
	}
if global.music = 2 and global.area=3 
	{
	SS_LoopSound(forest);
	global.area = 1;
	}
	
if global.music = 2 and global.area = 2
	{
	SS_LoopSound(forest);
	global.area = 1;
	}	

if global.music = 3 and global.area = 1
	{
	SS_SetSoundVol(area1, 10000);
	SS_LoopSound(area1);
	global.area = 2;
	}
	 
if global.music = 4 and global.area = 1
	{
	SS_LoopSound(hector);
	global.area = 3;
	}

 Step Event:
execute code:

if instance_number(obj_chief) > 0
	{
	if obj_chief.stoptown1 = 1 then SS_SetSoundVol(handle, 9000);
	if obj_chief.stoptown1 = 2 then SS_SetSoundVol(handle, 8000);
	if obj_chief.stoptown1 = 3 then SS_SetSoundVol(handle, 7000);
	if obj_chief.stoptown1 = 4 then SS_SetSoundVol(handle, 6000);
	if obj_chief.stoptown1 = 5
		{
		SS_StopSound(handle);
		fadeout = 1;
		}
	if obj_chief.jingle = 1
		{
		SS_PlaySound(itemjing); 
		obj_chief.jingle = 0;
		}
	}
	
if room = town_tosha
	{
	if global. chief = 0
		{
		if fadeout = 0
			{
			if SS_IsSoundPlaying(handle) !=true  then SS_LoopSound(handle);
			}
		}
	}

Other Event: Game End:
execute script SS_Unload with arguments (0,0,0,0,0)


Finally, the Obj_title, which holds the basic interface for the title screen.
Information about object: obj_title

Sprite: spr_title
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
execute code:

image_speed = 0.5;
select = 0;

 Step Event:
execute code:

if image_index = 14 then image_speed = 0;

Keyboard Event for <Left> Key:
execute code:

select = 0;

Keyboard Event for <Right> Key:
execute code:

select = 1;

Key Press Event for <Enter> Key:
if select is equal to 0
	  go to next room with transition effect Fade out and in
if select is equal to 1
	  load the game from the file save

Thanks for reading this, sorry if my format of quoting the code is laid out incorrectly D:.
  • 0

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14391 posts
  • Version:GM:Studio

Posted 21 June 2009 - 02:10 AM

http://gmc.yoyogames...opic=436096&hl=
  • 0

#3 Neonlare

Neonlare

    GMC Member

  • GMC Member
  • 49 posts

Posted 21 June 2009 - 12:19 PM

I've solved the problem, and it didn't relate to anything in your hyperlink. The issue was that because the obj_sound was persistent, every time I loaded a new game it would have two entities trying to do the same thing, so it began canceling out it seems. I just added an instance_number check into the sound object which deletes any extra obj_sound files and it now works.
  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14391 posts
  • Version:GM:Studio

Posted 21 June 2009 - 10:36 PM

I've solved the problem, and it didn't relate to anything in your hyperlink. The issue was that because the obj_sound was persistent, every time I loaded a new game it would have two entities trying to do the same thing, so it began canceling out it seems. I just added an instance_number check into the sound object which deletes any extra obj_sound files and it now works.


And can you save, quit, restart and load? Usually that is what most people have trouble with.
  • 0

#5 Neonlare

Neonlare

    GMC Member

  • GMC Member
  • 49 posts

Posted 21 June 2009 - 11:07 PM

I've solved the problem, and it didn't relate to anything in your hyperlink. The issue was that because the obj_sound was persistent, every time I loaded a new game it would have two entities trying to do the same thing, so it began canceling out it seems. I just added an instance_number check into the sound object which deletes any extra obj_sound files and it now works.


And can you save, quit, restart and load? Usually that is what most people have trouble with.


Yeah, that post I made is pretty out of date now. I thought it solved it, but later on it began appearing again. I can't load the game without the music not playing, although the sound object appears before the title screen (It's on the room before it). I couldn't understand what was going on in that hyperlink since a fair amount of it seemed infered to code that I don't think I know at the moment. My problem's back again it seems :/.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users