
	QNA - Quest Nucleic Acid v1.1
	Transormation and Clothing engine for Quest games
	By Justin (Junko) Bailey AKA Momewraith

	-Overview-
	Every cell in your body contains something known as Deoxyribo Nucleic Acid, or DNA. Your DNA is the complete blueprint to your body. It decides everything about you. QNA is a library of additions to the Quest gaming engine that will allow you to mess with the player's DNA to affect changes in gender, age, and size. Also included is a simple clothing routine, with an emphasis on the player's current size affecting which clothes he/she will be able to wear and on making clothing that can affect a transformation just by being worn.
	This library emphasies Age Regression and Transgender transformations. It can also be used to create Shrinking transformations, and if you're creative, other transformations. If you really wanted to, you could even just use the clothing routine and not transform the player at all. I don't know why you would, but you could.
	QNA did all the transformation work in Operation: Sleepver v2.1, and now I'm making it available to everyone in the hopes that it might make things easier for others trying to make AR/TG games in Quest.

	-Getting started-
	The first step in using this library will be to include it in your game. To do that in QDK, go to Libraries under the Game menu. Click the add button and add qna.qlb.
	Next, you'll need to initialize the library functions when the game starts. Click the earth button to get the Game Properties dialog. Under the scripts tag, the first option you see will let you add a script to run when the game starts. Click the edit button, then click add command. Under game control, select run a procedure. Type in qna.setup. Under parameters, put the version of QNA your game was written in. This is version 1.1, so just put in the number 1.1. The idea behind this is to give backwards compatibility to future releses of the library. Running this procedure will set up several of the basic variables the library will need to function properly.

	-Attributes-
	Now, you'll want to set the player's base attributes. To do this, simply start defining variables (while still in the script to run when the game starts area, after the command to run qna.setup). Below is a list of the attributes QNA keeps track of and how to modify them.

	Numeric Variables:
	Sex - 0 for female, 1 for male. 
	Age - The player's age in years.
	Size - Decides which clothes will fit the player (see below).
	
	String Variables:
	Name[0] - The player's name when female (Default is Jill).
	Name[1] - The player's name when male (Default is Jack).
	Qna.playerdesc - Additional description of the player (See below).

	To set any of these variables, simply go to the script command editor dialog -> variables -> set a variable. Most of these are pretty straight forward, but a couple will need some additional explaining.

	Size - Obviously, a 22 year old man can't wear the same clothing as a 6 year old girl, no matter how much he may want to. It simply won't fit. To simulate this in your game, QNA can calculate your character's size based on his/her age. However, since some people may want to make shrinking related games, it will not do this automatically.
	To auto-resize a character, run the qna.agesize procedure. It's a good idea to do this every time you change the player's age. Qna.agesize will calculate the player's size based on age, and will determine if his/her current clothing will still fit. Sizes will be discussed in even more detail in the clothing section.
	Remember to set the size variable or run qna.agesize in your startscript section after setting the player's age.

	Qna.playerdesc - This can contain any additional player description information you may want to add. For example, if you set it to "You have red hair and glasses." then that text will appear in the player's descrption whenever they check their inventory. By default, this variable is empty, and you can leave it that way if you'd like.

	Displaying attributes:
	The player's current attributes will display whenever they use the inventory command. However, you will often want to refer to these attributes elsewhere in your game. Here's how to do it.
	Age is the easiest, since it's just a simple numeric variable. To display it, simply put %age% in your message. This just tells quest to display the contents of numeric variable age. For example: msg <You're only %age% years old?>
	The name is a bit more complicated. It's a string variable determined by an array. If you didn't understand that sentence, don't worry. Just put #name[sex]# wherever you would use the character's name. For example: msg <It's nice to meet you, #name[sex]#.> will display the character's correct name, corresponding to his current gender.
	To display useful information about your current sex, I've created the Gender function. This will print either man, woman, boy, or girl, depending on the character's current age and sex. To use it,insert $gender$ whenever you would use one of these options. Example: msg <You're a very nice $gender$.>
	Also remember that the numeric variables %age% and %sex% are great to use in conditional (if/then/else) statements. That's where they really come in handy.
	

	-Clothing-
	QNA makes making clothes very easy. It even works in layers, so you can't take off your underwear while your pants are still on. This is made possible by a Quest feature called types. By simply making an item of one of the clothing types, that item instantly receives both the wear command and the remove command.
	Let's make a simple piece of clothing. From QDK's main screen, click on Add under a room's objects list. Call your object shirt and fill out all the important description fields. Under the take tab, click Yes to make the shirt takable. Under the interactions tab, click Edit Properties and Actions. Under the types tab, click Add and type in shirt. Under the properties tab, give the shirt a property of size=0. Now test the game. Pick up the shirt and then wear it. Pretty easy, huh? Below is a list of the various clothing types and their various uses.
	(Underwear layer)
	Teddy - Anything that covers like a teddy. One-piece swimsuits, long johns, etc.
	Undies - Panties, boxers, diapers, etc.
	Bra - Bras, undershirts, etc.
	(Second layer)
	Sleeper - Sleepers, wetsuits, etc.
	Tights - Tights, pantyhose, stockings, etc.
	Shirt - Shirts
	(Third layer)
	Dress - Dresses, or anything else that covers the whole body, such as coveralls.
	Pants - Pants.
	Skirt - Skirts.
	Jacket - Jackets, coats, etc.
	(No layer)
	Accessory - Rings, jewelry, hats, etc.

	Skirt and Pants cover exactly the same area, but the grammar is slightly differnt (you take it off vs you take them off). Accessory is a special type because it can be put on or taken off regardless of what else the player is wearing at the time.

	Sizing:
	Like I said before, what you can wear is also affected by your size. Remember when we set size to 0? That made it so that anybody at all could wear that shirt, regardless of their size. Normally, you'd only do that with the accessory type. The player can wear 1 size larger than their current size, but nothing smaller. Below is the age/size comparison chart that qna.agesize follows.
	Age	Size
	Any	0
	0-2	1
	3-5	2
	6-8	3
	9-11	4
	12-14	5
	15-17	6
	18+	7

	If you want to change the character's size, but not make it based on their age (such as in a shrinking game) you can use the qna.resize procedure after setting the new size manually. Both this and the qna.agesize procedure will drop any item the character was wearing which is now too large for him in the current room and destroy anything he was wearing which is now too small for him.
	By the way, you might want to put some appropriately-sized clothing in the same room as the player when the game starts. Otherwise, he/she might haveto go through the game naked.

	Before, After, Takeoff, Locked:
	Sometimes, you'll want a transformation to be triggered by the player putting on or taking off an article of clothing. This is where the before, after, and takeoff actions come into play. Back in the Properties and Actions screen for your item, make an action with one of these names.
	Before will run while the character is putting the item on, but before QNA checks to see if it will fit. This is great to use if you want to make a magical diaper that will regress the wearer when he puts it on. Simply put the code for the regression under the before action for the diaper.
	After runs after QNA has made sure that the item will fit. Say you have a magical pair of panties that will turn the player into a girl when he puts them on, but they don't affect an age change at all. He needs to be able to fit into them before they'll work their magic on him.
	As you may have guess, the takeoff action will run when the character takes off the article of clothing. Perhaps in the example above, removing the panties makes the player male again.
	Sometimes, you might want to make it so that the player can't remove a specific article of clothing. Perhaps the zipper is in back where they can't reach, or maybe the item is cursed. In this case, add the property locked under the properties tab. You don't need to set a value for it, just add the property locked. When the player manages to remove the curse from the item or unlock it or whatever, set the property to not locked.

	-Update History-
	12/22/2005 - Version 1.1 has some bug fixes and includes a demo game to make everything a bit easier to understand.
	08/21/2005 - Publicly released version 1.0.
	Future updates will happen based on request for various features from programmers.

	-Other Stuff-
	That covers the basics of what QNA can do for you and how to use it. If you just use some of your creative juices, you shouldn't have too much trouble making your own transformation adventures. I've left out all the technical stuff about the math behind the clothing layering and things like that. If you're curious in learning more about that, or if you have any questions, feel free to email me at momewraith@yahoo.com.

	Also, be sure to let me know if you write a game using this library. I'd love to play it.