Species Mod JSON Format: Difference between revisions
mNo edit summary |
Tag: Rollback |
||
(16 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Species JSON supports a variety of parameters to create custom transformations. | Species JSON supports a variety of parameters to create custom transformations. | ||
NOTE - Species Modding was introduced for build r24. | |||
A "type" of "SPECIES" should be used when creating an entity mod. | == Fixed fields == | ||
A "type" of "SPECIES" should be used when creating an entity mod. Here are the [[TF Type]] that exist natively. | |||
An "id" field should also be specified with the name of the transformation. | An "id" field should also be specified with the name of the transformation. Be careful not to use the same id as another mod -- if you use the same mod name as your mod wiki page, you can be assured of no conflicts. | ||
== Body part description - Fixed or Dynamic options == | |||
A field of "transformedBodyPartDescriptions" can contain definitions for each body part, OR a lua function can be defined for 'getBodyPartDescription'. Usually transformedBodyPartDescriptions is used, unless you need to handle a multi-phased transformation for a particular body part (for instance, growing a small tail, then the tail becoming bigger). | A field of "transformedBodyPartDescriptions" can contain definitions for each body part, OR a lua function can be defined for 'getBodyPartDescription'. Usually transformedBodyPartDescriptions is used, unless you need to handle a multi-phased transformation for a particular body part (for instance, growing a small tail, then the tail becoming bigger). | ||
== Dynamic fields == | |||
{| class="wikitable" | {| class="wikitable" | ||
!Return Type | !Return Type | ||
Line 15: | Line 18: | ||
|string | |string | ||
|'''getBodyPartDescription(string bodyPartName, int severity)''' | |'''getBodyPartDescription(string bodyPartName, int severity)''' | ||
Gets description of body part of that species, ie cat ears are "protruding pink and white fur covered triangular ears" | |||
NOTE - If transformedBodyPartDescriptions is used, it will be used instead of this function, unless the body part is undefined. | |||
|- | |||
|void | |||
|'''causeTF''' | |||
Causes the player to be transformed a little bit. This function should find some body part (or multiple body parts), change their state, and output relevant text to the screen. If the player is fully transformed already, it should not output any text. | |||
This function should be defined by every species. | |||
|- | |||
|boolean | |||
|'''getIsFullyTransformed''' | |||
This function should return whether or not player is 100% the target form. Often used to determine whether to continue calling causeTF() in a forced transformation sequence (ie: lose to a transforming monster). | |||
This function should be defined by every species. | |||
|- | |||
|void | |||
|'''speciesNatureTick''' | |||
If player is more than 50% this type of species, then this will be called during gameTick(). This can be useful for species-specific features like turning on/off heat for catgirls, or starting a pregnancy for dragon queens. | |||
|- | |||
|void | |||
|'''bodyPartTick([[BodyPart]] bodyPart)''' | |||
This will be called every game tick for each body part that is TF-ed to this species type. Generally isn't used in favor of using speciesNatureTick instead. | |||
|- | |||
|boolean | |||
|'''hasAlternateVoice''' | |||
With a non-human voice, players will have difficulty communicating with humans. (False for normal english speech) | |||
|- | |- | ||
|string | |string | ||
|''' | |'''getAlternateVocal''' | ||
If the player has a non-human voice, what kind of noise do they make when trying to communicate? | |||
|- | |||
|boolean | |||
|'''hasUselessHands''' | |||
If true, will prevent the player from interacting with some objects in the game which require fine motor skills. For instance, return true if the player has hooves for hands. | |||
|- | |- | ||
|boolean | |||
|'''getIsBipedal''' | |||
Called on player's active legs to determine if player is quadrapedal / allfours mode. Defaults to bipedal. | |||
(Introduced in r30) | |||
|- | |||
|boolean | |||
|'''checkPlayerMobile([[Map (Class)|Map]] originalMap, int originalRoomID, [[Map (Class)|Map]] newMap, int newRoom)''' | |||
Called when player attempts to move between rooms. This function can prevent player movement by returning false. If false is returned, a continue scene will be displayed so as to allow displayed text to be viewed by played, before returning to the map scene in the original room. Otherwise, it is not expected this function will output text to screen if movement is allowed, as it would most likely be eaten by the map scene for the next room. | |||
Currently only called on the species of the player's legs, however, this may be expanded in future to be called once per movement for every active species, so please write your code to accommodate this. Note, if not explicitly defined, the default version of this function provides checking for if player is in all fours but has a large belly / breasts. (In future, there should be a way for mods to call this check if they want to override checkPlayerMobile() -- maybe via superclass call?) | |||
Generally, this function only needs to be overridden if you want to have an allfours/non-bipedal TF that isn't impeded by large breasts/belly (or has different chance for being impeded) | |||
(Introduced in r30, updated in r36 to pass additional parameters) | |||
|- | |||
|void | |||
|'''tickMovement''' | |||
Called when player movement is successful. Cannot be used to prevent player movement (for that, use checkPlayerMobile above). Used to add movement specific flavor text. | |||
Currently only called on the species of the player's legs, however, this may be expanded in future to be called once per movement for every active species, so please write your code to accommodate this. Note, if not explicitly defined, the default version of function provides flavor text / lust increase for if the player is on all fours and has large breasts or belly. (In future, there should be a way for mods to call this flavor text if they want to override tickMovement() -- maybe via superclass call?) | |||
(Introduced in r30) | |||
|- | |||
|string | |||
|'''getHeightDescription''' | |||
Returns the string the prefaces the player's current height. Examples: | |||
* You stand | |||
* You crawl along on all fours | |||
* You worm along | |||
This phrase is followed by 'at <height> tall,...' | |||
Do not include a trailing space, it will be included by the calling function. | |||
If not explicitly defined, the default version of this function will return: | |||
* You stand (for bipedal mode) | |||
* You walk on all fours (for non-bipedal mode) | |||
(Introduced in r30) | |||
|- | |||
|string | |||
|'''getPostureDescription''' | |||
Returns string representation of player's posture. Default is 'stand'. This is referred to when describing the player's legs, ie: 'You stand on human legs...' | |||
If not explicitly defined, the default version of this function returns 'stand' | |||
(Introduced in r30) | |||
|-|}|}|}|}|}|}|}|}|}|}|} |
Latest revision as of 02:33, 3 August 2023
Species JSON supports a variety of parameters to create custom transformations.
NOTE - Species Modding was introduced for build r24.
Fixed fields
A "type" of "SPECIES" should be used when creating an entity mod. Here are the TF Type that exist natively.
An "id" field should also be specified with the name of the transformation. Be careful not to use the same id as another mod -- if you use the same mod name as your mod wiki page, you can be assured of no conflicts.
Body part description - Fixed or Dynamic options
A field of "transformedBodyPartDescriptions" can contain definitions for each body part, OR a lua function can be defined for 'getBodyPartDescription'. Usually transformedBodyPartDescriptions is used, unless you need to handle a multi-phased transformation for a particular body part (for instance, growing a small tail, then the tail becoming bigger).
Dynamic fields
Return Type | Parameter |
---|---|
string | getBodyPartDescription(string bodyPartName, int severity)
Gets description of body part of that species, ie cat ears are "protruding pink and white fur covered triangular ears" NOTE - If transformedBodyPartDescriptions is used, it will be used instead of this function, unless the body part is undefined. |
void | causeTF
Causes the player to be transformed a little bit. This function should find some body part (or multiple body parts), change their state, and output relevant text to the screen. If the player is fully transformed already, it should not output any text. This function should be defined by every species. |
boolean | getIsFullyTransformed
This function should return whether or not player is 100% the target form. Often used to determine whether to continue calling causeTF() in a forced transformation sequence (ie: lose to a transforming monster). This function should be defined by every species. |
void | speciesNatureTick
If player is more than 50% this type of species, then this will be called during gameTick(). This can be useful for species-specific features like turning on/off heat for catgirls, or starting a pregnancy for dragon queens. |
void | bodyPartTick(BodyPart bodyPart)
This will be called every game tick for each body part that is TF-ed to this species type. Generally isn't used in favor of using speciesNatureTick instead. |
boolean | hasAlternateVoice
With a non-human voice, players will have difficulty communicating with humans. (False for normal english speech) |
string | getAlternateVocal
If the player has a non-human voice, what kind of noise do they make when trying to communicate? |
boolean | hasUselessHands
If true, will prevent the player from interacting with some objects in the game which require fine motor skills. For instance, return true if the player has hooves for hands. |
boolean | getIsBipedal
Called on player's active legs to determine if player is quadrapedal / allfours mode. Defaults to bipedal. (Introduced in r30) |
boolean | checkPlayerMobile(Map originalMap, int originalRoomID, Map newMap, int newRoom)
Called when player attempts to move between rooms. This function can prevent player movement by returning false. If false is returned, a continue scene will be displayed so as to allow displayed text to be viewed by played, before returning to the map scene in the original room. Otherwise, it is not expected this function will output text to screen if movement is allowed, as it would most likely be eaten by the map scene for the next room. Currently only called on the species of the player's legs, however, this may be expanded in future to be called once per movement for every active species, so please write your code to accommodate this. Note, if not explicitly defined, the default version of this function provides checking for if player is in all fours but has a large belly / breasts. (In future, there should be a way for mods to call this check if they want to override checkPlayerMobile() -- maybe via superclass call?) Generally, this function only needs to be overridden if you want to have an allfours/non-bipedal TF that isn't impeded by large breasts/belly (or has different chance for being impeded) (Introduced in r30, updated in r36 to pass additional parameters) |
void | tickMovement
Called when player movement is successful. Cannot be used to prevent player movement (for that, use checkPlayerMobile above). Used to add movement specific flavor text. Currently only called on the species of the player's legs, however, this may be expanded in future to be called once per movement for every active species, so please write your code to accommodate this. Note, if not explicitly defined, the default version of function provides flavor text / lust increase for if the player is on all fours and has large breasts or belly. (In future, there should be a way for mods to call this flavor text if they want to override tickMovement() -- maybe via superclass call?) (Introduced in r30) |
string | getHeightDescription
Returns the string the prefaces the player's current height. Examples:
This phrase is followed by 'at <height> tall,...' Do not include a trailing space, it will be included by the calling function. If not explicitly defined, the default version of this function will return:
(Introduced in r30) |
string | getPostureDescription
Returns string representation of player's posture. Default is 'stand'. This is referred to when describing the player's legs, ie: 'You stand on human legs...' If not explicitly defined, the default version of this function returns 'stand' (Introduced in r30) |