Can any body make this less cluttered

So my code looks like this.

*choice
  *selectable_if (underwear = false) #Panties (optional)
   *set underwear true
   *set under "panties"
   *set skirt "skirt"
   *goto nextk

  *selectable_if (underwear = false) #Boxers (optional)
   *set underwear true
   *set under "boxers"
   *set skirt "skirt"
   *goto nextk

  *selectable_if (thigh = false) #Leggings (optional)
   *set underwear true
   *set skirt "skirt"
   *set leg true
   *set leggings "tight leggings"
   *goto nextk

  *selectable_if (leg = false) #High-thigh socks(optional)
   *set thigh true
   *set high "high-thigh's"
   *goto nextk

  *selectable_if (skirt = "short skirt") #Im ready.
   *goto downstairs ([b] Warning you do not have on any undergarments[/b])

  #Im ready to go downstairs
   *goto downstairs

  *selectable_if (skirt = "skirt") #Im ready to go back downstairs.
   *goto ko

See I wrote this multiple times because if you have on a “short skirt” it indicates you have on no undergarments but if you have on a skirt you have on undergarments but the last 3 choices repeat because of all of this is there a simpler way to do this?

So is the issue that the game assumes there are no undergarments? Why not just *set the undergarments for a short skirt, as well?

Your code seems cluttered already. Is it possible to combine all [skirt], [thigh], and [underwear] into a single variable?

@ashestoashes018 No the player should have the choice of wearing undergarments or not later on in the story if you are not wearing undergarments a bullying scene will show after some one trips you. There is also the other scene where your family demands you go back upstairs and change (hence the 3rd option)

@Szaal No because the player has the choice of wanting to wear some of these garments. Some of the clothes here can be worn together as one outfit or they can choose to just wear one.

What I mean is…the issue you’re having, where it shows for one but not the other, is because you’re not treating the variables equally.

If a long skirt has undergarments shown, but the short skirt does not, just take a look at your code and make them equal.

@ashestoashes018 Ok im thinking about what your saying and thinking of something like this.

  Selectable_if ((underwear = false) and (family = "unaware")) #go downstairs.

That would work but what about I f the character is wearing a skirt that’s the only way the family and bullys will find out. what if the player is wearing undergarments?

So is there any other suggestions to make this less cluttered?

I’m thinking that even if you need to tell apart the different kinds of undergarments, you should be able to merge some of those variables. For instance, instead of:

 *set underwear true
 *set under "panties"

You could do:

 *set underwear "panties"

And then later, when you need to check, for a general check you can use:

if (underwear != false)

While still being able to check for a particular type of underwear:

if (underwear = "panties")

Having a single choice to go downstairs wouldn’t be much of a problem, since you can still do any checks you need to inside the choice, rather than having three separate ones and hiding or showing them depending on the situation.

Besides, the text between parentheses here is never actually shown to the player, is it?

   *goto downstairs ([b] Warning you do not have on any undergarments[/b])

I don’t think I quite understand what you were for with this code, so I’m sorry if my advice turns out not to be useful.

Have you considered using a double choice I.e they get to pick skirt or short skirt and their choice of underwear?

@Myrtle the text in the parentheses are supposed to be visible to the player but I placed it in the wrong spot thank you for finding that it would have brought errors.

The thing is the only way the people downstairs could see your underwear is if you choose to wear a skirt and also choose to not to wear undergarments. In the same way if your not wearing a skirt and wearing like shorts with no undergarments they shouldn’t be able to tell. If you wear a skirt and undergarments the people downstairs shouldn’t be able to tell.

@Nocturnal_Stillness

What do you mean?

What are you wearing...
*choice skirt underwear
  #Ankle length skirt.
    #No underwear.
      *set skirt "long"
      *set underwear "none"
      *goto next_scene
    #Underwear.
      *set skirt "long"
      *set underwear "Knickers"
      *goto next_scene
  #Knee length skirt.
    #No underwear.
      *set skirt "medium"
      *set underwear "none"
      *goto next_scene
    #Underwear.
      *set skirt "medium"
      *set underwear "Knickers"
      *goto next_scene
  #Short skirt.
    #No underwear.
      *set skirt "short"
      *set underwear "none"
      *goto next_scene
    #Underwear.
      *set skirt "short"
      *set underwear "Knickers"
      *goto next_scene

this code would let people pick two options in a single choice

1 Like

Ok I have something similar the problem is the last three options which depends on what the character is wearing not the clothing system itself.

Why not just have a variable called visible and set it to true if they pick a combination where it would be visible then you’d only need to check for that?

1 Like

Okay I’m looking at your response and thinking what if I did the check during the breakfast scene I’ll delete the other two choices and during the scene just do this

*if ((underwear = false) and (skirt = "short skirt"))
  Random text
More random text

yes but if you did something like *set visible true when people pick short skirt and no underwear then you only need *if (visible)

True true let me test it out and I’ll get back to you.

Honestly, it seems like you’re making everything far more complex than it needs to be.

It would likely be best to make underwear a text variable, rather than true/false, just like with a skirt versus pants.

Or, yeah, just make a variable like
*create underwear_visible false

seems like a simple enough solution.

1 Like

Ok I did it the code works fine thanks

You’re welcome. The more you use choicescript the more you pick up the little nuances to make your code smoother lowering the code needed but without resulting in less content. :slight_smile:

1 Like

Yep, I’m still learning new stuff all the time, myself.

Learning the shortcuts comes with time. If you go to your favorite WIP on dashingdon and add /scenes to the end of the URL, you can take a look at their code. I do that sometimes to see if I can learn something new :slight_smile:

2 Likes