First choice only shows up after leaving the stats screen


#1

Hey everyone, I’m new here. I’ve got a minor problem I’m hoping someone can assist me with. I’ve written a little bit, but ran into a minor annoyance. After the page break, I have two small sentences that should have three choices beneath them. Every time I test it out though, there aren’t any choices. If I go into my stats screen and leave it again the choices suddenly appear.

So, here’s the code. This is like the first stuff I’ve written. I’m not too sure what I’m doing wrong. I know my indents are correct, it would have given an error otherwise…right?

Blahblahblahblahblah blah blah blahblah blah blah blah blah blahblah blah blah blah blah blahblah blah blah.

Blah blah blahblah blah blah blah blah blahblah blah blah blah bla,h blahblah blah blah blah blah blahblah blah blah blah blah blahblah blah blah


*page_break

You hear voices and footsteps echoing from behind the door. You don't have a lot of time left, what are you going to do?

*choice
	#Try and budge out of your restraints
		You use all your strength to try and break free, but the cuffs are too sturdy.
		*goto aa
	#Cry for help
		"Help! Can anyone hear me?! Help!" you yell, but to no avail.
		*goto aa
	#Study the room for anything you might be able to use to escape
		You scan the room, but you can't find anything that could possibly help you in this situation.
		*goto aa

Thanks for your help.


#2

Can you show us exactly how it’s written? Use < pre > and </ pre > but without the spaces.


#3

Hm, well, without a *rand going to and from the stats screen should always produce an identical page.

Did you first look at the page before you included the choice, or altered the choice while you were on the stats page? Other than that, I can’t think of any ideas. As it stands though, the code looks like it should work fine (and copy/paste testing shows that it does).


#4

@Reaperoa, I may have had the page open while I edited the startup.txt. If that’s what the problem is, how can I fix it?


#5

@SeaOtter It shouldn’t actually matter what you did or didn’t have open, unless you hadn’t actually saved it (i.e. the game will only run the saved file, not any unsaved changes). As soon as you save the new changes, it will run those instead the next time you load the game afresh in your browser (e.g. by clicking in the address bar and hitting enter).

But none of this explains why you don’t see the choices until after you exit from the stats screen - that’s pretty much unheard of, I believe. Very weird. It may have something to do with your setup there, but I can’t honestly think what that might be.

Have you tried developing your game using the CS-IDE? If it works properly in that, it will work for anyone playing it / when published:

https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/IDE/main.html#

You can copy-paste your existing files into there, btw - no need to start from scratch. Go to ‘File’ first, paste in the contents of startup.txt, then switch to choicescript_stats using the drop-down menu and paste in that file’s code, then add New scene files as needed (also using the drop-down scenes menu)… Remember to click Save when you’ve pasted everything in. :slight_smile:


#6

Aha! @Vendetta, thanks a bunch. Figured out the problem through that neat little tool
Used spaces instead of tab with my scene list, that’s what my problem was.


#7

@SeaOtter Ah, interesting - thanks for reporting back on that. I guess it’s one more good reason to consider using startup.txt for just *title /*author / *scene_list / *create commands, and start the actual story scripting in the next scene file.

I’m glad you also find the IDE useful; it has some great features like ‘smart’ indenting and syntax highlighting, but the best one for me is its ability to switch to the exact scene file and focus on the actual line of code where an error occurs while running the game. Really cool. :slight_smile:


#8

I encountered that issue as well. I think the reason is because of the default text in startup.txt

The Choice people are good at telling you that you need to keep spacing and tabbing all the same in order for things to work, but they don’t remind you that they already did things a certain way. It’s easiest to just get in there and redo everything to the way you personally want to do it. The scenes messed me up and I was scratching my head trying to figure out why the lines kept erroring.

(But you said you weren’t getting errors…so…space magic?)

The easiest thing is to use something like Notepad++ because it remembers all your tabbing and kind of saves it and sort of puts placeholders for the indents so that you know where you need to line up your other choices and commands. I dig it. I dig it a lot.


#9

@Brian Black. I have Notepad++, and it seemed right at the time. Didn’t look ‘off’ or anything, but yeah you’re right. I used the scene list from the choice script game. Didn’t occur to me that they might have indented it differently. Very silly of me.


#10

@BrianBlack “It’s easiest to just get in there and redo everything to the way you personally want to do it.”

Pretty much, yup. It’s what’s recommended (for precisely this reason) within the Wiki’s ‘Basic Tutorial’ for when setting up your own game -

  • but by the time a relative newcomer gets around to reading that, they’ve usually already found out the hard way… :smiley:

#11

Exactly! I discovered that thing like waaaay after I had already started. Actually if you look at my journal on here about it, I kinda found out about it at the same time, but I had the problems first! Haha.

Good luck with your game @SeaOtter! :slight_smile: