Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: diagostimo on August 31, 2012, 01:07:19 am

Title: [xp]playing sounds using the built in functions?
Post by: diagostimo on August 31, 2012, 01:07:19 am
hey there guys, it is confusing me on how i exactly use a script call to play a sound from inside a script, for example i can play a sound using the following :

$game_system.se_play($data_system.cancel_se)

and that will play the cancel sound in the database, but what if i want to use that function to play a sound i want it to play?
looking at interpreter to see how an event does it is useless as i get this:
$game_system.se_play(@parameters[0])
and i have no idea on the structure of that parameter, i can play a sound like so:
Audio.se_play("Audio/SE/" + "sound", VOL, PITCH)
but what i really want to do is know how to use the $game_system.se_play function
edit:
ok looking through the help file i found i need to use: RPG::AudioFile
i applyed it like this: RPG::AudioFile.new("sound")
so i have managed to set the sound with the method i wanted, but say i wanted to be really anal and set the sound name and pitch but leave  the volume as default how would i apply it? e.g: RPG::AudioFile.new("sound", DEFAULT, 150)
Title: Re: [xp]playing sounds using the built in functions?
Post by: KK20 on August 31, 2012, 12:38:38 pm
My question is what the heck do you mean by default? Wouldn't a volume of 100 be considered the default for any type of audio format?
Title: Re: [xp]playing sounds using the built in functions?
Post by: ForeverZer0 on August 31, 2012, 05:44:06 pm
As KK20 said, why not just set it as "default". I don't understand what is stopping you.
In RMXP, BGM and ME use a default volume of 100, while BGS and SE use a volume of 80.

You shouldn't have any problem with it.
Title: Re: [xp]playing sounds using the built in functions?
Post by: diagostimo on August 31, 2012, 07:35:06 pm
what i meant really was tht is there a way to cut out having to enter the volume, say i only wanted to manipulate the name and pitch, so i would efectively get this: RPG::AudioFile.new("sound",pitch) cutting out volume and getting it to return the default in RPG::AudioFile, like i said just if i wanted to be anal about it  :P

Title: Re: [xp]playing sounds using the built in functions?
Post by: KK20 on August 31, 2012, 07:48:46 pm
Nope. You have to follow the order of parameters. There's no way you can cut out the volume without modifying the method.