Forums » Themes » General Theme Related Technical Questions

1
I'm recently getting into SM5 theming, coming from a solid background in SM3.95/oITG theming

I'll just add a list:

-What's the difference between event mode and free play? Event mode just doesn't count the stage numbers?
-How can I force layers to display over others when normally the hierarchy would have a different result? SM3.95 had draworder, but it was either broken or worked completely unintuitively. Can I use draworder to force one actorframe on top of all others? (Ex: I want to make a transition screen completely on top of all other layers so that I can do a seamless fade animation between screens)
-In SM3.95 it wasn't possible to animate ScreenSystemLayer in between screens for a transition, is it possible to animate these per-screen in SM5?
-Where can I find a detailed outline of the SM5 APIs? It'd also be really nice to get a syntax guide as well, because I'm forgetting commas and whatnot unknowingly because it's not inherently obvious coming from the XML landscape of 3.9 .
-It is my understanding that key events has been overhauled in SM5; what is the API MessageCommand to execute a command based on the button states of various buttons? (when the select button is in a down state do 'x')

Last edited: 11 February 2015 5:45pm

Reply
For those that aren't familiar Horsey is in favor of people using credit codes to play for free on arcade machines that they don't own. This robs the arcade of money, they get pissed and shut the machine down, and that's one less arcade people can play at. That is not the kind of thing I want anyone to do in any Stepmania theme.
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
I have my own pads at home now, plus I couldn't be bothered to figure out how to add SM5 to the local machine. This is for my, and friendly personal use. My questions have nothing to do with credit codes. I'd really appreciate staying on topic.
Reply
1. Free Play is equivalent to turning on Free Play on an arcade machine, you still have stages and the game ends after you finish them but you don't have to pay credits. In Event Mode, the game won't end unless the player explicitly does so by backing out of ScreenSelectWhatever. Event Mode also forces the game to be in Free mode if it was in Coin mode. Themes can override these behaviors to some extent in the SM4/5 world, hence ITG PS2's bug where the game ends if you fail even in Event Mode.

2. Afaik draworder works pretty well, in any case I think SM5 will draw the last actor in an ActorFrame on top.

3. I'm not sure what you want. If you mean you want something to keep animating the whole time during a transition, you can't. Loading always halts all animations.

4. http://kki.ajworld.net/lua/sm5git/Lua.xml is a list of Lua functions. The rest of it is literally bog-standard Lua 5.1 minus cmd() which is optional and should be pretty obvious, given that it's just supposed to look like the old Command syntax. cmd() can get confusing pretty quickly because it's not actually a function, so really try not to use it except for defining actor commands. Programming in Lua is a nice guide for using Lua; the lua-users wiki is also helpful.

Def can be kind of confusing because it uses metatable tricks in an effort to make actor tree creation feel more like writing some kind of markup than Lua. Def.Whatever{} is syntactic sugar for Def.Whatever({}). Also, Def tables support the .. operator, unlike normal tables, but these aren't things that were hacked into StepMania. They're implemented in Lua (_fallback/01 ActorDef.lua) in an effort to make actor definitions prettier. Defs are not actors, they're just tables.

To attach any commands to LoadActor(), you MUST use LoadActor("blah")..{}, this is because LoadActor returns a Def table that you then merge the commands into.

If you have more specific questions, just ask.

5. Alright, you've got options here. One of them is the old system, where you add codes to a screen, and if you know how to add a revenue-drain code you know how to do that. CodeMessageCommand allows you to respond to those.

The other is Screen:AddInputCallback(). This function takes as an argument one function that then acts as a reasonably powerful input processor. What that function must do is described in the Screen class section of the Lua function list above. To get the current screen, use SCREENMAN:GetTopScreen().

As far as I know, codes should be enough for most cases, but when you need to override some of SM's own behavior this gives you all the flexibility you could want.

Last edited: 13 February 2015 10:14am

Reply
I have an unrelated question and a related question for now:

How to I configure USBs for loading songs and whatnot in SM5? None of the 3.95 preferences are available in the source code for SM5 (they were radically changed, or I'm just not finding them?). I looked through the options menu and couldn't find any option to enable or disable memory cards. --It's not in the OP menu as far as I can tell; you have to edit preferences.ini

Here's a specific question about LUA:

some theme lua files begin with local t = Def.XXXX, and others begin with t[#t+1] = Def.XXX, others return Def.XXX what's the difference between both methods? It looks like a bunch of different ways to do the same thing.

Last edited: 13 February 2015 3:53pm

Reply
1. Those Prefs are more or less the same, except for the ones that weren't in 3.95.

2. It's just a Lua thing. There's more than one way to return a table.

Last edited: 13 February 2015 3:06pm

Reply
Here's a specific question about LUA:

some theme lua files begin with local t = Def.XXXX, and others begin with t[#t+1] = Def.XXX, others return Def.XXX what's the difference between both methods? It looks like a bunch of different ways to do the same thing.

This would make sense if you would spend even a single hour on lua.org reading the manual or the Programming in Lua book. Then you'd understand at least some of the language. Seriously, go learn lua, it's easier than French or English, and it makes a world of difference to be able to understand the code instead of treating it as gibberish.
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply