Heya all,
I’m pretty new here and pretty new to Inform.
I’ve been playing around with a clothing and exposure system as a practice project to try and get more adept with coding and get more efficient, and because wearing clothes and different exposure systems feel like they’d use a bunch of interesting fundamentals that could be applied elsewhere, and because I like writing clothing and outfit descriptions, and like having the world or player react to their current situation.
I aimed to keep it as simple as possible to actually use while offering a wide array of states.
Standard clothing is simple, I just use Inform’s built-in clothing system. The player can wear a top, bottom, bra, and underwear.
Clothing is a kind of thing.
A top is a kind of thing. A top is a kind of clothing. A top is usually wearable.
Instead of wearing a top when the player is wearing a top (called the wrong top):
say "[player forename] needs to take off [the wrong top] first.";
A bottom is a kind of thing. A bottom is a kind of clothing. A bottom is usually wearable.
Instead of wearing a bottom when the player is wearing a bottom (called the wrong bottom):
say "[player forename] needs to take off [the wrong bottom] first.";
A bra is a kind of thing. A bra is a kind of clothing. A bra is usually wearable.
Instead of wearing a bra when the player is wearing a bra (called the wrong bra):
say "[player forename] needs to take off [the wrong bra] first."
Underwear are a kind of thing. Underwear are a kind of clothing. Underwear are usually wearable.
Instead of wearing a Panties when the player is wearing underwear (called the wrong underwear ):
say "[player forename] needs to take off [the wrong underwear] first."
The two unique articles of clothing are Skirts and Dresses, because it’s possible to wear both a skirt and a dress without underwear, creating a kind of obscured exposure. And because I didn’t want it possible to wear a shirt and a dress at the same time.
A Skirt is a kind of thing. A Skirt is a kind of clothing. A Skirt is a kind of Bottom. A Skirt is usually wearable.
Instead of wearing a Skirt when the player is wearing a Skirt (called the wrong Skirt):
say "[player forename] needs to take off [the wrong Skirt] first."
A dress is a kind of thing. A dress is a kind of clothing. A dress is usually wearable.
Instead of wearing a dress when the player is wearing a dress (called the wrong dress):
say "[player forename] needs to take off [the wrong dress] first.";
Instead of wearing a skirt when the player is wearing a dress (called the wrong skirt):
say "[player forename] needs to take off [the wrong skirt] first, she can't wear a skirt and a dress.";
Instead of wearing a bottom when the player is wearing a dress (called the wrong bottom):
say "[player forename] needs to take off [the wrong bottom] first, she can't wear that with a dress.";
The player can also be in multiple states. If the player isn’t wearing anything, they are considered naked. This is by far the easiest state to make and check with and doesn’t need its own state:
Report ClothesCheck:
if player is wearing clothing:
say "[player forename] is wearing [a list of things worn by the player].";
If player is not wearing clothing:
say "[player forename] isn't wearing anything right now."
I don’t think I should class a player as Uexposed or Lexposed when they’re naked, because then some events might struggle to tell if it should play an Uexposed event or a naked event.
But if a player is only wearing a top, they are considered Lexposed (Lower exposed). If the player is only wearing bottom, they are considered Uexposed (Upper exposed) and if a player is wearing a skirt or dress they get a special Hexposed (Hidden exposed).
A person can be Lexposed. [Lower Exposed]
A person can be Uexposed. [Upper Exposed]
A person can be Hexposed. [Hidden Exposed]
And because an article of clothing could theoretically be exposing in itself, like a ripped shirt, mesh shirt, a loincloth, or some translucent shorts, clothing can be considered exposing. To add further complication, underwear itself might not be considered appropriate and can also be exposing.
Clothing can be UExposing. [Upper Exposing]
Clothing can be LExposing. [Lower Exposing]
In order to check exposure ( this is where I feel there’s inefficiency or tools I’m not using well) I’ve been determining states using a series of If and Else.
Every turn:
If player is wearing a top:
If player is wearing a Uexposing top:
If player is not wearing a bra:
Now player is Uexposed;
Else if player is wearing a Uexposing bra:
Now player is Uexposed;
Else if player is wearing a bra:
Now player is not Uexposed;
Else:
Now player is not Uexposed;
Else if player is not wearing a top:
If player is not wearing a bra:
Now player is Uexposed;
If player is wearing a Uexposed bra:
Now player is Uexposed;
Else if player is wearing a bra:
Now player is not Uexposed.
Pants function the same way but with underwear instead of a bra. The skirt functions differently.
Every turn:
If player is wearing skirt:
if player is wearing panties:
Now player is not Hexposed;
Else if player is not wearing panties:
Now player is Hexposed;
Now player is not Lexposed;
Else if the player is wearing Hexposing panties:
Now player is Hexposed;
Now player is not Lexposed;
Else if player is not wearing skirt:
Now player is not Hexposed.
I think that pretty much covers my system, and I’m wondering if anyone has any advice or tips for making something like this more efficient. Huge amounts of If and Else if things don’t seem like the right way to go, considering Inform is more “writerly” than other things. I figure plenty of people have probably made clothing systems and might be able to offer advice for streamlining.