Logo

Checking hard song and difficulty in music wheel?

登録 ログイン フォーラム戻る

ポスト #1 · 2016-07-02 03:08:56amにポスト 7.8年前

Offline MadkaT
MadkaT Avatar Member
820 ポスト
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!

ポスト #2 · 2016-07-14 06:23:58amにポスト 7.8年前

Offline dbk2
dbk2 Avatar Member
332 ポスト
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.

ポスト #3 · 2016-07-14 03:26:37pmにポスト 7.8年前

Offline MadkaT
MadkaT Avatar Member
820 ポスト
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!

ポスト #4 · 2016-07-14 07:10:17pmにポスト 7.8年前

Offline Mad Matt
Mad Matt Avatar Member
65 ポスト
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

ポスト #5 · 2016-07-15 01:22:28amにポスト 7.8年前

Offline dbk2
dbk2 Avatar Member
332 ポスト
Not Set
Reg. 2012-04-30

Thanks, Matt. Big Grin

ポスト #6 · 2016-07-23 07:56:35pmにポスト 7.7年前

Offline MadkaT
MadkaT Avatar Member
820 ポスト
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!
登録 ログイン フォーラム戻る

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-05-03 02:09:14
このページは0.006秒サーバータイム使用する。
Theme: starlight · Language: japanese
Reset Theme & Language