silktie Posted March 8, 2015 Share Posted March 8, 2015 I've found a curious quirk in the gameplay logic and am wondering the best way to work around it I've got a few variables floating around modmain.lua, which operate and are called just fine when playing. Let's say like this:example = Class(function(self, inst) self.powerLevel = 9000 self.cake = falseend)As the game progresses, these get updated (which is important) However, the challenge is that I'd like these variables to be carried over when a player enters a cave (as, for all intents and purposes, it's continuing the same game) The problem I've found though is that caves are treated as a new game in itself (it loads/saves a completely different save file) - As such, all of my variables get reset when I enter one Is there a way I can carry them over? My only guess is that I have to attach them to the player (whose data gets transferred between the 2) - If so, how do I go about this? Both to save the variables and retrieve them later on Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.