Logo

[SM5] Use lua to change attributes of current song/steps?

Register Log In Back To Forums

Post #1 · Posted at 2019-12-09 03:20:27am 4.3 years ago

Offline DMNBT
DMNBT Avatar Member+
77 Posts
Chile
Reg. 2014-06-15

Hello, I have a question about using lua to change the displayed attributes of the current song, namely if it's even possible. I know I can load a lua file through the FGCHANGES tag (I'm mostly using it in ssc files where one difficulty has a different music than the rest, and I have to tell SM to actually stop the song and proceed to the next screen if that music file is shorter), but I'm wondering if I can do more: for example, I have a simfile for Akino's the keel where the Challenge steps are actually the Nu-Style Gabba remix of the song, but currently SM displays the simfile's title as 'the keel' regardless of difficulty, as step-specific tags for title/subtitle/artist don't actually exist. But that got me wondering: can I load a fgchange lua to 'inject' the proper titles into SM? So my question is if this is even remotely possible? I'd like to have some reassurance before embarking on a wild journey of telling SM what I want it to print...

Post #2 · Posted at 2019-12-09 08:06:22pm 4.3 years ago

Offline piratepoog
piratepoog Avatar Member
5 Posts
Not Set
Reg. 2019-10-17

As far as I know, attributes of a song are not mutable. At least I don't see anything to set it in the SM Lua API. Two things i'd try if i was attempting this would be to add transliterated titles and use those only for the certain songs that you choose (if you already use a lot of transliterated titles this may not work so well, and you'd have to find a way to keep track of which song is which).

The other way might be to cover up where it displays the title and then draw your own right over it. For themes like Simply Love, they also put a progress bar on the song title which would get covered up as well so you'd have to figure that out.

Finally, i don't think FGCHANGES are loaded until screengameplay so none of that would affect screenselectmusic. On that screen you might need a custom music wheel. For the other parts not on the musicwheel you can make it say whatever you want of course

Hopefully i'm wrong and someone can chime in with a way to change fields the way you want to though lol.

Post #3 · Posted at 2019-12-10 12:12:46am 4.3 years ago

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

"But enough talk! Have at you!"

Last updated: 2019-12-10 12:19am
songTitles are read only.

Instead you can check for a #DESCRIPTION or #STEPSTYPE tag for the steps and use that if it exists and create a wrapper function to get the song title.

Example:
function GetSongTitle(song, steps)
--If the steps has a custom style name, use it.
local style = steps:GetChartName();
--If not, get the regular name.
if style == "" then
style = song:GetDisplayTitle()
end;

return style;
end;

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: 4% · Database: 4% · Server Time: 2024-04-18 22:09:46
This page took 0.005 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language