Logo

SM 5 Theming - Gameplay to Evaluation transition, Menus and Options

Register Log In Back To Forums

Post #1 · Posted at 2014-06-12 04:47:19am 9.8 years ago

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


Last updated: 2014-08-20 04:10pm
I am attempting to build a Stepmania 5 theme, and along the way, document the process. The thread title will change depending on my current progress.

For the first piece, I'd like to build an intro sequence, which is where my first major problem is occurring. The sequence is stuck on ScreenCompany and refuses to move to ScreenIntroMovie. The transition from ScreenInit to ScreenCompany went fine.

Relevant items:

From Metrics:
[ScreenInit]
Class="ScreenAttract"
Fallback="ScreenAttract"
NextScreen="ScreenCompany"

[ScreenCompany]
Class="ScreenAttract"
Fallback="ScreenAttract"
NextScreen="ScreenIntroMovie"
TimerSeconds=13

[ScreenIntroMovie]
Class="ScreenAttract"
Fallback="ScreenAttract"
NextScreen="ScreenLogo"

default.LUA in ScreenCompany background:

return Def.ActorFrame {

LoadActor( "konami" )..{
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0;decelerate,0.6;diffusealpha,1;sleep,5.2;accelerate,0.6;diffusealpha,0);
};

LoadActor( "bemani" )..{
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0;sleep,6.4;decelerate,0.6;diffusealpha,1;sleep,5.2;accelerate,0.6;diffusealpha,0);
};
}

From both /ScreenInit out/ and /ScreenCompany out/
return Def.ActorFrame {
InitCommand=cmd(sleep,0);
}

According the F3+F6 debugger, the sequence stays on ScreenCompany.

So: Why does it refuse to move on? Any and all knowledge appreciated.

Post #2 · Posted at 2014-06-12 05:10:28am 9.8 years ago

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


Last updated: 2014-06-12 05:31am
Quote: Musashi
From Metrics:

[ScreenCompany]
Class="ScreenAttract"
Fallback="ScreenAttract"
NextScreen="ScreenIntroMovie"
TimerSeconds=13

It's a matter of what falls back on what.

ScreenCompany is not defined in the _fallback theme, so next, SM5 looks for what you have set as your Fallback="". In your case, you have this custom screen set to fallback on ScreenAttract. Any metrics you don't specifically define under ScreenCompany, SM will look for under your ScreenAttract (if you have one), and then _fallback's ScreenAttract. I encourage you to check out the _fallback theme to see what sort of settings you are inheriting!

Anyway, to answer your question of why it's getting "stuck," it's a matter of what isn't defined in _fallback in this case. The metric you are looking for is ForceTimer=true. It isn't under _fallback's definition of ScreenAttract, so you're not automatically inheriting it. It's up to you to set it in your theme (or not). Does that make sense?

So, you could set ForceTimer=true on a screen-by-screen basis, or you could define your own ScreenAttract, and set ForceTimer=true underneath that, then all your attract screens would have a forced timer.

That metric (and other useful + relevant metrics) is described here: http://kki.ajworld.net/wiki/ScreenWithMenuElements

Quote: Musashi
From both /ScreenInit out/ and /ScreenCompany out/

return Def.ActorFrame {
InitCommand=cmd(sleep,0);
}

You aren't gaining anything from these files if the only command is to sleep for 0 seconds. Left like that, you're better deleting them for now.

Post #3 · Posted at 2014-06-13 11:01:21pm 9.8 years ago

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


Last updated: 2014-06-13 11:01pm
Precisely what it needed.

I'd been using other themes as reverse-engineering material. I noticed that many used ScreenAttract as a fallback, but didn't see that each that did also had to define ScreenAttract. Many thanks for this; I'll be back in my lab tonight to keep this theme going.

Next item, per the thread title change, is setting which font is used for each text situation. I've examined a few themes with different fonts, and different names for the screens, but ultimately I couldn't determine how font choices are controlled.

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

Offline AJ 187
AJ 187 Avatar Member
130 Posts
Not Set
Reg. 2008-10-14

"retired"
Font names are either:
1) Hardcoded in the program (most of the ones you'll be dealing with)
or
2) Decided by the themer (e.g. with a LoadFont)

depending on the screen and element used.

Post #5 · Posted at 2014-06-20 09:25:09pm 9.8 years ago

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


Last updated: 2014-06-20 09:25pm
Thanks!

It was in 'Graphics' where the particular LoadFont I needed to add was hiding.

Strange things here:

I was building my Select Style screen, trying to get the header and footer in. I had folders containing the needed LUAs and graphics. When I borrowed a folder from the default theme "ScreenWithMenuElements decorations", along with the metrics for the same, the header appeared, but the footer did not. I have ShowFooter=true and FooterX and FooterY commands set for my ScreenSelectStyle, along with a 'ScreenSelectStyle footer ' folder in Graphics, but it never appears. That is, until I renamed the footer to 'header'.

In any event, it looks like I can pull a work around by putting the header and footer code into the same LUA and calling it header, or having the header load the footer as an actor. Still, I thought the LUA from the default would allow me to use both folders, no?

Newest observation: Apparently ScreenSelectStyle Icon can be a LUA in the Graphics folder, but ScreenSelectPlayMode Icon has to be a folder or it won't work. Weird.

Post #6 · Posted at 2014-06-21 12:07:00am 9.8 years ago

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


Last updated: 2014-06-21 12:11am
StepMania 5's default theme loads its head and footer from /BGAnimations/ScreenWithMenuElements decorations/default.lua

Note that that particular file is in BGAnimations and that the header and footer are considered part of ScreenWithMenuElements. You can reference it here: https://github.com/stepmania/stepmania/blob/master/Themes/default/BGAnimations/ScreenWithMenuElements%20decorations/default.lua

The relevant portion of the Metrics can be referenced here: https://github.com/stepmania/stepmania/blob/master/Themes/default/metrics.ini#L572-L582

From there, it should be a matter of creating the appropriate "header" and "footer" files in /Graphics on Screens that fallback (in some way) on ScreenWithMenuElements.

For example:
/Graphics/ScreenNameEntryTraditional header.lua
/Graphics/ScreenPlayerOptions header.lua
/Graphics/ScreenGameplay footer.lua


Since your headers and footers are (probably) going to be the same across your various screens, you can create one file in /Graphics/ like

/Graphics/_header.lua
/Graphics/_footer.lua


and then make all the other headers and footers .redir files that just contain the text _header or _footer
For example:
Quote: /Graphics/ScreenGameplay footer.redir
_footer

That's what worked for me.

Post #7 · Posted at 2014-06-21 02:29:46am 9.8 years ago

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

I'll have to try that out.

My next question is about some functions.

According to my intel, GAMESTATE:GetCurrentStyle() is a usable function, but I can't find any clear examples of how its used. I believe it returns something like Single, Versus, or Double, but is the return phrased like that, or is it more like StyleType_OnePlayerOneSide (some of my searches revealed this). And what would that make Versus return?

Also: In the LUA to control graphics, could I use this function or others by typing

Condition=GAMESTATE:GetCurrentStyle()=="versus";

or will I need to use If Then Else statements?

When I ran the BGAnimation.ini files through the INI to LUA converter, any with Condition= statements produced a comment reading "--You will need the 3.9 conditionals lua module". Do I have to download it from somewhere?

Post #8 · Posted at 2014-06-21 02:35:37am 9.8 years ago

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

"I'm honestly pissed off."
GAMESTATE:GetCurrentStyle() returns a Style. Look at Docs/Luadoc/Lua.xml.

For conditions, just check the condition and don't create the actor if the condition isn't true.
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 #9 · Posted at 2014-06-21 02:45:55am 9.8 years ago

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


Last updated: 2014-06-21 03:07am
Quote: Musashi
When I ran the BGAnimation.ini files through the INI to LUA converter

What is "the ini to Lua converter?"

Post #10 · Posted at 2014-06-21 03:10:40am 9.8 years ago

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

Quote: Kyzentun
GAMESTATE:GetCurrentStyle() returns a Style. Look at Docs/Luadoc/Lua.xml.

For conditions, just check the condition and don't create the actor if the condition isn't true.

That is the goal; With some screens, I have graphics that should appear for Single play but not for Versus. Thus, I was seeing if there was a method that would check for the play style and either load or not load the actor accordingly.

Quote: dbk2
Quote: Musashi
When I ran the BGAnimation.ini files through the INI to LUA converter

What is "the ini to Lua converter?"

This: https://sites.google.com/site/stepmaniaapps/home/stepmania-ini-to-lua-conversor

Seems to generate usable code, but adjustments after are required. I took some notes about its limitations.

Post #11 · Posted at 2014-06-21 03:18:32am 9.8 years ago

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

"I'm honestly pissed off."
Quote: Musashi
Quote: Kyzentun
GAMESTATE:GetCurrentStyle() returns a Style. Look at Docs/Luadoc/Lua.xml.

For conditions, just check the condition and don't create the actor if the condition isn't true.

That is the goal; With some screens, I have graphics that should appear for Single play but not for Versus. Thus, I was seeing if there was a method that would check for the play style and either load or not load the actor accordingly.
If you just care about the number of players, GAMESTATE:GetNumPlayersEnabled().
if you want to do stuff based on the style, then read the entry for Style in Lua.xml and figure out which part has the info you need.

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 #12 · Posted at 2014-06-21 03:52:53am 9.8 years ago

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

Quote: Kyzentun
Quote: Musashi
Quote: Kyzentun
GAMESTATE:GetCurrentStyle() returns a Style. Look at Docs/Luadoc/Lua.xml.

For conditions, just check the condition and don't create the actor if the condition isn't true.

That is the goal; With some screens, I have graphics that should appear for Single play but not for Versus. Thus, I was seeing if there was a method that would check for the play style and either load or not load the actor accordingly.
If you just care about the number of players, GAMESTATE:GetNumPlayersEnabled().
if you want to do stuff based on the style, then read the entry for Style in Lua.xml and figure out which part has the info you need.

That LUA.xml is a huge help. I've been needing some documentation outside of simply digging through other themes.

And I can now confirm that, atleast for this screen, "Condition= <insert conditions here" does work with SM5.

Post #13 · Posted at 2014-06-21 03:56:30am 9.8 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
these conditions are very useful, and actually u can do a lot of stuffs using these condition, some of them works even using them from Metrics.ini

I have used them for make differences between the Style or the Gamemode for example... I think the most Condition I use is that one for make differents positions of the Actors depending of the Style or the Gametype.
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #14 · Posted at 2014-06-21 03:56:54am 9.8 years ago

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


Last updated: 2014-06-21 03:57am
Quote: Musashi
Condition=GAMESTATE:GetCurrentStyle()=="versus";

or will I need to use If Then Else statements?
In SM5 with it's lua files, you can do something like
Quote: lua

if GAMESTATE:GetCurrentStyle():GetStyleType() == "StyleType_TwoPlayersTwoSides" then
t[#t+1] = LoadFont("Common Normal").. { Text="I know what I'm doing" }
end

The old "Condition=<true or false>" is obsolete.

Post #15 · Posted at 2014-06-21 03:59:15am 9.8 years ago

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

"I'm honestly pissed off."
Quote: Mad Matt
Quote: Musashi
Condition=GAMESTATE:GetCurrentStyle()=="versus";

or will I need to use If Then Else statements?
In SM5 with it's lua files, you can do something like
Quote: lua

if GAMESTATE:GetCurrentStyle():GetStyleType() == "StyleType_TwoPlayersTwoSides" then
t[#t+1] = LoadFont("Common Normal").. { Text="I'm not Horsey" }
end
The old "Condition=<true or false>" is obsolete.
Matt's example is the way you should do things in SM5.
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 #16 · Posted at 2014-06-21 04:02:08am 9.8 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
If im not wrong, I have seen the Condition=GAMESTATE:IsCourseMode() for example in some luas... I cannt remember but the way of Mad Matt's is the best way of do that in Lua on SM5.
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #17 · Posted at 2014-06-24 02:29:25am 9.8 years ago

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

Going back to setting fonts: Will any font I intend to use require a LUA using a LoadFont or a GetPathF statement, or can some screens have a font applied by placing an appropriately named image file and INI file in the Fonts folder?

I'm looking to set the fonts for the Options Screens, but I can't seem to determine how the other Themes are doing it.

Post #18 · Posted at 2014-06-24 03:31:29am 9.8 years ago

Offline Th3_Ov3rHell_3XoduZ
Th3_Ov3rHell_3XoduZ Avatar Member
313 Posts
Chile
Reg. 2012-09-13

"ITG, The Best Dance Machine!"
Maybe I am speaking something diferent, in my case, When I am editing a LUA, this requires a LoadFont for call a determinate font stored on the same called folder.

Other point is, some "items" exist in your Font Folder that are not specifically Fonts, for example... in my Themes, exist a file called "TextBanner text.redir". The element "TextBanner text" is a hardcoded item that is related to the Text of the items on the MusicWheel.

- Always u gonna call a Font via LUA, requires the LoadFont... Beacuse as I know, only some hardcoded elements as a name on the Fonts Folder must exist with that name. In my case, If I delete that file "TextBanner text" the Stepmania gonna show me a error... Because that element doesn't exist.

- But, for example... If I make a new font called "_Dungeon 25px (doubleres)". The Theme by itself wont know for what that font must be used until you do. How? Calling it, by LUA using the LoadFont or Redirecting it to a particular file on your Fonts Folder. Something very useful is make global Fonts and then use .redir files to redirect all of them to the same Font instead make a copy of the same font just for differents elements.

I hope it works something for you.

PD: Sorry, my english is not good enough, Im Chilean XD
Quote: Released Themes for SM5 Beta 3
Quote: Released Themes for SM5 Beta 4 & 5.0.7
Quote: Simfles Packs Released

Post #19 · Posted at 2014-06-24 04:10:22am 9.8 years ago

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

Quote: Musashi
I'm looking to set the fonts for the Options Screens, but I can't seem to determine how the other Themes are doing it.

As usual, check to see how _fallback theme does it. With options screens (like ScreenPlayerOptions, ScreenOptionsService, etc.), each row is an OptionRow*. If you look into _fallback/Fonts/, you'll see that there are the following .redir files:

OptionRow item.redir
OptionRow title.redir

An OptionRow typically has one title and multiple items. The "title" of each row indicates what sort of row it is; each "item" is one of the available options. (Let me know if that doesn't make sense; I'll post a screenshot explaining it better.)

In the _fallback theme, each of those redir files points the theme to the Common Normal font.

Now, if you wanted to have different fonts for different "options" screens... well, I've never actually done that (!), but I suspect you would do something like...

/Fonts/ScreenPlayerOptions OptionRow item.redir
/Fonts/ScreenOptionsService OptionRow title.redir

...but I haven't had a reason to test that. If you want to achieve that in your theme and my suggestion doesn't work, post here, and I"ll actually attempt to figure it out.

Post #20 · Posted at 2014-06-25 02:34:51am 9.8 years ago

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

I got some of the fonts going where I wanted them.

Strange things are still happening with decorations.

I put this oft-used code into both BGAnimations\ScreenWithMenuElements decorations\default.lua and C:\Games\StepMania 5\Themes\EXP\BGAnimations\ScreenSelectMusic decorations\default.lua

local t = Def.ActorFrame {};
t[#t+1] = StandardDecorationFromFileOptional("Header","Header");
t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer");
t[#t+1] = StandardDecorationFromFileOptional( "Help", "Help" );

t[#t+1] = Def.ActorFrame {

LoadActor( "Testpic" )..{
OnCommand=cmd(Center);
OffCommand=cmd(diffusealpha,0);

};
}

return t

I added t[#t+1] = StandardDecorationFromFileOptional( "GrooveRadar", "GrooveRadar" ); to ScreenSelectMusic decorations/default.lua

The testpic was used to see if Stepmania was loading the file or not. ScreenWithMenuElements appeared to be using it just fine; I saw the test picture on several screens.

With ScreenSelectMusic, the test picture only appeared when I disabled the rest of the t[#t+1] statements using --[[ --]] . Why would this be?
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-04-19 23:35:17
This page took 0.015 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language