Forums » Themes » MusicWheel behavior.

1
Hello everyone. I'm new to this forum.
I'm making a new SM5 theme. What I need now is to make each MusicWheel item transform in different way. And I found out this in {metrics.ini}:


Spoiler (click to view)[ScreenSelectMusic]
.....................
CDTitleOnCommand=draworder,10;scaletoclipped,247,190;diffusealpha,0;finishtweening;sleep,0.3;linear,1;diffusealpha,1
CDTitleOffCommand=sleep,0.2;linear,0.5;zoom,0.5;decelerate,0.9;zoom,3
CDTitleFrontCommand=
CDTitleBackCommand=
.....................

---[[this is the transformation command part]]---

CDTitleOnCommand=draworder,10;scaletoclipped,247,190;diffusealpha,0;finishtweening;sleep,0.3;linear,1;diffusealpha,1
CDTitleOffCommand=sleep,0.2;linear,0.5;zoom,0.5;decelerate,0.9;zoom,3
CDTitleFrontCommand=
CDTitleBackCommand=
CDTitleX=SCREEN_CENTER_X
CDTitleY=SCREEN_CENTER_Y-7
................
MusicWheelX=-SCREEN_CENTER_X3
MusicWheelY=SCREEN_CENTER_Y-7
MusicWheelOnCommand=zoom,2;diffusealpha,0;addx,SCREEN_CENTER_X4;fov,72;linear,.5;zoom,1;diffusealpha,1
MusicWheelOffCommand=Hidden,1
......................
[MusicWheel]
.....................
ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) HandleWheel(self,offsetFromCenter,itemIndex,numItems) end;
.....................
Yeah. Some kind of link to HandleWheel function in {utils.lua}:

Spoiler (click to view)function HandleWheel( self,offsetFromCenter,itemIndex,numItems )
local x = offsetFromCenter * 180
if offsetFromCenter >= 1 then
x = scale(offsetFromCenter+1,-1,1,-.5,.5) * 180
elseif offsetFromCenter <= -1 then
x = scale(offsetFromCenter-1,-1,1,-.5,.5) * 180
end
self:zoom(math.cos(offsetFromCenter/math.pi))
self:x( x )
self:z((-clamp(math.abs(offsetFromCenter),0,1)*170)-math.abs(offsetFromCenter))
self:rotationy( clamp( offsetFromCenter, -1, 1) * 75)
end

I need to make my MusicWheel to behave like this video. Well, check the [1:38] part. The inner part.



Unfortunately the guy who made this theme (Intrmns perhaps) has packed it so I can't get any elements from it.
I really need help. Thanks so much!

Last edited: 20 August 2015 10:47pm

Reply
I don't completely understand your question, but it seems like you want to do have more control over each item in the MusicWheel. If that is the case, then you're on the right track.

The ItemTransformFunction metric defines the way each MusicWheelItem will behave. The code you shared passes that responsibility to a function defined elsewhere known as HandleWheel()

[MusicWheel]

ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) HandleWheel(self,offsetFromCenter,itemIndex,numItems) end;


Luckily, you've already found where that function is defined, so you can really just start trying to make changes to that function. You can make changes to the Lua while StepMania is running, save the file, and then reload StepMania's scripts by holding Control and pressing F2.

That's about all I can help you with right now, unless you provide a more details description of what you're trying to do. Good luck!

Last edited: 9 August 2015 1:28pm

Reply
Post update: I finally found a theme video which speaks out ALL my meaning. Well, like this. [1:38] part.

Last edited: 20 August 2015 10:31pm

Reply
[Update] More information provided. I would love if anyone could give me a help.
This is the only thing needed for my soon-released theme. Thank you so much.

Reply
Here's the metrics.ini from that theme, if it helps.
Reply
Thanks @tertu so much for the metrics.ini. It would help me a lot. I'll try it out.
Reply
Update: Thanks @tertu much for the file. At least I exploited the code for its command.

MusicWheelType="MusicWheel"
MusicWheelX=SCREEN_CENTER_X
MusicWheelY=SCREEN_CENTER_Y*0.7-1+88;
MusicWheelOnCommand=fov,45;SetDrawByZPosition,true;draworder,1;zoomx,3;linear,0.5;zoomx,1;
MusicWheelSongChosenMessageCommand=finishtweening;linear,0.3;zoomx,3;addx,-2;
MusicWheelTwoPartConfirmCanceledMessageCommand=linear,0.3;zoomx,1;addx,2;
MusicWheelSongUnchosenMessageCommand=linear,0.3;zoomx,1;addx,2;
MusicWheelCurrentSongChangedMessageCommand=finishtweening;zoomx,1;
MusicWheelOffCommand=visible,false;

The only problem is SetDrawByZPosition. That may be the main one.
With this command, instead of making items gathering like that video, the whole music wheel disappear! (I wonder why.)
Btw, this is my metrics.ini file, if needed.

A little info for my upcoming theme: The most accurate Pump NXA theme, and will be packed to prevent from selling SM arcade. Your help will also be credited.

Last edited: 6 September 2015 7:14am

Reply
I found was looking for, thanks for the post!

Last edited: 16 January 2016 3:11am

Reply