Both sides previous revisionPrevious revisionNext revision | Previous revision |
libtf:documentation:api:person [2018/04/22 19:36] – [(Person).applyChanges( thirdPerson = false )] lee | libtf:documentation:api:person [2024/06/19 20:19] (current) – removed lee |
---|
[[libtf:documentation:api:start|<-- Back]] | |
| |
| |
====== LibTF.Person====== | |
| |
**Inherits From:** [[libtf:documentation:api:persistentobject|LibTF.PersistentObject]] | |
| |
Person is kind of the core of LibTF. Each character in your can who can be transformed (usually just the PC in most TF games, but the library supports as many transformable characters as you want). | |
| |
Persons can carry items, via their [[libtf:documentation:api:inventory|Inventory]] field. | |
| |
Persons can wear [[libtf:documentation:api:apparel:|Apparel]], via their [[libtf:documentation:api:apparel:wornapparel|WornApparel]] field. | |
| |
Persons also have built in [[libtf:documentation:api:transformable:|Transformable]] fields, which are the core of the library's transformation system. | |
| |
A Person's individual Transformables can be configured to operate independently from one another (for the game author who wants fine-grained control over the character's transformation), or can be configured to interpolate their values from a master transformable, so that they change automatically (for the game author who want's things to stay simple and easy). For example, when interpolation is enabled for all sex/gender Transformables and Height, the character's height, bust, and sexual organs will all change automatically according to the character's Femininity transformable's value. | |
| |
| |
===== Fields ===== | |
| |
**Inherited from [[libtf:documentation:api:persistentobject|LibTF.PersistentObject]]:** id, parentId, parent, name, aName, nameIsProper, nameIrregularArticle | |
| |
==== (Person).applyTransformationsImmediately ==== | |
| |
* **Access:** Read-Write | |
* **Type:** Boolean | |
| |
This field controls whether or not transformations are applied to this Person immediately. | |
| |
If true, then any modification of any of this Person's [[libtf:documentation:api:transformable:|Transformable]] fields .val or .newVal fields, as well as calls to .increase() or .decrease(), will be applied to this Person immediately. | |
| |
If false, then any modification as above will be deferred until .applyTransformations() is called on this Person, or .applyTransformation() is called on the specific [[libtf:documentation:api:transformable:|Transformable]]. That is, these modifications will be remembered secretly as they are made, but they will not be applied to the Person until .applyTransformations() is called. This is useful for games where transformations occur as the PC sleeps, as a result of the day's events, or somesuch. | |
| |
If null or undefined when Persistence.setDefaults was called to create this Person, then the value of [[libtf:documentation:api:settings#libtfsettingsdefaultapplytransformationsimmediately|LibTF.Settings.defaultApplyTransformationsImmediately]] will be used. | |
| |
| |
==== (Person).inventory ==== | |
| |
* **Access:** Read-Only | |
* **Type:** [[libtf:documentation:api:inventory|LibTF.Inventory]] | |
| |
The [[libtf:documentation:api:inventory|LibTF.Inventory]] object that tracks what items this Person is carrying. | |
| |
| |
==== (Person).apparel ==== | |
| |
* **Access:** Read-Only | |
* **Type:** [[libtf:documentation:api:apparel:wornapparel|LibTF.WornApparel]] | |
| |
The [[libtf:documentation:api:apparel:wornapparel|LibTF.Apparel.WornApparel]] object that tracks what this Person is wearing. | |
| |
| |
==== (Person).femininity ==== | |
| |
* **Access:** Read-Only | |
* **Type:** [[libtf:documentation:api:transformable:femininity|LibTF.Femininity]] | |
| |
This Person's [[libtf:documentation:api:transformable:femininity|Femininity]] transformable. | |
| |
| |
==== (Person).height ==== | |
| |
* **Access:** Read-Only | |
* **Type:** [[libtf:documentation:api:transformable:height|LibTF.Transformable.Height]] | |
| |
This Person's [[libtf:documentation:api:transformable:height|Height]] transformable. Optionally interpolated from the Person's [[libtf:documentation:api:transformable:femininity|Femininity]]. | |
| |
| |
==== (Person).bust ==== | |
| |
* **Access:** Read-Only | |
* **Type:** [[libtf:documentation:api:transformable:bust|LibTF.Transformable.Bust]] | |
| |
This Person's [[libtf:documentation:api:transformable:bust|Bust]] transformable. Optionally interpolated from the Person's [[libtf:documentation:api:transformable:femininity|Femininity]]. | |
| |
| |
==== (Person).penis ==== | |
| |
* **Access:** Read-Only | |
* **Type:** [[libtf:documentation:api:transformable:penis|LibTF.Transformable.Penis]] | |
| |
This Person's [[libtf:documentation:api:transformable:penis|Penis/Clit]] transformable. Optionally interpolated from the Person's [[libtf:documentation:api:transformable:femininity|Femininity]]. | |
| |
| |
==== (Person).pussy ==== | |
| |
* **Access:** Read-Only | |
* **Type:** [[libtf:documentation:api:transformable:pussy|LibTF.Transformable.Pussy]] | |
| |
This Person's [[libtf:documentation:api:transformable:pussy|Pussy/Balls]] transformable. Optionally interpolated from the Person's [[libtf:documentation:api:transformable:femininity|Femininity]]. | |
| |
| |
===== Methods ===== | |
| |
**Inherited from [[libtf:documentation:api:persistentobject|LibTF.PersistentObject]]:** hasPersistent(), getPersistent(), setPersistent(), resetPersistent() | |
| |
| |
==== (Person).applyChanges( thirdPerson = false ) ==== | |
| |
* **Arguments:** | |
* **//thirdPerson://** If set to true, the (unimplemented) changes description will be return in third-person tense rather than second-person. | |
* **Returns:** (String) An empty string, which is currently a bug/todo. Should return a description of the changes. | |
* **Throws:** Nothing. | |
| |
When //applyTransformationsImmediately// is false, this function causes all of the queued transformations to be applied to the Person. This is useful for games where transformations happen as the PC sleeps, based on the happenings of the day, and that sort of thing. | |
| |
<code javascript> | |
tf("joe").applyChanges(); | |
</code> | |
| |
| |
==== (Person).getDescriptionGeneral( thirdPerson=false, suppressTFStats=false ) ==== | |
| |
* **Arguments:** | |
* **//thirdPerson://** FIXME. | |
* **//suppressTFStats://** FIXME. | |
* **Returns:** (type) desc. | |
* **Throws:** Error if: FIXME. | |
| |
FIXME desc | |
| |
<code javascript> | |
FIXME Example | |
</code> | |
| |
| |
==== (Person).getDescriptionApparel( thirdPerson=false, suppressTFStats=false ) ==== | |
| |
* **Arguments:** | |
* **//thirdPerson://** FIXME. | |
* **//suppressTFStats://** FIXME. | |
* **Returns:** (type) desc. | |
* **Throws:** Error if: FIXME. | |
| |
FIXME desc | |
| |
<code javascript> | |
FIXME Example | |
</code> | |
| |
| |
==== (Person).getDescriptionSexual( thirdPerson=false, suppressTFStats=false ) ==== | |
| |
* **Arguments:** | |
* **//thirdPerson://** FIXME. | |
* **//suppressTFStats://** FIXME. | |
* **Returns:** (type) desc. | |
* **Throws:** Error if: FIXME. | |
| |
FIXME desc | |
| |
<code javascript> | |
FIXME Example | |
</code> | |
| |
| |
[[libtf:documentation:api:start|<-- Back]] | |
| |