Logo

Play A Selected Sound When Highlighting Group Folder?

Register Log In Back To Forums

Post #1 · Posted at 2016-09-16 05:09:35am 7.5 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
Hi all,

Just wondering if it would be possible to play a sound when you go over a group jacket? If that's possible, would it be possible to code something like:

Quote
if not song and GetGroupName() == "Dance Dance Revolution 7th Mix -Max2-" then

LOAD SOUND

elseif not song and GetGroupName() == "Dance Dance Revolution Extreme" then

LOAD SOUND

else

BLANK

end

I tried to implement it (obviously with cleaner code than above) but I can't seem to get it to work properly at all so if anyone has any suggestions please let me know!

Thanks in advance!
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #2 · Posted at 2016-09-16 02:18:10pm 7.5 years ago

Offline FlameyBoy
FlameyBoy Avatar Member
335 Posts
United States
Reg. 2011-03-09

Could you post the code you used to do it? A quick look at the Lua documentation suggests that it is possible to get the currently selected wheel item's text and type, which should be sufficient to do this.

Post #3 · Posted at 2016-09-16 03:24:49pm 7.5 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
I can get the currently selected songs group name simply by doing:

Quote
local song = GAMESTATE:GetCurrentSong();
local songgroup = song:GetGroupName();

And from that I can do the if songgroup == "DDRMAX2" or whatever, only problem is I'm having trouble being able to trigger the sound only when I'm over the group folder - so when I have:

Quote
if not song then

It's not playing the sound...I can get things playing/working when I'm highlighting a song easily, just not over the folder itself (as I don't want to play a sound when a song is highlighted, just when the folder is highlighted.

Do you have any ideas? (Sorry if I'm not making too much sense, it's really late here, just about to head to bed).
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #4 · Posted at 2016-09-16 04:17:15pm 7.5 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."
ScreenSelectMusic has its own code to play sample music. Putting your own in will cause problems.

SSM looks for these files for sample music:
Sounds/ScreenSelectMusic section music
Sounds/ScreenSelectMusic sort music
Sounds/ScreenSelectMusic roulette music
Sounds/ScreenSelectMusic random music
Sounds/ScreenSelectMusic course music
Sounds/ScreenSelectMusic loop music

If the file is a lua file, it is executed. Lua sound files must return the path to a sound file. The sound file it returns is played.

So you can put your code to play special section music in the section music file. If you just have one section music you want to use for all groups, you don't need to use any lua code.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Post #5 · Posted at 2016-09-16 04:52:34pm 7.5 years ago

Offline FlameyBoy
FlameyBoy Avatar Member
335 Posts
United States
Reg. 2011-03-09


Last updated: 2016-09-16 04:52pm
If you don't have a song, then there's nothing to call song:GetGroupName() on at all and trying to do that will just cause a Lua error because you're trying to call a method on nil. You can't just do GetGroupName() because that tries to call the function GetGroupName, which doesn't exist. You have to find some other way to figure out which group is selected, which you can do, but it requires a different strategy.

Post #6 · Posted at 2016-09-18 02:25:24am 7.5 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
Basically what I'm trying to do is get the highlighted folder to play the BGM from the highlighted mixes Select Music screen (obviously I'd be calling them locally not from the other themes). I think if I just made the default "Select Music" sound file be _silent I shouldn't run into issue if I play the other music files - thanks for pointing that out though Kyzentun.

I'm still not sure how I would be able to get the currently highlighted folders name though as from what I've been able to find there isn't a way to find out what folder you're hovering over and if there's a way to run an actor while doing so.

Flamey, do you know how I could go about this?

I know that this is just a silly feature I'm trying to implement but if it's possible, I'd love to give it a go! Thanks for the feedback so far!
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #7 · Posted at 2016-10-27 01:56:11am 7.4 years ago

Offline ZTS
ZTS Avatar Member
139 Posts
Not Set
Reg. 2015-01-13

"But enough talk! Have at you!"
This is how the PIU themes do for folder announcers:
http://pastebin.com/JNR4JwRy
Get Rave It Out! https://sites.google.com/view/riodevs/home
Want your theme made? I take commissions, PM for details.
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 5% · Database: 4% · Server Time: 2024-04-19 16:14:24
This page took 0.007 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language