Logo

Checking hard song and difficulty in music wheel?

Register Log In Back To Forums

Post #1 · Posted at 2016-07-02 03:08:56am 7.8 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

Hello friends, I'm doing my way with SM5 theming, and I have this screnario, I need to check in the music wheel if the user is over a hard song, and is selected a hard difficulty (hard, challenge including edit steps) I have made something similar to the following code:


t[#t+1] = LoadActor( "dummy" )..{
InitCommand=cmd(diffusealpha,0);
GlowCommand=cmd(diffusealpha,0;Center;FullScreen;blend,'BlendMode_Add';linear,1;diffusealpha,1;linear,1;diffusealpha,0;queuecommand,"Glow");
HideCommand=cmd(linear,1;diffusealpha,0);
SetCommand=function(self)
local song = GAMESTATE:GetCurrentSong();
if song then
--Check Harder Difficulty
local style = GAMESTATE:GetCurrentStyle():GetStepsType();
local steps = song:GetOneSteps(style, "Difficulty_Hard");
local stepsC = song:GetOneSteps(style, "Difficulty_Challenge");
local stepsE = song:GetOneSteps(style, "Difficulty_Edit");
local glowDiff = 14;
local glowBool = false;

if steps then
if steps:GetMeter() > glowDiff then
glowBool = true;
end;
else
if stepsC then
if stepsC:GetMeter() > (glowDiff+1) then
glowBool = true;
end;
else
if stepsE then
if stepsE:GetMeter() > glowDiff then
glowBool = true;
end;
end;
end;
end;

--Check glowing
if glowBool then
self:queuecommand("Glow");
else
self:stoptweening();
self:queuecommand("Hide");
end;

else
self:stoptweening();
self:queuecommand("Hide");
end;
end;

CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
};


When I am over a hard song (over 14 for this code) the actor is showing, but is showing for all the difficulties, I only like to trigger it when the user have changed the difficulty to expert or higher, also sorry for the hard meter coding, I haven't found a simple way to check it Laughing Out Loud what should I need to add to check the difficulty? (I'm new to SM Commands Laughing Hard ) Thanks!

Post #2 · Posted at 2016-07-14 06:23:58am 7.7 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30

I haven't tested this code but something like this should get you started. http://pastebin.com/h3PH4csN

I included some comments in the code, but some of it may still be confusing (or may not work). Just ask if you have any questions.

Post #3 · Posted at 2016-07-14 03:26:37pm 7.7 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

Thanks, I've think that I would die solving this Laughing Out Loud

I've tested the code, and it works partially, this part of the code is not triggering the glow:

if meter >= glowDiff


The difficulty part of the condition is working, there's a way to debug the value of the meter or a way to check it?

The rest of the code is working, but sometimes the glow object is not showing if you met all the conditions, but if you keep a bit of time navigating around the music wheel, like 10 seconds later sometimes is working again, or is the inverse scenario, starts working, and after some time stops working, is something strange. Also if you keep scrolling the wheel for some time, this message appears:

http://i.imgur.com/kUA66mf.png

I think is missing something to control, and prevent the overflow. But otherwise is working nicely. Thanks!

Post #4 · Posted at 2016-07-14 07:10:17pm 7.7 years ago

Offline Mad Matt
Mad Matt Avatar Member
65 Posts
United States
Reg. 2011-10-26

I believe his logic( SetCommand ) is correct, it is the other commands that require a little tweeking. Try these command definitions - http://pastebin.com/5ERgmqtx

Post #5 · Posted at 2016-07-15 01:22:28am 7.7 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30

Thanks, Matt. Big Grin

Post #6 · Posted at 2016-07-23 07:56:35pm 7.7 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

Thanks friends, the Matt fixes are working, but when I choose the roulette this message is still appearing:

http://i.imgur.com/kUA66mf.png

Now I'm gonna convert it to a Frame and add some childrens. Thanks!
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: 8% · Server Time: 2024-04-19 16:05:10
This page took 0.004 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language