A problem with coding

So, I’m still pretty new to Choicescript. I’ve been trying to fix this problem I’ve had for days, but I can’t find a solution.

This is just a test scene I’ve created, so it won’t appear in the actual game:

Jonah asks if you are a werewolf.

*choice
	#Tell him the truth.
		*set Jonah  %+40
		*goto newchoice
	#Lie to him even though it's obvious you're a werewolf.
		*set Jonah %-40
		*goto newchoice
		*finish

*label newchoice

Later, you decide you want Jonah to become a werewolf, too.

*choice
	#Ask him if he wants to be one.
		*if Jonah >50
			He says, "Yes!"
		*page_break
		*goto_scene chaptone
*else
	He says, "No."
		*page_break
		*goto_scene chaptone

So, I can get the first result (in this example, the “He says, ‘Yes!’” line) to work. I’ll choose that option and it does exactly what it’s supposed to do - the text shows up, then I can go to the new scene.

However, when I try the other option, the result either won’t show up at all and just go straight to the next scene or (depending on how I write the code) it will show up, but it’ll be part of the new scene.

I’ve tried many different versions of the code, but nothing works - I just don’t really know what I’m doing wrong.

Your *else isn’t in the same level as the *if (Jonah >50)

As Szaal said. Here this might help

*choice
	#Ask him if he wants to be one.
		*if Jonah >50
			He says, "Yes!"
		*page_break
		*goto_scene chaptone
                *else
	                He says, "No."
		        *page_break
		        *goto_scene chaptone

It doesn’t work. It still just goes to the next scene…

@Bathala got it a bit too in.

This is what I think it should be.

*choice
   #Ask him if he wants to be one.
      *if Jonah >50
         He says, "Yes!"
         *page_break
         *goto_scene chaptone
      *else
         He says, "No."
         *page_break
         *goto_scene chaptone

Of course, in that example, I used space. You have to modify it to fit to your own indentation scheme.

Ah, my bad. It’s really hard not using tab

It works! Thanks!

A bit off topic, but how can you even get to tab in the comments?
When I tab here, the focus always switched to the “Reply” button.

That’s exactly why it’s hard :confused:

I know you’ve gotten it fixed, but I am a little confused about your labeling.

*label never seems to work, unless it is equally indented (IE it is at the same indentation as the line above it)

and *finish seems out of place where you have it.

That being said, I’m not using the newest version of CS, so I could be waaaay off.

??? I haven’t had that problem, and it doesn’t make sense as a property of *label.

If you’re going from a choice to defining the scenes that could be an outcome of that choice, it would be super confusing to write those scenes as a subset of the choice. You might as well just be using *fake_choice, then?

Agree re: *finish, though.

1 Like

*label acts exactly like a normal text does. There’s no correlation as with how deep/shallow the indentation level is as long as you follow the rule for *if/*elseif/*else indentation.

And yes, you can have indented *finish, which can end a scene earlier depending on the *if or #choicebody containing it.

I meant (and I think @ashestoashes018 did too) that it doesn’t make sense to have a *finish after a *goto – you’re not going to reach it.

1 Like

Oh, I missed that *goto. My bad.

1 Like

That’s so odd. I’ve always had an issue with *label not loading properly unless it is indented. I just use what has worked for me :laughing:

I’ll try editing a file, one of these days, to see if the updates in the last cough3yrscough have fixed that.

1 Like