This is not a consistent problem or even a development-breaking one, but sometimes when I’m playing through my project, I go to check on my stats and when I return to the game, it resets to the beginning of the scene file. It usually seems to vanish if I poke at the code for a while but I haven’t yet pinned down exactly what bug I’m introducing that is causing this. Does anybody know?
I’ve also had this problem in the past, though no time recently. I never did figure out exactly what was going with it.
I had this happen a lot. Someone suggested that I may have edited a scene file and saved it, causing a reset of the scene, I was never able to confirm this, but it did always happen when returning from my stats.
@Lucid, Yea, I noticed just about every time I saved what I was working on while testing that it tended to reset me to the start.
I can confirm that isn’t the case.
My current theory is that it has something to do with indentation. Nothing that pings quicktest or randomtest, but in combing through the file later I definitely found at least one case of a code block being indented out of pattern.
I would think that if that were the case, a playthrough would result in “increasing indent not allowed” would pop-up. (Unless it’s the inverse, decreasing indent.)
This really does sound like the Save-Restart kink as mentioned above by Lucid and Reaperoa, at least to me it does. I use it to ‘Edit-as-I-Play’, especially when dealing with slightly less conventional ideas.
Well, there’s definitely indent differences and it definitely doesn’t result in ‘increasing indent not allowed’, perhaps because it’s consistent within the block. I’m also relatively sure I didn’t edit-as-I-tested, but next time it occurs, I’ll keep a eye out for it.
For the record, I have only heard of this problem, but never seen it with my own eyes. If somebody can figure out a way to reliably reproduce the problem, I can probably fix it.
I don’t believe that there’s anything to do with a save feature added seeing as I’ve had this happen but I have never before even attempted to implement a save feature in anything I’ve made.
We’re talking about saving changes you’ve made to a file whilst running through a testplay.
@dfabulich Tested in Firefox on the newest build.
- Open up the index to play (I did this locally, don’t know how it would be affected over an internet connection) and open the txt of the starting scene (I stayed in the starting scene while testing, I doubt this will work if you alter a scene you’re not currently looking at).
- Click Next.
- Alter something in the txt, then save (I don’t think it matters, but I always altered something that would so up when the game returned from the stats screen).
- Click “Show Stats”, then “Return to game”
It should dump you back to the start of the game. It worked for me 100% of the time on testing it.
That said it’s not something really worth much effort fixing IMO (unless it’s something minor) as it can just be circumvented by not saving while testing.
^ Also circumvented by not checking your stats.
@Reaperoa, Does it send you back to the beginning of the game? I end up at the beginning of the scene.
Either way, I agree that it’s no big deal to fix. I doubt it would affect the players’ gameplay seeing as they can’t change the .txt.
@Caddmuss I don’t know whether or not it sent me to the start of the scene or game, as I only tested it in the first scene.
Oh yeah, I can confirm that, dropbox-wise at least, it might affect gameplay if you edit while someone’s playing. It happened while I was playing one of the WIPs.
It is by design that the current scene resets if someone changes it while you’re playing. (If it’s the first scene of the game, then that will restart the game.)
But I’ve also heard of it happening during play when nobody’s changing the text. If anybody can repro THAT, that’s an area I’m interested in reproducing.
I had this problem once, but instead it reset the whole game, not just one scene. But after that, it never happened. I’m confused… @-)
I am reviving this topic because I’m having this problem with my WIP. Without anyone simultaneously editing scenes and with the newest version of choicescript from github (pulled today just to make sure), I am occasionally getting kicked back to the beginning of startup.txt.
Sadly, I can’t isolate this to uses of *rand or any other command. I don’t notice that it’s resetting variables. I’m not much a programmer, so I apologize in advance if I’m making an obvious mistake here. If anyone with some experience wants to reproduce it, I’d love to PM the link to the WIP. (Didn’t want to hang it out for all to see as we’re in limited beta testing right now.)
First, try compiling it before testing (this whole topic predates the compiler). If the game is still occasionally kicking you back to the start (and especially if you can get it to do so regularly), then it’s something super weird, but if not, we can at least be fairly certain it’s probably something touching your txts while the game’s running.
As for what might actually be causing it, well that depends on how your text editor saves (or what else might be shifting around your txts). (I know my habit of ctrl+sing every time I tab from notepad++ has lead to some minor annoyances.)
As for the second link you posted, don’t alter stats in the stats screen. It simply doesn’t work by design.
Thanks! I have no stats changing in stat screens, so that isn’t the problem. I hadn’t used the compiler at all, and did just now. While none of my txts were open, I was sent back to the beginning of startup.txt by clicking Show Stats. It didn’t happen every time I clicked it, but it happened multiple times.
@Reaperoa, just wanted to know if you had any idea why this is happening (in the above post, where I’m still getting kicked back to the beginning). I’m using notepad to edit my .txts.