|
SetSongPaused and Me Displaying 1-20 of 22 total.
12
next
Code
|
I'm having some trouble using GetSongPos, SetSongPos and SetSongPaused. I have some relatively lengthy music files that I want to use as map music, but I don't want to start the song over every time the party encounters a battle.
'So,' I thought to myself, 'I'll just use GetSongPos and SetSongPaused before the party enters the battle, the battle music will play during the fight, they'll win and exit back out to the map, where I'll use SetSongPos and PlaySong to start the map music back up where it left off.'
But this isn't working. It isn't playing the song at all after I exit out of a battle.
Can someone just give me a quick crash course in the dynamic, fun-filled world of Song functions?
Posted on 2005-09-29 21:10:14 (last edited on 2005-09-30 17:00:24)
|
mcgrue
|
Using the advanced music library, I think you pause the song you want to play, load the battle song on a seperate resource, play that, free the battle song when done, and unpause the original.
This is all from memory and could be wrong. I've not gotten to the advanced music lib part of Sully (To be demo'd in Bubba's place. whee)
How advanced is your battlesystem? :D
Posted on 2005-09-29 21:21:33
|
Code
|
Urgh! Sorry! I totally meant to post this in the help forum. And I'm usually so good about that.
Thanks, I forgot about the music lib! I'll give that a try. And I was using PlayMusic (rather than PlaySong) during the battle. I don't know if that makes a difference or not.
And my battlesystem... hoo boy... It's like a 9-year-old kid's closet. There are toys spilling out through the keyhole. I hate opening it up to work on it, because I always have to jam my code back in there before I can close the door again.
And as for how advanced it is.. well! It features Attacking, Getting Hurt, and Stealing! That's right, THREE things! Anway, it's coming along! ;)
Edit: Hmm, I still can't get it to work right. Here's what my code looks like:
Before the battle:
mapsongpos = GetSongPos(mapmusic);
SetSongPaused(mapmusic, mapsongpos);
battle_music = LoadSong('res/music/battle.xm');
PlaySong(battle_music);
After the battle:
StopSong(battle_music);
FreeSong(battle_music);
SetSongPos(mapmusic,mapsongpos);
PlaySong(mapmusic);
The map music starts playing again after the battle, but it starts from the beginning instead of from mapsongpos. What are the units of song postions anyway?
Thanks for your help!
Posted on 2005-09-29 22:37:28 (last edited on 2005-09-29 23:50:15)
|
Rysen
|
I remember trying to get something like this to happen with Phoenix Flame, but eventually gave up.
I'm actually thinking that maybe they just don't work. I've spent a good half hour trying to make this work tonight, trying a lot of different combinations and it just either starts playing from the beginning again, or doesn't play at all. (I also tested with different file formats just to see if it was dependant on mp3, ogg, or mods, and no file type made any difference).
I'm wondering if there is supposed to be an 'UnPauseSong()' function within FMOD or something because if you have to tell it to pause at a certain point, and then on resume to play at a certain point, then I fail to see a difference between using SetSongPause() and just StopSong();, since in theory either way you'd still use SetSongPos();
I'm also incredibly tired and may be missing something.
Anyway, a fun little work around you can try is just turn the volume to 0 with SetSongVolume, and then when switching back turn it back up to whatever the default is. It doesn't pause the song, but at least it doesn't necessarily start at the beginning again either. :P I've tried this out, and am tempted to use it with the next Amethyst release, since it gives the illusion that you are actually pausing the song. *shrugs* (Though, this may also make your game less stable from useing too many resources.)
Unless, of course, someone can explain how to make it work. ;D
Posted on 2005-09-30 04:18:36 (last edited on 2005-09-30 04:57:33)
|
Code
|
Quote: Originally posted by Rysen
I'm wondering if there is supposed to be an 'UnPauseSong()' function within FMOD or something because if you have to tell it to pause at a certain point, and then on resume to play at a certain point, then I fail to see a difference between using SetSongPause() and just StopSong();, since in theory either way you'd still use SetSongPos();
Yeah, you know, I was thinking that too. It's kinda conspicuous that SetSongPaused(); is missing an opposite companion. I'm using StopSong(); right now and it doesn't seem to make a bit of difference.
Like you said, it seems like
PlaySong(mapsong);
SetSongPos(mapsong,mapsongpos);
won't play anything at all, and
SetSongPos(mapsong,mapsongpos);
PlaySong(mapsong);
plays the song from the beginning.
I really appreciate your effort, I didn't mean to get you so involved in it. And thanks for bringing that workaround to my attention. I'll get to work implementing that!
By the way, I'm a big fan, Rysen. I'm looking forward to your next releases. :*
Posted on 2005-09-30 09:29:17
|
pthaloearth
|
I also attempted to use this function for something similar but never got it to work, I tried every way I could think of but either setSongPos dosen't work or the setSongPaused dosen't. Someone should really look into if this is a bug. I searched the forums at one time and another person also had problems with the same functions but no one ever responded to the post.
So if someone could find out what's up with this it'd be a great help for many I'm sure. Umm, hello verge community!
Posted on 2005-09-30 09:52:22
|
Jesse
|
I have looked into this. I think it is actually 2 separate problems:
1) SetSongPaused(s,a) takes in a song and either 1 or 0, not the position to pause at. It always pauses at the current position. SetSongPaused(s,1) pauses it, and SetSongPaused(s,0) un-pauses it; effectively the same as PlaySong(s).
2) In verge's implementation of SetSongPos(s,a) it called SetSongPaused instead of SetSongPos. It's easy to see how this was done; they 'sound' the same when you say them in your head. Try it.
Anyway, I'm gonna correct the docs for the first point, and I've added the second fix to the current work-in-progress verge. It seems to work for me, now.
Ta!
Posted on 2005-09-30 16:39:18
|
Rysen
|
Excellent! Works great for me now. I thought there was something odd about SetSongPaused(s,h) taking the current position as an arguement. Though now that you've cleared it up it seems kind of obvious that that's something I should've tried. ;_;
Anyway, thanks for clearing that up Jesse :D
Posted on 2005-09-30 20:21:13
|
mcgrue
|
Zeromus has actually been doing a lot of research involving v3's sound system. I'll ask him to check out these issues in the morning. He's asleep right now... although Troupe, Ragecage, and Evilbob are having quite a time in the living room.
Posted on 2005-10-01 03:48:48
|
Rysen
|
Quote: Originally posted by mcgrue
Zeromus has actually been doing a lot of research involving v3's sound system. I'll ask him to check out these issues in the morning. He's asleep right now... although Troupe, Ragecage, and Evilbob are having quite a time in the living room.
I wish I was cool and lived in Texas :(
Posted on 2005-10-01 05:19:49
|
Omni
|
Texas? I thought they were wiped off the map? The media told me for sure they'd be wiped off the map! Along with Oklahoma, and Louisiana...again.
I think it would be really nifty if the architecture of V3's sound system more resembled that of a channel aware/focused API. So, for example, I could play a sound, but then continue to alter its volume and balance in real time. Or something like that. Anyway!
Posted on 2005-10-01 09:36:18
|
yhnmzwcs
|
Quote: Originally posted by Omni
Texas? I thought they were wiped off the map? The media told me for sure they'd be wiped off the map! Along with Oklahoma, and Louisiana...again.
I think it would be really nifty if the architecture of V3's sound system more resembled that of a channel aware/focused API. So, for example, I could play a sound, but then continue to alter its volume and balance in real time. Or something like that. Anyway!
Abt Texas: Nope.
Abt adjusting sounds:
Balance: use a stereo sound.
Volume: use your sound editor!
Now, It WOULD be nice to try and control channels of modules.
We could crossfade as we move between adjacent zones (right/wrong sides of track, say), or fade in from nothingness as the char approaches someth. interesting. I remember that stuff from the SNES.
And it would be a great EMBELLISHMENT.
Posted on 2005-10-01 10:43:12
|
CrazyAznGamer
|
Wait a sec... I live in Texas!
...
>_>
Posted on 2005-10-01 11:02:35
|
Gayo
|
You can't destroy texas, everyone there is a gun nut living in an impenetrable underground bunker full of canned beans.
Posted on 2005-10-01 14:14:09
|
Omni
|
Yhnmzwcs: crossfading was the point! Of course it'd be kinda dumb to use channel-awareness just to create a static stereo sound ;)
And how about this! DSP-effect support for sound effects! And the ability to alter/control the mixing effects applied to music _in VC!_
Posted on 2005-10-01 15:09:12
|
Jesse
|
Originally posted by Omni
I think it would be really nifty if the architecture of V3's sound system more resembled that of a channel aware/focused API. So, for example, I could play a sound, but then continue to alter its volume and balance in real time. Or something like that. Anyway!
You can alter sound volume in real time with SetSoundVolume(s,v). That allows fade-ins and outs, as well as mixing two sounds.
Posted on 2005-10-01 15:44:44
|
Omni
|
I didn't know that. How interesting...
Posted on 2005-10-01 16:19:40
|
mcgrue
|
Texas is too big to destroy.
Austin (aka VERGE City, USA) is too far inland to really be hurt by mere hurricanes.
Posted on 2005-10-01 17:13:08
|
Troupe
|
Quote: Originally posted by CrazyAznGamer
Wait a sec... I live in Texas!
...
>_>
Where?
Posted on 2005-10-03 17:23:34
|
mcgrue
|
My money is on Houston!
Posted on 2005-10-03 19:24:50
|
Displaying 1-20 of 22 total.
12
next
|
|