I Wanna Community

Fangames => Game Design => Topic started by: Sephalos on June 26, 2013, 06:12:49 PM

Title: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on June 26, 2013, 06:12:49 PM
Intro
This guide will assume that you are using the YoSniper's Newest Engine or that the engine you are using is similar. Super Sound uses OGG files, so make sure you convert them using Audacity, a free audio editing software.

YoSniper's Newest Engine (https://kayin.pyoko.org/iwbtg/forums/index.php?topic=16549.0)
Audacity (https://audacity.sourceforge.net/)

Step 1.  Installing
Download the Super Sound Extension here https://gmc.yoyogames.com/index.php?showtopic=462692
Make a Music Folder to put in your OGG music files and put the folder in the same location as your Game Maker project.
Open your Game Maker project  and install the extension by going through the ?Resources? tab and clicking ?Select Extension Packages?.
(https://www.mediafire.com/convkey/3f37/d0io1rnm11su88i4g.jpg) (https://www.mediafire.com/view/d0io1rnm11su88i/Image1.png)

Find and Install the Super Sound Extension Package.
(https://www.mediafire.com/convkey/3fd2/hhflsb7xalgzm1n4g.jpg) (https://www.mediafire.com/view/hhflsb7xalgzm1n/Image2.png)

You can also check the help file for more information on the functions you can use with the extension.
(https://www.mediafire.com/convkey/fbfc/z711atcudrh3o374g.jpg) (https://www.mediafire.com/view/z711atcudrh3o37/Image3.png)

Step 2. World Object
Now we need to initialize Super Sound. Go to your ?world? object and go to the ?create event? script and add in the line.
SS_Init();
(https://www.mediafire.com/convkey/bc05/ucnh6bm17ddqbq24g.jpg) (https://www.mediafire.com/view/ucnh6bm17ddqbq2/Image4.png)

Initializing Super Sound means we also need to Unload it before the game is closed.
Change the ?Press F4 Event? script to this:
if keyboard_check(vk_alt)  { SS_Unload(); game_end (); }
And for both the ?Press Esc Event? and ?Close Button Event? change the script to this:
SS_Unload(); game_end();

Also, disable 'Let <Esc> end the game' in the Global Game Setting menu.
(https://www.mediafire.com/convkey/937b/398tiqb9pw51wyl4g.jpg) (https://www.mediafire.com/view/398tiqb9pw51wyl/Image6.png)

Step 3. Music Script
In the Scripts Folder find musicFunction.
(https://www.mediafire.com/convkey/5c12/ql38z4fagen46574g.jpg) (https://www.mediafire.com/view/ql38z4fagen4657/Image5.png)

Then you?ll change each ?case?.
The startRoom case should look like this:
case startRoom:         
if filePlaying != 1 { filePlaying = 1;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
bgm = SS_LoadSound('Music/title.ogg',1); SS_PlaySound(bgm); }
break;


Default case should look like this:
default:
if filePlaying != 0 { filePlaying = 0;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); } }
break;


You?ll want to copy paste those as you add more room so for example, your first area would look like this:
case stage1a:           
if filePlaying != 3 { filePlaying = 3;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
bgm = SS_LoadSound('Music/stage1a.ogg',1); SS_LoopSound(bgm); }
break;


To choose which music you are playing change ?Music/file.ogg? to something else. Make sure the ?filePlaying? is changed if you are switching to a new music. If you need to change music in the middle of a stage use the same code but make sure it is handled by the world object by doing this:
with(world){ if filePlaying != 5 { filePlaying = 5;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
bgm = SS_LoadSound('Music/boss.ogg',1); SS_LoopSound(bgm); } }



I think that?s it, I really hope I didn?t forget anything and I hope this helps. :OneHand:
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: lemonxreaper on June 27, 2013, 06:04:32 AM
Interesting, it certainly isn't as confusing as I thought, the real confusion came from the part of yosnipers music script. I would use that engine, but it would just take me too long to make it how I like, and there's a couple of things i'm not keen on.
Still learned a bit about ssound from this. I will have to use it if I get GM pro, since I'm sure that lite doesn't support extensions.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on June 27, 2013, 06:49:29 AM
Interesting, it certainly isn't as confusing as I thought, the real confusion came from the part of yosnipers music script. I would use that engine, but it would just take me too long to make it how I like, and there's a couple of things i'm not keen on.
Still learned a bit about ssound from this. I will have to use it if I get GM pro, since I'm sure that lite doesn't support extensions.
One thing's for sure, I just can't get it to work with Yutuu. I think it has something to do with the way Yutuu Engine Saves and Loads.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: lemonxreaper on June 27, 2013, 06:56:46 AM
Its certainly possible, Kamilia 2 uses both.
I don't exactly need it, but there was some features I thought I could take advantage of.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on June 27, 2013, 12:05:21 PM
Its certainly possible, Kamilia 2 uses both.
I don't exactly need it, but there was some features I thought I could take advantage of.
I'm pretty sure Influka modified the way the game handles saves. Judging by the fact that you can only save one file. But I might look into eventually and try to find a way to make it work.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 16, 2013, 08:57:48 PM
when i change the case events to

case startRoom:         
if filePlaying != 1 { filePlaying = 1;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
bgm = SS_LoadSound('Music/title.ogg',1); SS_PlaySound(bgm); }
break;

it says "Unknown function or script: SS_IsHandleValid"
Wat am i doing wrong
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on July 16, 2013, 09:10:44 PM
when i change the case events to

case startRoom:         
if filePlaying != 1 { filePlaying = 1;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
bgm = SS_LoadSound('Music/title.ogg',1); SS_PlaySound(bgm); }
break;

it says "Unknown function or script: SS_IsHandleValid"
Wat am i doing wrong
That's weird...
Make sure you have the version I linked in the thread and make sure you did all the above steps.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 16, 2013, 09:13:00 PM
when i change the case events to

case startRoom:         
if filePlaying != 1 { filePlaying = 1;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
bgm = SS_LoadSound('Music/title.ogg',1); SS_PlaySound(bgm); }
break;

it says "Unknown function or script: SS_IsHandleValid"
Wat am i doing wrong
That's weird...
Make sure you have the version I linked in the thread and make sure you did all the above steps.

I downloaded the SuperSound for Gamemaker 8.1 down further in the comments of the thread because people said the one in the OP didn't work for 8.1
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on July 16, 2013, 09:17:44 PM
Try adding this line to the world create object also after SS_Init();

bgm = SS_LoadSound('Music/title.ogg',1);
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 16, 2013, 09:22:37 PM
Try adding this line to the world create object also after SS_Init();

bgm = SS_LoadSound('Music/title.ogg',1);

3 Questions:
Do I change 'Music/title.ogg' to the title of a song? I mean in the one you just told me to put in the world object.
How does that change the "Unknown script or function: SS_IsHandleValid"?
Are you telling me to switch to the original one in the link you posted?
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on July 16, 2013, 09:51:56 PM
Try adding this line to the world create object also after SS_Init();

bgm = SS_LoadSound('Music/title.ogg',1);

3 Questions:
Do I change 'Music/title.ogg' to the title of a song? I mean in the one you just told me to put in the world object.
How does that change the "Unknown script or function: SS_IsHandleValid"?
Are you telling me to switch to the original one in the link you posted?
Keep everything the way it was and add it also to the world object (the name of a song you have in your music folder) I just want to see if that would maybe fix it.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 16, 2013, 09:54:42 PM
It still says "Unknown function or script: SS_IsHandleValid" :SwiftRage:
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 16, 2013, 10:59:03 PM
What game maker version do you use Seph?
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Starz0r on July 16, 2013, 11:01:16 PM
What game maker version do you use Seph?

He uses GameMaker 8.1.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 16, 2013, 11:20:28 PM
Then why didn't he just say that the original one he posted worked for Game maker 8.1...     :/
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on July 17, 2013, 03:36:23 AM
Then why didn't he just say that the original one he posted worked for Game maker 8.1...     :/
It does work with 8.1, that's the version I use. I just tried doing this on a fresh engine and everything is working fine for me. So I would call shenanigans on gamemaker being weird as it often is the case.

I really wish I could help but sadly I can't.  :BibleThump:

I would concider trying your hand at Fmod, but I have no experience with it.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Starz0r on July 17, 2013, 02:14:21 PM
Then why didn't he just say that the original one he posted worked for Game maker 8.1...     :/
It does work with 8.1, that's the version I use. I just tried doing this on a fresh engine and everything is working fine for me. So I would call shenanigans on gamemaker being weird as it often is the case.

I really wish I could help but sadly I can't.  :BibleThump:

I would concider trying your hand at Fmod, but I have no experience with it.

FMOD is a very hard task to work with, especially in GameMaker 8.1. Though you will get more quality and use out of FMOD and really isn't needed for a project like a Aiwanna game.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 17, 2013, 03:14:38 PM
Then why didn't he just say that the original one he posted worked for Game maker 8.1...     :/
It does work with 8.1, that's the version I use. I just tried doing this on a fresh engine and everything is working fine for me. So I would call shenanigans on gamemaker being weird as it often is the case.

I really wish I could help but sadly I can't.  :BibleThump:

I would concider trying your hand at Fmod, but I have no experience with it.

I don't think you understand what I was saying. at the start I downloaded a different supersound than the one that you linked because people in the comments said it didn't work for 8.1, So i assumed i couldn't use it... I told you that and you said to stick with it, which I did. Then i found out you use Game maker 8.1, so then I said "Why didn't he just tell me the original one he linked worked with Game maker 8.1?" Anyways, i'm using the original  one now and it works  :Kappa:
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on July 17, 2013, 03:21:04 PM
Well Actually I still need help. I put in all the music functions but I don't know what it all means. I have a song in a folder named "Music" in the folder that my game is in called "Electroman" So i put

 case startRoom:
  case loadRoom:
if filePlaying != 1 { filePlaying = 1;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
bgm = SS_LoadSound('Electroman.ogg',1); SS_PlaySound(bgm); }
break;

And it still played the "Guy rock" song (bgm01)
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on July 17, 2013, 05:08:06 PM
Oh! Well at least that's fixed.
Did you change the default case?
If not change it to this:

default:
if filePlaying != 0 { filePlaying = 0;
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); } }
break;


Also change all the cases to have something in it... I'm not sure why but SuperSound doesn't seem to want to group cases together.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on July 17, 2013, 05:21:55 PM
Also allow me to explain how the code works:

switch(room){
Checks for room cases within the script.

case loadRoom:
The current room you want to assign something to.

if filePlaying != 1 { filePlaying = 1;
First it checks the fileplaying value, if its not the same as the one currently playing it then switches to that, if not it keeps playing the same one and doesn't change the current song.
This script is there so the music doesn't restart everytime you hit 'R' or change rooms.

So every time you want to switch to a new song you have to add in a new value. So your next song would look like this: if filePlaying != 2 { filePlaying = 2;

if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
Then the script checks if there is a song stored in the handle bgm, if there is one it removes it from memory. This piece of code is here because if you try to remove a song from memory and the handle doesn't currently exists, SuperSound crashes. It's a failsafe.

bgm = SS_LoadSound('Electroman.ogg',1); SS_PlaySound(bgm); }
Then it stores Electroman.ogg to the bgm handle and then plays it. You want to change that line of code to SS_LoopSound(bgm); if you want that song to loop.

break;
Ends the script so it doesn't mess up your other cases (mainly with default).

The default case
This case is used if the script cannot find the current room.
So if you haven't had time to add in a room to your script, it will simply remove the music from memory.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on August 02, 2013, 09:41:12 PM
i have a problem...
I got supersound to load the ogg files, but
when it switches to another room and the other music starts playing, the old music that was playing doesn't stop.
i did the fileplaying scripts, and they're all different numbers. idk what to do :BibleThump:
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on August 02, 2013, 09:47:00 PM
i have a problem...
I got supersound to load the ogg files, but
when it switches to another room and the other music starts playing, the old music that was playing doesn't stop.
i did the fileplaying scripts, and they're all different numbers. idk what to do :BibleThump:
make sure you have this piece of code
if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); }
that's the one that stops and removes the song from the handle.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on August 02, 2013, 10:26:40 PM
...could i just send you the gm81 file with the music folder and the ogg files and you do it for me?  :Kappa:

this is all too confusing for me  :ResidentSleeper:
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on August 02, 2013, 11:56:17 PM
...could i just send you the gm81 file with the music folder and the ogg files and you do it for me?  :Kappa:

this is all too confusing for me  :ResidentSleeper:
sure, send it over by private message or something. I'll check it out tomorow, right now I'm off to bed.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on August 03, 2013, 11:31:26 AM
ok i sent a PM to you
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on August 03, 2013, 01:52:43 PM
ok i sent a PM to you
Alright I sent you back the file, everything should be fine now.  :KevinTurtle:
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on August 10, 2013, 09:37:44 PM
sorry for asking so many questions but is there a way to play sound effects with supersound?
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: 13lueWolf on August 10, 2013, 10:12:04 PM
Just a friendly tip for game makers, try and dabble with a little bit of everything to find what you understand. Start with that. Then go and try to push it to the next level.  :FrankerZ:

Don't expect everything to be done for you, especially when looking for specific things you want to add to a game. SuperSound has some flaws, but not in the way that prevents you from getting the job done. It's all "behind the scenes" stuff in the .dll and the way the extension works.

Every Sound .dll available does the same thing. In the end, it doesn't really matter which one you use. But...

If you want high-quality sound capabilities, I wouldn't use anything other than FMOD. It's easy to use once you learn the way it works. I wanted full control over my sound engine, so I went and created my own modified version of the .dll for my game.  :Kreygasm:

Anyways, I hope we all keep getting better and better at making games. The Wannabe community has a great potential to make awesome games.
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: pieceofcheese87 on August 22, 2013, 03:34:33 PM
How do you stop the current music?
Title: Re: Super Sound Guide for YoSniper's Engine
Post by: Sephalos on August 22, 2013, 07:11:00 PM
How do you stop the current music?
I'm assuming you want to stop a music using another object.
Simply do this:

with(world){ filePlaying = 0; if SS_IsHandleValid(bgm) = 1 { SS_FreeSound(bgm); } }