[quote=riskofsoundingnerdy]Hey, thanks for noting all these errors. I did find them in the logs file but I couldn't find any way around them and they didn't seem to be causing any dysfunction. I haven't had any functional problems when building the theme at all, could that be something to do with my settings? Also, I was wondering if you could help me out with fixing these errors because, to be honest, I don't know a whole lot about coding. Any help would be greatly appreciated.[/quote] Basically, every one of those errors means that some part of your theme is not doing what you intend because there is a mistake in the code for that element. If you didn't notice any problems, you don't know enough about the code in your theme to know what any part of it is doing and notice when things don't show up the way they should. This is what happens when you copy code from another theme without first understanding it. A useful thing to know is that you can reload the current screen by holding F3 for the Debug Menu, hitting F6 for the Theme Debug Menu, and then hitting 2 to reload the screen. Try it after each of these fixes, so you can edit while stepmania is running. Additionally, if you build SM5 from source, tell me, and I can help you get the build that I'm using, which has on screen error reporting (and many fixes that prevent crashing on theme mistakes). Here's an explanation of a couple of the errors. The error message tells you the file and line number that the mistake was detected on. Let's start with this one: [quote]105:12.951: WARNING: Error playing command: /Themes/DDR Next Generation/Graphics/MusicWheelItem Song NormalPart/default.lua:129: attempt to index local 'param' (a nil value)[/quote] This means that when trying to execute the code on line 129 of "Graphics/MusicWheelItem Song NormalPart/default.lua", the variable "param" is nil (has no value), and the code tries to index into param as if it were a table. Since param is nil (not a table), indexing into it fails and generates an error. The cause of this problem is that you called the SetCommand from inside the InitCommand with 'playcommand,"Set";'. You should not do that because SetCommand requires a valid param to be passed, and you cannot pass it a valid param with the information it needs from inside the InitCommand. So remove the 'playcommand,"Set";' part from the InitCommand, and that error no longer occurs. Next up is this one: [quote]105:18.199: WARNING: Error playing command: /Themes/DDR Next Generation/Graphics/MusicWheelItem Song NormalPart/default.lua:170: attempt to index global 'param' (a nil value)[/quote] A very similar mistake. In this case, "param" doesn't exist at all. This is inside the BeginCommand function, which is only passed a "self" argument, and no "param". Since the code is trying to use "param.CustomDifficulty", it probably expected to be passed the difficulty that the actor is being created to show the status of. Since it's inside a loop that goes through the difficulties, it doesn't actually need to be passed that parameter, and we can just use the "diff" variable from the loop so the actor knows what difficulty it's displaying the status of. So "param.CustomDifficulty" becomes "diff", and when the screen is reloaded, we now see some rectangles on each song on the wheel, for each difficulty of chart the song has. Next: [quote]122:02.425: WARNING: Error playing command: /Themes/DDR Next Generation/BGAnimations/ScreenSelectMusic decorations/HSL.lua:846: attempt to index local 'StepsOrTrail' (a nil value)[/quote] Once again, indexing a nil value. The player doesn't always have Steps set, and the current Song isn't always set, but in this code you're assuming both. Add a piece of code to check whether either is nil before using them, and hide the thing and skip the rest of the SetCommand function if either is nil. Things that are nil are considered false when evaluating if statements, so we check by doing something like "if not foo then (code) end", and the code inside that if block (between "then" and "end") only executes if "foo" is nil. So right after SongOrCourse and StepsOrTrail are set, we add this code: [quote] if not SongOrCourse or not StepsOrTrail then self:diffusealpha(0) return end [/quote] Every SetCommand in this file that has a "SongOrCourse" variable has this mistake. Fix them all, and that's a host of errors gone. As an aside, having 15 sections of code that are all almost identical is a sign that whoever wrote the code needs to learn how to use a loop. Using loops to generate things that are nearly identical saves a lot of effort. Onward: [quote]141:22.466: WARNING: Error playing command: /Themes/DDR Next Generation/Graphics/MusicWheelItem Sort ColorPart/default.lua:14: attempt to call method 'zoom_to_banner' (a nil value)[/quote] The "zoom_to_banner" function does not exist, so trying to call it causes an error. I don't know what you intended that code to do, and if you don't know what it's intended to do either, delete it. So just remove that line. Progress: [quote]148:52.625: WARNING: Error playing command: /Themes/DDR Next Generation/Graphics/MusicWheelItem Song NormalPart/default.lua:12: attempt to index local 'song' (a nil value)[/quote] Once again, assuming that the command passed in a song. Since this is for the "Song NormalPart" part of a "MusicWheelItem", that seems a natural assumption, but apparently it's not always set. Once again, if there's no song, there's probably nothing to do, so check whether it's nil, and simply return immediately if it is. [quote] if not song then return end[/quote] And that error is gone. The next error is a bit more complex: [quote]154:27.377: WARNING: Error playing command: /Themes/_fallback/Scripts/01 base.lua:41: attempt to index upvalue 't' (a boolean value) 154:27.377: WARNING: /Themes/_fallback/Scripts/01 base.lua:41: (for generator)((*temporary) = (null),(*temporary) = 1,(*temporary) = attempt to index upvalue 't' (a boolean value)) 154:27.377: WARNING: /Themes/DDR Next Generation/Graphics/ScreenSelectMusic GrooveRadarP2.lua:41: unknown(self = (null),(for generator) = (null),(for state) = (null),(for control) = (null))[/quote] The first line of this error points us to a file in _fallback. But that's the _fallback theme, not yours, so the error is certainly not in that file. The second line of the error tells us more about what went wrong in that function in the _fallback theme. The third line of the error tells us what part of your theme called that function and caused the problem. It's "Graphics/ScreenSelectMusic GrooveRadarP2.lua", line 41. We look at that line and see "for pn in ivalues(GAMESTATE:IsHumanPlayer(PLAYER_2)) do". Now, "ivalues" is a special function that is supposed to help a for loop iterate over a table. So you have to pass ivalues a table to work with. "IsHumanPlayer" is a function that checks whether the given player is human, and returns a boolean value. The code then takes this boolean and passes it to ivalues. A boolean value is not a table, so ivalues throws an error. So you think to change "IsHumanPlayer" to some function that returns a table and everything will work right? Wrong. Let's look a bit more closely at what the code is doing. It's expecting to get PlayerNumber values from ivalues, and passing them to the radarSet function. We can guess this because it uses the variable name "pn", which is a pretty common abbreviation for PlayerNumber when naming variables. Next, we check what radarSet does with the PlayerNumber it gets passed. radarSet passes the PlayerNumber (now in the variable named "player") to two functions of self (which is a GrooveRadar). But this is the "GrooveRadarP2" file, and everything is hard coded to PLAYER_2, so why does the code pass around this useless PlayerNumber value instead of just using PLAYER_2? Moreover, passing PLAYER_1 (the other possible value for a PlayerNumber) to SetFromRadarValues wouldn't make sense, because then it would set the wrong part of the GrooveRadar. The solution is thus: 1. Remove "player" from the args to radarSet, because it serves no purpose. 2. Replace the uses of "player" inside radarSet with "PLAYER_2" 3. Get rid of the useless for loop that originally drew attention to this problem. 4. In fact, get rid of everything in the CurrentSongChangedMessageCommand function, and just set that function and the others to point to radarSet, because radarSet does exactly what they should do. Since this code is a bit more changed, I've pasted it on codepad. http://codepad.org/Q7B3V7tj You'll notice that I've removed a lot of the semicolons. This is because this is Lua, not C or C++, or any other language where every statement needs a semicolon. Except for inside gamecommands and places that use cmd, semicolons are useless. However, note that elements of a table are separated by commas. It's technically valid to use either semicolons or commas to separate table elements, but I prefer commas. If you didn't know before, the arguments to all the Def.(thing) actor classes are tables, and that's why the parts have to be separated by commas or semicolons. SelectMusic is almost usable now, we can scroll between songs without errors occurring. But, scroll onto a folder, and we see a bunch appear. [quote]182:40.490: WARNING: Error playing command: /Themes/DDR Next Generation/BGAnimations/ScreenSelectMusic decorations/default.lua:439: attempt to index local 'song' (a nil value)[/quote] When the music wheel is on a group, there is no current song, so GetCurrentSong returns nil. So when the code goes to initialize "group", it runs into an error. Initializing "group" serves no purpose, and indeed, "group" is completely unused, so remove that line and the error is fixed. Of course, calling "song:GetGroupName" 18 times is somewhat inefficient, it would be so much more efficient if you could just save the result of that call somehow, and reuse it..... Or you could replace the block inside "if song then" with this: http://codepad.org/d6fesnjn This creates a table named "group_colors" with all the colors you had for groups, indexed by the name of the group. After creating the table, it uses it to set "color_str", using "song:GetGroupName()" as the index. So if "song:GetGroupName()" returns "Next Generation", it pulls that entry out of the table and sets color_str to it. If it doesn't find an entry in the table, then "group_colors[song:GetGroupName()]" comes up nil. Now after it I have 'or "#FFFFFF"'. The "or" logical operator returns its second operand if its first operand is nil. So when the first half comes up nil, "color_str" is set to "#FFFFFF". "color_str" is then used to set the diffusebottomedge color exactly as was done with the colors before. Another more complex error: [quote]208:28.976: WARNING: Error playing command: /Themes/DDR Next Generation/BGAnimations/ScreenSelectMusic decorations/scores.lua:28: attempt to index local 'song' (a nil value) 208:28.976: WARNING: /Themes/DDR Next Generation/BGAnimations/ScreenSelectMusic decorations/scores.lua:28: GetFlexDifListY(d = Difficulty_Easy,st = StepsType_Dance_Single,song = (null),r = 0,b = 0,(*temporary) = (null),(*temporary) = (null),(*temporary) = (null),(*temporary) = (null),(*temporary) = attempt to index local 'song' (a nil value)) 208:28.976: WARNING: /Themes/DDR Next Generation/BGAnimations/ScreenSelectMusic decorations/scores.lua:201: unknown(self = (null),st = StepsType_Dance_Single,song = (null),(*temporary) = (null),(*temporary) = (null))[/quote] Once again, the actual source of the problem lies a couple steps up the chain from the line that is initially reported. So we dig a bit and see that we just need to make sure "song" isn't nil before using it. [quote]GetDifListX(self,pn,170,0); self:y(GetFlexDifListY(diff, st, song)-3); if song:HasStepsTypeAndDifficulty(st,diff) then[/quote] Becomes [quote]if song and song:HasStepsTypeAndDifficulty(st,diff) then GetDifListX(self,pn,170,0); self:y(GetFlexDifListY(diff, st, song)-3);[/quote] and it's fixed. This same mistake occurs in two other places in this same file. Next error finds us back in HSL.lua: [quote]212:53.356: WARNING: Error playing command: /Themes/DDR Next Generation/BGAnimations/ScreenSelectMusic decorations/HSL.lua:1191: attempt to index local 'song' (a nil value)[/quote] Change "if song:HasStepsTypeAndDifficulty" to "if song and song:HasStepsType", and song is checked before being used, and that error is gone. Except, song is also getting passed to GetFlexDifListY, so that has to be moved inside the if block. If you had used a loop, there would be a lot less than 15 places to fix this mistake. And finally, we can scroll the music wheel without a flood of errors. Yay!