Logo

[SM5] Displaying Actor On Screen Load Issue

Register Log In Back To Forums

Post #1 · Posted at 2017-09-20 05:58:04am 6.4 years ago

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

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

I've been scratching my head about this for quite a while now and every time I try to solve it, it just breaks so I thought I'd ask here.

What I've got going is on the music wheel, when a player changes song, it displays the correct background of the mix that the song is from. I'm doing this by using the CurrentSongChangedMessageCommand to run the function that checks whether the mix is the correct mix or not, or if the folder is the correct folder.

This part of the code works perfectly, changing the background when the next song is brought up.

What I'd like to achieve though is when the music wheel loads (either the first time or after the results screen), the background is the correct one straight away while retaining the current setup of being able to change when the next song is brought up.

I know that with my code written the way it is with the CurrentSongChangedMessageCommand it can't do that but I thought maybe someone might have an idea of how I could do that.

My code is below.

Quote
t[#t+1] = LoadActor( "MIXBACKGROUND" )..{
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0;);
OnCommand=cmd(diffusealpha,0;linear,0.05;diffusealpha,0;);
OffCommand=cmd(linear,0.05;diffusealpha,0);
SetCommand=function(self)

local wheel = SCREENMAN:GetTopScreen():GetMusicWheel()
local wheelitem_type = wheel:GetSelectedType()
local wheelitem_name = wheel:GetSelectedSection()

if wheelitem_type == "WheelItemDataType_Song" then

local song = GAMESTATE:GetCurrentSong();
local songgroup = song:GetGroupName();
if songgroup:find("MIXFOLDER") then
self:stoptweening();
self:zoomtowidth(1280)
self:zoomtoheight(720)
self:linear(0.5)
self:diffusealpha(1)
elseif not song then
self:stoptweening();
self:linear(0.5)
self:diffusealpha(0)
else
self:stoptweening();
self:linear(0.5)
self:diffusealpha(0)
end

elseif wheelitem_type == "WheelItemDataType_Section" then
if wheelitem_name:find("MIXFOLDER") then
self:stoptweening();
self:zoomtowidth(1280)
self:zoomtoheight(720)
self:linear(0.5)
self:diffusealpha(1)
elseif not song then
self:stoptweening();
self:linear(0.5)
self:diffusealpha(0)
else
self:stoptweening();
self:linear(0.5)
self:diffusealpha(0)
end;
end;

end;
};

I'm sure there's a way, I just can't seem to work it out. Hope someone can help!

As always, I apologise if my code isn't good, I've sort of just worked everything out as I go along.
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 2017-09-20 06:53:53am 6.4 years ago

Offline razorblade
razorblade Avatar Member
1,099 Posts
Not Set
Reg. 2011-03-01

Consider pasting your lua code via https://paste.ofcode.org (bookmark it). Just select lua language coloring scheme.

Pasting code via quotes is eyesore.

Post #3 · Posted at 2017-09-20 07:05:27am 6.4 years ago

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

"Working On: 5thMix BGA bgchanges"
How's this? I haven't spaced it the same way as my code because I'm not at that PC but I've made it readable:

https://paste.ofcode.org/34hrL6uQ9GjPm6LyQpjfY4U
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 2017-09-20 08:54:05am 6.4 years ago

Offline razorblade
razorblade Avatar Member
1,099 Posts
Not Set
Reg. 2011-03-01


Last updated: 2017-09-20 09:02am

Post #5 · Posted at 2017-09-20 01:03:10pm 6.4 years ago

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

"Working On: 5thMix BGA bgchanges"
Works great! There was one small issue with the code (your elseif statement had a space between the else and if) which caused an issue initially but I fixed that and it works fantastically now!

Thanks for letting me know about the Codeshare site too. I have often thought that using the quotes on this site was tough to read the code.

Now I've just got to fix up a few other bits of code that were giving me the same issue as the backgrounds but I should be able to work it out now that you've given me something to work from.

Thanks again!
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 #6 · Posted at 2017-09-21 01:56:26am 6.4 years ago

Offline pm41224
pm41224 Avatar Member
315 Posts
United States
Reg. 2012-05-19

Nintendo Network ID: pm412243DS Friend Code: 4210-4460-8178
"DanceDanceRevolution!"
Interesting code there... I wonder what theme is being used to inject the code into, because depending on what SM5 theme you're using, it will be a Challenge to work with (pun intended).

Post #7 · Posted at 2017-09-21 03:17:06am 6.4 years ago

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

"Working On: 5thMix BGA bgchanges"
I used Kenp's X2 AC theme as a base and have changed everything bar a couple of items now. I worked from that theme as I wanted to have the folder structure like that theme had but at the time I started theme creating in SM5 I had no experience with SM5 coding (used to theme for 3.9 a lot but SM5 is quite different) so instead of starting from scratch to get that look I used it as a base.

Been working on the theme for well over a year now on and off and yes, it has been...Challenge sometimes MadVery Happy
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 #8 · Posted at 2017-09-21 05:10:39am 6.4 years ago

Offline pm41224
pm41224 Avatar Member
315 Posts
United States
Reg. 2012-05-19

Nintendo Network ID: pm412243DS Friend Code: 4210-4460-8178
"DanceDanceRevolution!"

Last updated: 2017-09-21 05:10am
Oh, that's a good place to start. I guess all most of the StepMania themers had challenges transitioning from SM3.9 to SM5, since they both are completely different worlds.
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-03-19 02:30:02
This page took 0.006 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language