Scripts / Continue from last map played

Author
Message
Medmatheus
Reviewed GameGuru on Steam
9
Years of Service
User Offline
Joined: 18th Oct 2015
Location:
Posted: 4th Feb 2019 16:26
Hey guys,

When I click "Start" on standalone main menu I usually appear on 1st level of project.

My question is: Is it possible to appear on the last map played clicking on Start? I'm asking this because I'm saving some counter (like coins i.e) and if the player returns to first map he can keep getting coins, restarting, then getting coins, because my game save/load doesnt affect counters. My counters are stored in a text doc and everytime a player get it, it write +1.

Thanks
iiDenTiiTy
5
Years of Service
User Offline
Joined: 22nd Mar 2019
Location:
Posted: 23rd Mar 2019 00:39
I'm not sure of this. But wouldn't it be better trying to link up the saving and counters in some way? Maybe post some of the code to get a better idea of what the problem is.

A simple fix might be by using LevelFilename, haven't used/tested it, but i would imagine the output is the name of the current level. So..


and reset the counters in the text doc.

I'm new to this so take it with a pinch of salt.

This fix has issues with it I am noticing now, such as if a player loads a save file on level 1 the counters will also reset I think. And it can still be abused on later levels with save files. But I'm still gonna post this as it is a place to start at least.
PM

Login to post a reply

Server time is: 2024-12-22 14:25:51
Your offset time is: 2024-12-22 14:25:51