Hi all!
I'm using this script by Yanfly: http://yanflychannel.wordpress.com/rmvxa/field-scripts/event-window/
It's nice, but would be perfect if I could play a SE each time item/gold/etc is received. Would anyone happen to have an idea how to add that feature to it?
Thanks!
How can I add a sound effect to Yanfly's Event Window script?
● ARCHIVED · READ-ONLY
-
-
it's actually pretty easy to set up, but a) there are limitations (no doubt you can get past this...but I have no idea how), and B) it kinda depends on what exactly you want. do you want the same noise no matter what it is you get? do you want different noises based on found item/lost item/found gold/lost gold, etc?
let's say you want one sound when you get stuff, and another when you lose stuff. also note that if you find/lose more than one thing at a time, it'll play the sounds twice, so be careful with that.
I haven't worked out a way to just willy-nilly pick any of the SEs you have in your game, but if you open up the database window and go to the "system" tab, you'll see a whole list of SEs with specific titles. the script call to play any one of those is "sound.play[whatever]" - the specific line after the "." you'll have to find yourself for which sound you want to be played, but if you open up the "Sound" script (third file from the top), you'll see them all listed. just c/p the stuff after "self.", and add it to "sound.", and it'll play the sound with that title.
so let's say you want "use item (item3)" to be played when you get stuff, and "load (load)" to be played when you lose stuff. awesome. open up the event window script, and scroll down to a line that says "# new method: event_window_make_gold_text". inside the function, you'll see a statement saying "if value > 0, text = foundtext, else if value < 0, text = losttext". this is where you want to add the sound.
basically you want the statement to look like this:
Code:select the whole statement, and copy it. scroll down to the next function "def event_window_make_item_text", find the "if value > 0" statement, and replace it with the statement you've previously copied. bam, now it should play sound. there are neater ways to do it, but this way it's super super easy to make it play different sounds depending on if you found or lost things, and whether what you got/lost was gold or an item.if value > 0 text = YEA::EVENT_WINDOW::FOUND_TEXT Sound.play_use_item elsif value < 0 text = YEA::EVENT_WINDOW::LOST_TEXT Sound.play_load -
Pretty easy request.
http://db.tt/THNGt0kn
Install it below the Event Window script in your script editor. Instructions should be self-explanatory.
Feel free to ask for any modifications. -
aha, so that's how you play sounds that aren't in $data_system! learn something new every day :3
-
Wow. A lot more customizable than I needed, but it gets the job done. (I just wanted to play "Chime2" when you get anything.) Thanks!
-
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.