Variable Troubles

So, I’ve read a lot of guides. You’ve probably seen me linking them around to people. Alas they have not helped me this day. Some how the game believes i do not have a crowd variable when in fact, I most certainly do. However it keeps telling me i do not, and that this variable doesn’t exist. The funny thing is, I coded it exactly like I did the sexual orientation, except that is based on your gender. This is solely based on the crowd itself. Basically the crowd can get drunk and you lose a chance to meet someone after you choose two other choices. I want to set the crowd to drunk so you wont be able to speak with them. Here is the code.

*title Chronicles Of Hallarmuli
*author Mikayla Baughman
*scene_list
  startup
  choicescript_stats
  enteringmon
  father
  sold
  saved
  questions
  council
  Leif
  mingling
  ending
  
  

*create Name""
*create Gender""
*create Occupation""
*create Money""
*create Health""

*create Ruthless "50"
*create Rebellion "50"
*create Brutality "50"
*create Persuasion "50"

*create Stamina "10"
*create Agility "10"
*create Strength "10"
*create Intelligence "10"
*create Perception "10"


*create Steel "5"
*create Archeryrep "5"
*create Archery "???"
*create Unarmed "5"
*create Stealth"5"
*create Mysticsrep "5" 
*create Mystics "???"
*create Bluntrep "5"
*create Blunt "???"

*create Erlandrep "50"
*create Erland "????"
*create Henrikrep "50"
*create Henrik "????"
*create Asgerrep "50"
*create Asger "????"
*create Sigrunrep "50"
*create Sigrun "????"
*create Leifrep "50"
*create Leif "????"
*create Brynjarrep "50"
*create Brynjar "????"
*create Siblingrep "50"
*create Sibling "????"
*create Brother false
*create Sister false 
*create Name "Adam"
*create Name "Ana"  
*create Name "William" 
*create Name "Katherine" 
*create Name "???"
*create Name "Christopher"
*create Name "Edmund"
*create Name "Susanne"
*create Name "Mary"
*create Sibname "???"
*create orientation "yes"
*create crowd "sober"




*set Name "???"
*set Gender "???"
*set Occupation "Adventurer"
*set Health "100"
*set Money "Not a rock to your name."

here is orientation,

Slowly you realize what he means.
*choice
 #"I myself only like women."
  *if (Gender="Male")
      *set orientation "straight"
      *goto_scene council
  *if (Gender="Female")
      *set orientation "lesbian"
      *goto_scene council
  *else
      *set orientation "women"
      *goto_scene council
  
 #"I prefer only men."
  *if (Gender="Male")
      *set orientation "gay"
      *goto_scene council
  *if (Gender="Female")
      *set orientation "straight"
      *goto_scene council
  *else
      *set orientation "men"
      *goto_scene council
 #"Both, actually, is my preference."
  *set orientation "bi"
  *goto_scene council
 #"You are right about one thing. Sex doesn't interest me."
  *set orientation "ace"
  *goto_scene council

and then my attempt to drunken the crowd.

*label mingle
*hide_reuse globally
What will you do?
*choice
 #Keep talking to Erland.
  *if (crowd="sober")
      *set crowd "semisober"
  *else 
      *set crowd "drunk" 
  
  *hide_reuse globally
  You stick by Erland, watching him as he is lost in thought. His black 
  locks are messily falling out of a partial knot on the crown of his head. 
  They dry around his strong jaw in wispy curls. Erland jerks himself out of 
  his thoughts with a small flinch, seemingly feeling your eyes on him. He 
  looks up at you with his own, blown wide with surprise. You notice close 
  up that his ice blue irises are a deeper sapphire blue at the center. He 
  clears his throat awkwardly under your scrutiny and rubs his neck.
  *choice
   #Do you always do that when you are nervous?
    boop

   #I didn't mean to make you look bad.
    boop

   #Is Leif always like that?
    boop

   #Do you have any plans for me?
    boop

   #What is my "status"?
    boop

   #Do something else.
    *goto mingle

 #Approach Leif.
  *if (crowd="sober")
      *set crowd "semisober"
  *else 
      *set crowd "drunk" 
  *hide_reuse globally
  You leave Erland to his thoughts ,ignoring the laughter that filters 
  through the air as you search for your target. You spot him leaning 
  against the wall, sending a group of particular rowdy warriors out the 
  door. His eyes then scan the room and land on yours, rubbing a hand 
  across his graying stubble
  *if (Leifrep<50)
      He sneers at you and turns away to find some other form of 
      entertainment. It seems he will dislike you for a very long time if 
      you don't step up your game soon.
      *goto mingle

  *else
      He jerks his head at you, a subtle invitation. You cautiously trot 
      over, watching him take a wet cloth from a waiting servant. He wipes 
      down his hands and runs the cloth through his hair. Once you get 
      within ear shot he throws the cloth at the servant and shoos her off. 
      He pats the wall next to him, continuing to style his short hair back 
      into a slicked undercut. You lean up against the wall next to 
      him and watch. He motions for you to speak.
      *choice
       #Is this your bath?
        boop
 
       #Who is Brynolf?
        boop

       #What's your story?
        boop

       #Do you and Erland have specific plans for the war?
        boop
 
       #I notice you only have paid servants.
        boop

       #Do something else.
        *goto mingle

 #Mingle with the others.
  *hide_reuse globally
  *if (crowd="semisober")
      boop
  *if (crowd="sober")
      boop
  *else
      boop

sorry for the long post, im genuinely curious as to why it refuses to work. I thought Id post it b4 going to bed.Feel free to play with the code

What’s the exact error code you’re getting?

Just my theory, but I think the error has nothing to do with the “crowd” variable.
It’s a “statement fall out” error

1 Like

@Arasia_Valentia

  1. can you tell us what error is t giving you - try bottom left icon ( in IE ) and tell us what it said
  2. i think you should use goto command at the end of a choice-option otherwise it wont be considered complete

I like how you use “boop” as your placeholder text.

2 Likes

xD What can I say? It was 2 am.

Um here is a pic.

Okay, let me try that.

Oh yeah, that’ll definitely give you an error (although it usually says fallout error). Most of the choices you’ve got placeholders for will either need to be skipped over or have *goto commands to keep the tester happy.

I am no expert but as far as I can tell there is nothing wrong with crowd variable but the error is there so - sorry buddy

Bah! it’s okay, I’ll sort it out! I’m not using the tester either. The game will not pass that point for some reason. Ah well, what can you do?

Try putting in a *goto ending after the problem choices below where you have an else/if or put goto commands after all the missing ones in the choices then run the tester. The good thing about the tester is it will often tell you exactly which line (and sometimes the character) that is causing the issue. (It looks like line 3 that safari is erroring is “What will you do?” which shouldn’t be causing problems I don’t think. Might be the choice command underneath though.

Unless it’s a formatting issue, it also looks like there’s mixed tabs and spaces? (see the distance under else compared to the options under choice).

“Notepad ++” is great for keeping track of line numbers and spaces.

https://notepad-plus-plus.org/

@Carlos.R hopefully finding line three isn’t his problem :joy:

@Arasia_Valentia which one is “mingling”? And what is line three in that text file? (Maybe add lines 1-7 so we can get a little extra info, or point it out if you’ve already posted it). When do you get the problem? I see you’re trying to let the player go through the scene twice, is the problem occurring the first time or second time you go through the scene?

EDIT: I copy/pasted your code and quickly created a copy of what you posted and got this:

I would suggest re-downloading choicescript and copy/pasting your files into that new version and seeing if that fixes the problem.

EDIT 2:
I have now made it all the way through my sad little “testbook” but successfully all the same. This is the working code that worked in the April 2nd 2017 version of choicescript that I have downloaded on my computer:

*label mingle
*hide_reuse globally
What will you do?
*choice
 #Keep talking to Erland.
  *if (crowd="sober")
   *set crowd "semisober"
   *goto next
  *else
   *set crowd "drunk" 
   *goto next
  *label next
  *hide_reuse globally
  You stick by Erland, watching him as he is lost in thought. His black 
  locks are messily falling out of a partial knot on the crown of his head. 
  They dry around his strong jaw in wispy curls. Erland jerks himself out of 
  his thoughts with a small flinch, seemingly feeling your eyes on him. He 
  looks up at you with his own, blown wide with surprise. You notice close 
  up that his ice blue irises are a deeper sapphire blue at the center. He 
  clears his throat awkwardly under your scrutiny and rubs his neck.
  *label next2
  *fake_choice
   #Do you always do that when you are nervous?
    boop
    *goto next2
   #I didn't mean to make you look bad.
    boop
    *goto next2
   #Is Leif always like that?
    boop
    *goto next2
   #Do you have any plans for me?
    boop
    *goto next2
   #What is my "status"?
    boop
    *goto next2
   #Do something else.
    *goto mingle

 #Approach Leif.
  *if (crowd="sober")
   *set crowd "semisober"
   *goto next3
  *else 
   *set crowd "drunk" 
   *goto next3
  *label next3
  *hide_reuse globally
  You leave Erland to his thoughts ,ignoring the laughter that filters 
  through the air as you search for your target. You spot him leaning 
  against the wall, sending a group of particular rowdy warriors out the 
  door. His eyes then scan the room and land on yours, rubbing a hand 
  across his graying stubble
  *if (Leifrep<50)
      He sneers at you and turns away to find some other form of 
      entertainment. It seems he will dislike you for a very long time if 
      you don't step up your game soon.
      *goto mingle

  *else
      He jerks his head at you, a subtle invitation. You cautiously trot 
      over, watching him take a wet cloth from a waiting servant. He wipes 
      down his hands and runs the cloth through his hair. Once you get 
      within ear shot he throws the cloth at the servant and shoos her off. 
      He pats the wall next to him, continuing to style his short hair back 
      into a slicked undercut. You lean up against the wall next to 
      him and watch. He motions for you to speak.
      *label next4
      *choice
       #Is this your bath?
        boop
        *goto next4
       #Who is Brynolf?
        boop
        *goto next4
       #What's your story?
        boop
        *goto next4
       #Do you and Erland have specific plans for the war?
        boop
        *goto next4
       #I notice you only have paid servants.
        boop
        *goto next4
       #Do something else.
        *goto mingle

 #Mingle with the others.
  *hide_reuse globally
  *if (crowd="semisober")
      boop
      *goto_scene ending
  *if (crowd="sober")
      boop
      *goto_scene ending
  *else
      boop
      *goto_scene ending

I even added ${crowd} to my choicescript_stats.txt file and followed the changing of the stat all the way through and that worked too. Again I would suggest downloading a fresh copy of the choicescript files and copy/pasting the text files over to the new files. :confused: That’s all I’ve got.

2 Likes

You’re a god my dear. Can’t thank you enough. :heart:

1 Like