I’m making a game… bet you couldn’t have guessed that. and my game is telling me what the player is wearing underneath their top clothes. which shouldn’t happen.
so i’m gonna push a looooooooooooooooooooooooooooooooooot of code here for anyone who wants to read it and help me find out why it’s going crazy.
if i take the clothes off and put them on again, it’s fine. and the code works. but it’s starting the play with it that messes it up.
oh and “try silently” wearing all the clothes in the correct putting-them-on order doesn’t work in the when play begins thing. same result: it mentions my boxers while it shouldn’t be mentioning them at all.
i think it’s because i start wearing them at the same time, and the game just clips them together.
you guys ready for my clothing code? well, “my”… i got most of it out of the documentation.
[code]Section clothing
A garment-element is a kind of thing.
Underlying relates various garment-elements to various garment-elements with fast route-finding. The verb to underlie means the underlying relation. The verb to be under implies the underlying relation.
Check taking off:
if the noun underlies something (called the impediment) which is worn by the player, say “[The impediment] [are] in the way.” instead.
Carry out taking off:
now the noun is not underlaid by anything.
Report taking off something:
say “[We] [are] now wearing [a list of uppermost things worn by the player].” instead.
Definition: a garment-element is uppermost if it is not under something opaque.
Before taking off something which underlies something which is worn by the player:
while the noun underlies something (called the impediment) which is worn by the player:
say “(first removing [the impediment])[command clarification break]”;
silently try taking off the impediment;
if the noun underlies the impediment, stop the action.
Overlying relates various garment-elements to various garment-elements. The verb to overlie means the overlying relation.
Covering relates a garment-element (called A) to a garment-element (called B) when the number of steps via the overlying relation from A to B is greater than 0. The verb to cover means the covering relation.
Before wearing something when a garment which covers the noun is worn by the player:
while the player wears a garment (called the impediment) which covers the noun:
say “(first removing [the impediment])[command clarification break]”;
silently try taking off the impediment;
if the player is wearing the impediment, stop the action.
Carry out wearing:
repeat with hidden item running through things worn by the player:
if the noun covers the hidden item, now the hidden item underlies the noun.
Instead of looking under something which is worn by the player:
if something (called the underwear) underlies the noun, say “[We] [peek] at [the underwear]. Yup, still there.”;
otherwise say “Just [us] in there.”
[
Instead of taking inventory:
say "
[if the player carries something][We]['re] carrying [a list of things carried by the player][else][We]['re] empty-handed[end if][if the player wears the satchel][if the player carries something] and [else] but [end if] you have your trusty satchel with you[end if][if the player wears something that is not the satchel]. [We] [are] wearing [a list of uppermost garments worn by the player][end if]."
]
Instead of taking inventory:
say "[We]['re] ";
if the player carries something:
if the player carries the switchblade:
if the switchblade is open:
say “wielding your trusty switchblade”;
otherwise:
say “holding your trusty switchblade in one hand, safely folded up and closed,”;
otherwise:
say “carrying [a list of things carried by the player][no line break]”;
otherwise:
say “empty-handed[no line break]”;
if the player wears the satchel:
if the player carries something:
say " and ";
otherwise:
say " but ";
say “you have your trusty satchel with you[no line break]”;
if the player wears something that is not the satchel:
say “. [We] [are] wearing [a list of uppermost garments worn by the player].”;
otherwise:
say “.”;
if the player wears the satchel:
try examining the satchel;
let x be the number of things in the satchel;
if x is greater than 10:
say “Wow. You’re hauling around a ton of crap.”;
To peek is a verb.
Before wearing something:
let N be the layering depth of the noun;
repeat with item running through things worn by the player:
if the layering depth of the item is N and the item covers a body-part which is covered by the noun:
say “(first taking off [the item])[command clarification break]”;
silently try taking off the item;
if the player wears the item, stop the action.
To decide what number is the layering depth of (chosen garment - a thing):
let N be 0;
if the chosen garment covers a body-part (called base):
let N be the number of steps via the overlying relation from the chosen garment to the base;
decide on N.
A body-part is a kind of garment-element. A torso, a seat, a head, a neck, pair of legs, and pair of feet are kinds of body-part.
One head is part of every person. One torso is part of every person. One pair of legs is part of every person. One pair of feet is part of every person. One seat is part of every person. One neck is part of every person.
A garment is a kind of garment-element. A garment can be transparent. A pair of pants, a pair of underpants, a foundation garment, a pair of socks, a pair of shoes, a jacket, a hat, a dress, neckwear, bril, and a shirt are kinds of garment.
The plural of pair of pants is pairs of pants. The plural of pair of underpants is pairs of underpants. The plural of pair of socks is pairs of socks. The plural of pair of shoes is pairs of shoes.
A pair of pants, a pair of underpants, a foundation garment, a pair of socks, a pair of shoes, a jacket, a hat, a dress, neckwear, bril, and a shirt are usually wearable.
When play begins:
now every pair of socks overlies every pair of feet;
now every pair of shoes overlies every pair of socks;
now every pair of underpants overlies every seat;
now every pair of pants overlies every pair of underpants;
now every foundation garment overlies every torso;
now every jacket overlies every shirt;
now every jacket overlies every dress;
now every hat overlies every head;
now every dress overlies every pair of underpants;
now every dress overlies every foundation garment;
now every neckwear overlies every neck;
Instead of taking off a pair of pants in the presence of people who are not the player :
say “You do not wish to upset [list of visible people who are not the player].”
Instead of taking off a pair of underpants in the presence of people who are not the player :
say “You do not wish to upset [list of visible people who are not the player].”
Instead of taking off a foundation garment in the presence of people who are not the player :
say “You do not wish to upset [list of visible people who are not the player].”
Instead of taking off a dress in the presence of people who are not the player :
say “You do not wish to upset [list of visible people who are not the player].”
Instead of taking off a shirt in the presence of people who are not the player :
say “You do not wish to upset [list of visible people who are not the player].”
There are worn white sneakers, some white socks, some capris, some jeans, a corset, a plunge bra, a thong, boy-shorts, black satin D’Orsay pumps, brown leather boots, a camisole, a cocktail dress, a bolero, a cashmere shrug, a sheer wrap, and a linen tunic.
[The player wears some boxers, some white socks, a sleeveless shirt, some jeans, worn white sneakers and a blue shirt.]
The player carries a blue shirt, some jeans, a sleeveless shirt, worn white sneakers, some white socks and some boxers.
[Hi. Just to point out that changing the order in which i mention them doesn’t solve my issue. sadly.]
Some boxers are pairs of underpants.
Some woolly socks and some white socks are a pair of socks.
The worn white sneakers, D’Orsay pumps and the brown leather boots are pairs of shoes.
The skimpy thong, the thong and the boy-shorts are pairs of underpants.
The capris and the jeans are pairs of pants.
The tunic is a shirt.
The sleeveless shirt is a shirt.
The push-up bra, the camisole, the corset, and the plunge bra are foundation garments.
The cocktail dress is a dress.
The thin white nightgown is a dress. The thin white nightgown is transparent.
The blue shirt, bolero, the cashmere shrug, and the sheer wrap are jackets. The shrug and the wrap are transparent.
The description of the thin white nightgown is “It’s basically see-through.”
understand “gown” and “nightie” as nightgown.[/code]