Tappy Chicken score system for multiple maps?
Ive just implemented a 'best time' and 'best score' counters which save in my game just like how its done in the Tappy chicken game. My problem here is when using more levels, i know i can make more variables in the save game BP for each level but how can i check which map is loaded so those certain variables are used and saved? Is there a way of creating a branch to check which level is loaded? as at the moment that's the only way i could think of doing it.
Hopefully I'm clear on what i mean but if not give me a shout :D any thoughts on how to do this would be cool :)
asked Aug 16 '14 at 09:37 PM in Blueprint Scripting
Sorry for the slow reply, just saw this. Here's what I've got:
1. Save game variables - I'm using the BestTime and BestTimeArray floats and BestTimeString and BestTimeStringArray variables in my HUD which is where I do all of the Save/Load functionality. The reason for a float and a string is to give me a more streamlined visual of the actual time that only has 2 decimal points.
2. OnBeginPlay - I'm running through to see if the save game already exists and if not, creating one. In there I set the arrays based on the solo string and float defaults. The LevelInt is just an int that I cast to HUD in each level's level BP and set to the level number. This gives me the index that's then used for each level to save a best time. I can also use that to decide what level to load on death or level completion (shown below)
Let me know if you need any additional info on anything. Hope this helps.
answered Aug 19 '14 at 07:08 PM
Ok so i made some progress on this, from the Level BP i just fired a custom event (Each level has its own custom event) from event begin play that goes to my BP with all my save stuff in which turns a branch on and then i just copy stuff for each level that i have. So it works but its a bit crazy the amount of stuff ill have to copy for each map (And end up with one crazy BP). If anyone suggests anything better just lemme know! ...or if anyone wants to see how i set it up i can upload screenshots :)
answered Aug 17 '14 at 06:08 PM
What I did, just saving a 'best time' float, was use an array. In each level, I set an Int in my HUD that then I used as the Index for the array. This way, you don't have much to do each level and the logic (at least for my setup) is in one place that's always loaded (HUD).
PM if you want to see how I have it set up.
answered Aug 17 '14 at 07:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here