Fangames > Game Design
Super Sound Guide for YoSniper's Engine
Sephalos:
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.
pieceofcheese87:
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:
Sephalos:
--- Quote from: 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:
--- End quote ---
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.
pieceofcheese87:
...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:
Sephalos:
--- Quote from: 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:
--- End quote ---
sure, send it over by private message or something. I'll check it out tomorow, right now I'm off to bed.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version