Troubleshooting #choice


#1

Hello there to you reading this. I am new to choicescript and am very excited about learning it. So far i think i have the basics but im having trouble with a #choice just not showing up. There is no error and it is indented the same as the first choice which does come up. The first choice works variables and all, but i can’t seem to get the second choice to appear. No error message. I am using variables and labelling in the scene and it adds up… Not sure if this is a common easily fixed problem or if i should start from scratch. Thank you for any help you give and nice to meet you!


#2

@Chris It’s not a general problem so it’s likely something particular to what you’re doing there / how you’ve scripted it. Best bet would be to post some code here, using `

` before and `

` after to retain indentation.

Nice to meet you, too. :slight_smile:


#3
 As you stagger and stumble your way through the forest the wilderness erodes before you into modern pavement you reach a small gas station.
*choice
  #Enter through the front.
    *set good +10
    *set evil -5
    *goto action
  #Sneak in through the back.
    *set evil +10
    *set good -5

*label action
Once inside you
*choice
  #Buy a 40
    *if good > 10
      "It's early but whatever." Says the clerk.
      *goto consumer
    *if evil > 10
      "Hey, why did you sneak through the back? I'm calling police!"

*page_break

You go to jail!
*ending
  #Steal a 40
    As you attempt to stuff the 40 into your pants the owner creeps up behind you and blows your head off with a shotgun. Still seems excessive.
      *goto_scene death
      *if evil > 10
        You stuff the 40 in your pants.
*page_break
*label thief
You exit the store and drink your ill gotten brew. Too bad you learned nothing from all the secrets the Keeper shared with you.
*ending
*label consumer
You exit the store. You drink your 4040 and think about what to do with the knowledge imparted by the Keeper.
*choice
  #Force the world to do your will
    It turns out forest secrets can't do that.
    *ending
  #Grow medicinal herbs.
    Your medicine heals the world.
    *goto_scene ending 

#4

Im still finagling this but basically it doesnt give the option to #steal the 40… This is just a test so don’t let the content bother you :wink:


#5

You’re just neglecting to maintain indentation here & there, as follows:


 As you stagger and stumble your way through the forest the wilderness erodes before you into modern pavement you reach a small gas station.
*choice
  #Enter through the front.
    *set good +10
    *set evil -5
    *goto action
  #Sneak in through the back.
    *set evil +10
    *set good -5
    *goto action
*label action
Once inside you
*choice
  #Buy a 40
    *if good > 10
      "It's early but whatever." Says the clerk.
      *goto consumer
    *if evil > 10
      "Hey, why did you sneak through the back? I'm calling police!"
      *page_break
      You go to jail!
      *ending
  #Steal a 40
    As you attempt to stuff the 40 into your pants the owner creeps up behind you and blows your head off with a shotgun. Still seems excessive.
    *goto_scene death
    *if evil > 10
      You stuff the 40 in your pants.
      *page_break
      *label thief
      You exit the store and drink your ill gotten brew. Too bad you learned nothing from all the secrets the Keeper shared with you.
      *ending

*label consumer
You exit the store. You drink your 4040 and think about what to do with the knowledge imparted by the Keeper.
*choice
  #Force the world to do your will
    It turns out forest secrets can't do that.
    *ending
  #Grow medicinal herbs.
    Your medicine heals the world.
    *goto_scene ending


#6

Note that you may also have a problem with your “Buy a 40” option, since you’re setting good / evil to 10 earlier, but that option’s *if conditions are based on >10 (i.e. if 11 or more).

*goto_scene death is also in an odd place, as it will instantly goto that scene when you steal a 40, so rendering the rest of that section (*if evil > 10 etc.) obsolete.


#7

Wow thank you for your help it’s amazing how quickly you got back to me! Outstanding. I’m glad it was simple I’m still getting the hang of the indentation I’ll keep working on understanding until it’s second nature. Thanks again. Do you have some stories i can play?


#8

I was in the process of adjusting that when the option disappeared. Now im going to keep working it to get it to do the rest properly.


#9

@Chris No problem, happy to help. We’ve all been where you are now so don’t be afraid to ask for help if you get stuck on something. If keen to learn more, don’t forget to check out the ChoiceScriptDev Wiki:

Yep, there’s a thread / Demo link for my own game around here too:


#10

Thanks again i now have the scene running smoothly!!! I learned a lot from all this awesome.


#11

Cool i will be checking your demo out asap.

I’m doing all this on my phone and usually not near wifi for now, it’s a little cumbersome but the screen is pretty big. Anyway i saved every page for offline reading and I’m taking notes, i feel like I’m taking a class in choicescript, which essentially i am!


#12

I was wondering, to share my game i simply click share and it will send the necessary files to a person? I’d like to show a friend of mine my little test game.


#13

You mean the share link on the last page of the game?
They redirect you to social media channels I believe, with actual link to where your game is on the web. Social media being twitter tweets and Facebook posts. And then there are some others… I think.


#14

Ok, gotcha, but if I’m not uploading out yet i guess i would just send them the whole file i made it in and tell them to play the index file in mygame?


#15

everything inside the web folder needs to be sent to them, and yes, they need to open the index.html file inside the mygame folder in order to play it.