Post #1 · Posted at 2019-12-09 03:20:27am 4.3 years ago
DMNBT | |
---|---|
Member+ | |
77 Posts | |
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
piratepoog | |
---|---|
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.
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
ZTS | |
---|---|
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:
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;
--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;