Post #1 · Posted at 2016-09-07 04:33:48am 7.6 years ago
leadbman | |
---|---|
Member | |
263 Posts | |
Reg. 2016-02-01 | |
"Working On: 5thMix BGA bgchanges" |
Hi everyone,
Now that I've sorted out the base of my theme I'm looking into creating an unlock system like I had back in SM3.9. I've read a few forum posts but they're not doing what I'd like. I'm wanting to make unlocks happen after a specific number of songs have been cleared on the profile.
My code in my metrics.ini is the following:
In terms of SM5's code these are the applicable pages on Github:
https://github.com/stepmania/stepmania/blob/master/src/UnlockManager.cpp
https://github.com/stepmania/stepmania/blob/master/src/UnlockManager.h
There's also this thread on Stepmania's site that shows how to use unlock codes to open songs, but I'd much prefer to have them just unlock through play:
http://www.stepmania.com/forums/general-stepmania/show/510
I believe my syntax must just be a bit wrong - I think it might be the require part. The song DOES lock, however it never unlocks. My theme settings have the unlock system turned on - when I turn it off, the songs are visible so the system is working.
Any help would be fantastic, thanks in advance!
Now that I've sorted out the base of my theme I'm looking into creating an unlock system like I had back in SM3.9. I've read a few forum posts but they're not doing what I'd like. I'm wanting to make unlocks happen after a specific number of songs have been cleared on the profile.
My code in my metrics.ini is the following:
Quote
[UnlockManager]
AutoLockChallengeSteps=false
UnlockNames="1"
Unlock1Command=song,"Dance Dance Revolution 1st Mix/BUTTERFLY";require,"UnlockRequirement_StagesCleared",5
AutoLockChallengeSteps=false
UnlockNames="1"
Unlock1Command=song,"Dance Dance Revolution 1st Mix/BUTTERFLY";require,"UnlockRequirement_StagesCleared",5
In terms of SM5's code these are the applicable pages on Github:
https://github.com/stepmania/stepmania/blob/master/src/UnlockManager.cpp
https://github.com/stepmania/stepmania/blob/master/src/UnlockManager.h
There's also this thread on Stepmania's site that shows how to use unlock codes to open songs, but I'd much prefer to have them just unlock through play:
http://www.stepmania.com/forums/general-stepmania/show/510
I believe my syntax must just be a bit wrong - I think it might be the require part. The song DOES lock, however it never unlocks. My theme settings have the unlock system turned on - when I turn it off, the songs are visible so the system is working.
Any help would be fantastic, thanks in advance!
Post #2 · Posted at 2016-10-23 06:23:43am 7.5 years ago
SaikioM | |
---|---|
Member | |
30 Posts | |
Not Set | |
Reg. 2015-04-20 | |
I got the same problem with a project I'm working on but at least the Extra Stage 1 locks propertly.
Post #3 · Posted at 2016-10-24 03:50:55am 7.5 years ago
Your metrics are okay. I decided to unlock the songs using a small amount of Lua. This was as good as I could come up with: http://pastebin.com/3qv7QYqs
It works, but there are some things to note:
1. This solution uses some (minimal) Lua.
2. You'll need to add that Lua to your ./BGAnimations/ScreenSelectMusic overlay.lua
3. This solution uses UNLOCKMAN:GetUnlockEntryIndexToCelebrate(), which uses the MachineProfile. The MachineProfile probably has a lot of StagesCleared associated with it (my MachineProfile had 810 when I started). But maybe not. I included some debug code to help you determine what the StagesCleared value for your MachineProfile is.
4. This solution does not work with a player profile. I'm not sure, at this time, how to do that without using a lot more Lua which you don't seem interested in doing.
5. As I note in the code comments: while testing, you may want to re-lock certain things. You can do so by quitting StepMania, opening your Stats.xml, searching for Unlocks, deleting the appropriate UnlockEntry element by UnlockEntryID, and restarting StepMania.
I hope this helps some. Ask if you have any questions.
It works, but there are some things to note:
1. This solution uses some (minimal) Lua.
2. You'll need to add that Lua to your ./BGAnimations/ScreenSelectMusic overlay.lua
3. This solution uses UNLOCKMAN:GetUnlockEntryIndexToCelebrate(), which uses the MachineProfile. The MachineProfile probably has a lot of StagesCleared associated with it (my MachineProfile had 810 when I started). But maybe not. I included some debug code to help you determine what the StagesCleared value for your MachineProfile is.
4. This solution does not work with a player profile. I'm not sure, at this time, how to do that without using a lot more Lua which you don't seem interested in doing.
5. As I note in the code comments: while testing, you may want to re-lock certain things. You can do so by quitting StepMania, opening your Stats.xml, searching for Unlocks, deleting the appropriate UnlockEntry element by UnlockEntryID, and restarting StepMania.
I hope this helps some. Ask if you have any questions.
Post #4 · Posted at 2016-10-24 12:46:03pm 7.5 years ago
leadbman | |
---|---|
Member | |
263 Posts | |
Reg. 2016-02-01 | |
"Working On: 5thMix BGA bgchanges" |
Thanks mate! I'll give that a shot when I get a chance. In terms of the player profiles, I think we could just adjust the code to read the profiles unlock line for some reason RhythmArcade is down for me so I can't check the wiki of Lua commands right now - I think there was one to purely access profile data. I don't mind doing more advanced Lua work - I've been getting better with it over time. I just wish that the 3.9 unlock system had ported over smoothly haha. It makes sense that it wasn't a priority though, as not many people would be wanting to do an unlock system.
Thanks again, I'll let you know how I go!
Thanks again, I'll let you know how I go!