[xp]playing sounds using the built in functions?

Started by diagostimo, August 31, 2012, 01:07:19 am

Previous topic - Next topic

diagostimo

August 31, 2012, 01:07:19 am Last Edit: August 31, 2012, 01:57:40 am by diagostimo
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)

KK20

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?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

ForeverZer0

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.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

diagostimo

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


KK20

Nope. You have to follow the order of parameters. There's no way you can cut out the volume without modifying the method.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!