PDA

View Full Version : Background Ambience



Revfan9
03-25-2008, 05:11 AM
Nothing too complex, again, really just something to help get myself back into the feel of it.


START SETR sd0,d0; d0 is the number of frames between each sfx
RNDR sd1,d1; d1 is the number of different sfx - 1
ADDR sd1,d2; d2 is the number of the first sfx
PLAYSOUNDR sd1; Be sure all of the sfx you want are in range!
WAIT WAITFRAME
SUBV sd0,1
COMPAREV sd0,0
GOTOTRUE START
GOTOFALSE WAIT

Instructions are in the code's comments. Be sure that all of the sfx you want to use are in range with each other. What do I mean by this? If say, the room is one full of birds, and you want bird tweets to be playing everywhere. If you have 3 different bird tweets, and you set the first one as 60, then the other 2 must be 61 and 62.

Joe123
03-25-2008, 06:41 AM
So it plays a set of sound effects in a row with a certain gap between them?

_L_
03-25-2008, 11:37 AM
I like that people are thinking of these sorts of flourishes for their quests.

Revfan9
03-25-2008, 06:17 PM
So it plays a set of sound effects in a row with a certain gap between them?

It doesn't play them in a row, it plays a random one out of the "range" you set. It's purely cosmetic, sure, but it can add a nice feel if you use it properly (for example, Owl Hoots and Wolf Howls in the background in Night scenes). It's no Z3 Freescroll, but it works.