Logo

Stepmania Functions for # of marvelous, perfect, etc?

Register Log In Back To Forums

Post #1 · Posted at 2014-06-05 04:13:34am 9.8 years ago

Offline Musashi
Musashi Avatar Member
108 Posts
United States
Reg. 2014-05-03

I'm in the midst of adapting a theme based on the DDR X games.

The theme currently uses Conditions that determine if the colorful rings and "Full Combo" letters appear.

I have expanded the grading system, thus a AAA is no longer synonymous with a Perfect Full Combo. Accordingly, I would like to adapt the conditions for a "Perfect Full Combo" ring since they currently check for a AAA. Is there Conditional function/variable I can use in its place? I was hoping maybe I could check if the Number of Greats is 0, since that and FullCombo(Player#) being true would confirm a Perfect Full Combo. Is there such a variable in Stepmania I can use?

Post #2 · Posted at 2014-06-05 04:34:04am 9.8 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."
The following explanation assumes that you are solving this problem in Lua on SM5.
You want to use STATSMAN:GetCurStageStats to get the stats for the current stage. Then use GetPlayerStageStats to get the stats for the player you're checking. Then use GetTapNoteScore to get the number of judgements of the level you're checking.

Here's a simple example that prints the numbers to the log file.


local function check_player_judge_counts(player_number)
local judgements= {"TapNoteScore_W1", "TapNoteScore_W2", "TapNoteScore_W3", "TapNoteScore_W4", "TapNoteScore_W5", "TapNoteScore_Miss"}
local player_stats= STATSMAN:GetCurStageStats():GetPlayerStageStats(player_stats)
Trace(player_number .. " earned the following judgments:")
for i, judge in ipairs(judgements) do
Trace(player_stats:GetTapNoteScores(judge) .. " " .. judge)
end
end

There are more TapNoteScore values than just those, but those are probably the only ones you care about. Look at Docs/Luadoc/Lua.xml for more API documentation.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Post #3 · Posted at 2014-06-06 12:51:11am 9.8 years ago

Offline Musashi
Musashi Avatar Member
108 Posts
United States
Reg. 2014-05-03

Thanks for the info.

I'm starting to wonder if to get all the little things I want in a theme I may have to try adapting something from Stepmania 5. I've been using 3.9+ for awhile, but I actually got 5 working when before it wouldn't.

Post #4 · Posted at 2014-06-06 01:00:51am 9.8 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."
I don't think there's a real reason to use anything other than SM5 for making new themes, and I've heard from others that theming for SM5 is easier and more powerful. I never did any theming before SM5, so I don't really know what it was like before.

silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Post #5 · Posted at 2014-06-06 01:37:49am 9.8 years ago

Offline Musashi
Musashi Avatar Member
108 Posts
United States
Reg. 2014-05-03

I definitely get the impression that 5 is quite powerful; it's just that for what I have in mind I'm having trouble finding a good starting point that I can work from. I've been looking for documentation and how-to manuals for making themes or even porting 3.9+ themes to SM5, but so far I haven't found much.

I was thinking that if I could find themes for SM5 based on DDR Max/Extreme/Supernova and/or DDR X2 CS along with a theme based on ITG, I could what I've envisioned no problem.

Post #6 · Posted at 2014-06-06 02:01:41am 9.8 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."

Last updated: 2014-06-06 02:01am
Yeah, there's not much documentation for getting started. I personally just build everything from scratch in Lua, but I don't think that's a good solution for everyone.

I don't really know where to start with explaining things, so just ask for examples of how to do things.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Post #7 · Posted at 2014-06-07 11:41:50pm 9.8 years ago

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

Quote: Musashi
I was thinking that if I could find themes for SM5 based on DDR Max/Extreme/Supernova and/or DDR X2 CS along with a theme based on ITG, I could what I've envisioned no problem.

What aspects of an ITG styled theme for SM5 do you need for reference?

Post #8 · Posted at 2014-06-08 05:24:32pm 9.8 years ago

Offline Musashi
Musashi Avatar Member
108 Posts
United States
Reg. 2014-05-03

Quote: dbk2
Quote: Musashi
I was thinking that if I could find themes for SM5 based on DDR Max/Extreme/Supernova and/or DDR X2 CS along with a theme based on ITG, I could what I've envisioned no problem.

What aspects of an ITG styled theme for SM5 do you need for reference?

The expanded grade system; I want to add grade tiers and respective graphics for + and - versions of the grades.

Post #9 · Posted at 2014-06-08 11:08:38pm 9.8 years ago

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


Last updated: 2014-06-08 11:15pm
As you probably know, GradeTiers in StepMania 5 can be defined uniquely per theme in Metrics.ini. GradeTiers are basically how the game determines what "letter grade" is associated with certain scores. You can refer to the relevant Metrics from freem's ITG3 port for SM5: lines 27 - 64

Two of the metrics there (GradeTier01IsAllW2s=false and GradeTier02IsAllW2s=false) can be used to override the numerical cutoffs defined underneath. "W2" refers to Window2 ("Perfect" in DDR or "Excellent" in ITG). By setting GradeTier01IsAllW2s to true, the player could earn GradeTier02 (whatever you define that to mean) by getting all Window2s.

Once those are established, you can make appropriately-named corresponding files in your theme's /Graphics/ directory. I'll link you, again, to some such files from freem's ITG3 port:

./Graphics/GradeDisplayEval Tier01.lua
./Graphics/GradeDisplayEval Tier02.lua
./Graphics/GradeDisplayEval Tier03.lua
...
./Graphics/GradeDisplayEval Tier16.lua
./Graphics/GradeDisplayEval Tier17.lua
./Graphics/GradeDisplayEval failed.lua

The ITG3 theme used rendered 3D models for each of the letter grades on ScreenEvaluation, so all of those files use the Def.Model{} call. It is, of course, easier to use .png graphics with a LoadActor("nameofyourfile.png") call.

Finally, the "traditional" way to make your grades appear on ScreenEvaluation is via Metrics.ini (There are other, more flexible means which require a little knowledge of Lua. Let me know if you want an explanation of that.). Refer to ITG3's Metrics, lines 1064-1082

You may find it useful to download the entire ITG3 port for SM5 for reference: download link

Be sure to thank freem (AJ187 on Z-i-V) if you see him, and let me know if I can be of any additional assistance.

Post #10 · Posted at 2014-06-09 12:12:14am 9.8 years ago

Offline Musashi
Musashi Avatar Member
108 Posts
United States
Reg. 2014-05-03

Quote: dbk2
As you probably know, GradeTiers in StepMania 5 can be defined uniquely per theme in Metrics.ini. GradeTiers are basically how the game determines what "letter grade" is associated with certain scores. You can refer to the relevant Metrics from freem's ITG3 port for SM5: lines 27 - 64

Two of the metrics there (GradeTier01IsAllW2s=false and GradeTier02IsAllW2s=false) can be used to override the numerical cutoffs defined underneath. "W2" refers to Window2 ("Perfect" in DDR or "Excellent" in ITG). By setting GradeTier01IsAllW2s to true, the player could earn GradeTier02 (whatever you define that to mean) by getting all Window2s.

Once those are established, you can make appropriately-named corresponding files in your theme's /Graphics/ directory. I'll link you, again, to some such files from freem's ITG3 port:

./Graphics/GradeDisplayEval Tier01.lua
./Graphics/GradeDisplayEval Tier02.lua
./Graphics/GradeDisplayEval Tier03.lua
...
./Graphics/GradeDisplayEval Tier16.lua
./Graphics/GradeDisplayEval Tier17.lua
./Graphics/GradeDisplayEval failed.lua

The ITG3 theme used rendered 3D models for each of the letter grades on ScreenEvaluation, so all of those files use the Def.Model{} call. It is, of course, easier to use .png graphics with a LoadActor("nameofyourfile.png") call.

Finally, the "traditional" way to make your grades appear on ScreenEvaluation is via Metrics.ini (There are other, more flexible means which require a little knowledge of Lua. Let me know if you want an explanation of that.). Refer to ITG3's Metrics, lines 1064-1082

You may find it useful to download the entire ITG3 port for SM5 for reference: download link

Be sure to thank freem (AJ187 on Z-i-V) if you see him, and let me know if I can be of any additional assistance.

This is helpful; I will download the theme for use and studying purposes.

Funny you mention freem; I was about to go looking for him. I saw that he ported the 5th Mix theme to SM5, which got me thinking maybe I can ask him about the process of porting themes from 3.9 to SM5.

So far, I've used a SM ini to LUA converter to produce code for every BGAnimation.ini I saw in the theme. Along the way, I took notes about code not converted and other observations. One of which was a line saying "You will need the 3.9 Conditionals LUA module".

That being said, I know there's more to porting a theme than building default.lua for every BGAnimation.ini, but I don't yet know what to do next.

Post #11 · Posted at 2014-06-09 02:36:17am 9.8 years ago

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


Last updated: 2014-06-09 02:38am
I'm completely unfamiliar with SM3.9 theming, but I am familiar with the process of porting a SM3.95 theme to run in SM5. I personally prefer to think of it as "recreating a theme" rather than "porting a theme." If you want to have an older theme run in SM5, you will inevitably end up doing some things a little differently. There is no clean, automated conversion process that I know of that works 100% of the time in 100% of cases. Too many things have changed between versions.

That being said, I've done small pieces of theming in SM3.95 and large quantities of theming in SM5, and I vastly prefer SM5. It is far more stable which is immensely helpful when theming/coding. Typos in SM3.95 tend to crash the program outright, whereas in SM5 they (usually) report as errors and point you to (roughly) what line of code the error came from. That alone would be enough for me.

If you are looking for "what do do next" I recommend making a copy of theme you like (I recommend Default or one of freem's themes, like Moonlight), picking a screen you want to change, and modifying the code until the screen does what you want. You can try this out by starting SM5, pressing F3+F6 to enter the theming menu, and then tapping F3+2 whenever you want to reload the screen you're on to check for changes. Try it out, change the xy position of an Actor or the color of a Quad or the tween time of something else.

For something (slightly) more advanced, try getting a new Actor to show up that screen using the LoadActor() command and have it move around or something. This (mostly complete) reference of commands might be useful: http://kki.ajworld.net/wiki/Commands:Main

The only way to learn right now, really, is by experimenting.

Post #12 · Posted at 2014-06-09 03:49:49am 9.8 years ago

Offline Musashi
Musashi Avatar Member
108 Posts
United States
Reg. 2014-05-03


Last updated: 2014-06-09 07:07pm
I will be running some more experiments this week.

Biggest things I wanted to know were what are the bare minimum requirements for a theme to run? My immediate goal is to build what it needs to not crash upon activation. So I was curious about if certain scrips must be present, or if there are mandatory items in the metrics.

You and freem have given me some ideas tho; It's actually part of my real life job to figure out software, so I should make some progress soon.

Post #13 · Posted at 2014-06-09 05:46:37pm 9.8 years ago

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

The bare minimum requirements for a theme to function are:

1. make a new directory in your /Themes/ directory and give it the name you want.

That's it. There are no scripts you need, you don't even need a Metrics.ini file. Since you you are essentially not specifying anything custom in your theme, every aspect of you theme will look to the _fallback theme for how to behave. In essence, your new theme with nothing in it will look and behave exactly like the _fallback theme, but it will be its own theme. It will not look very pretty, but it will function.

The idea from there would be to only add things as you needed them. Only add a Metrics.ini file and contents to it if you need to override things that were set in the _fallback theme (like the positioning of elements). Only add a /BGAnimations/ directory and children directories if you need new graphics.

This is a great approach in that it will result in a clean, lean theme when you're done and you'll likely learn a LOT along the way (see: Kyzentun's Consensual theme). It's also a very challenging approach, especially if you've never themed before in that it won't provide you with a ton of examples for what people typically need for theming (ie. making a DDR theme).

My advice to you from my previous post stands: copy an existing theme like Default or Moonlight, pick a simple screen where not a lot is going on and keep changing the code and then refreshing the screen until you have either an understanding or a question.
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: 6% · Database: 4% · Server Time: 2024-04-19 03:52:51
This page took 0.011 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language