Extensions:Character Pairings

From Lorekeeper Wiki
Jump to navigation Jump to search
Character Pairings
Description Allows two characters to be paired/bred for new MYO slots.
Author(s) Cylunny
Status testing
Github extension/character-pairings
LK Version 2.1.2
Contains a Migration



A character breeding/pairing extension! This extension serves as a baseline and should be flexible enough for simple breeding systems, or for not yet existing ones! If your system is very specific, feel free to edit parts of this for your own use. For the sake of breeding, this also adds the sex field to characters (character images to be clear). This field is optional.

Installation

  • pull & deal with merge conflicts
  • php artisan add-site-settings
  • php artisan migrate
  • php artisan optimize x2
  • php artisan update-extension-tracker

Configuration

While everything should be set up with a default value, you have a lot of configuration options!

Site Settings

Within your site settings, you will find these new fields:

  • pairing_cooldown - 0: Disabled. Number of days to wait between pairing a character.
  • pairing_female_percentage - 0: Disabled, do not roll sex. 1-100: Chance to generate a male offspring. Must total 100 with the pairing_male_percentage setting.
  • pairing_male_percentage - 0: Disabled, do not roll sex. 1-100: Chance to generate a male offspring. Must total 100 with the pairing_female_percentage setting.
  • pairing_sex_restrictions - 0: Any character can be paired. 1: Only male/female characters can be paired.
  • pairing_trait_inheritance - Number between 0-100. Percentage chance to inherit traits from both parents upon generating offspring. Set 100 for always. Set 0 for never (or any value inbetween).

Existing Data

Rarities

Rarities have a new field that allows you to set the inherit chance for any trait of that rarity. For example, a common trait could be inherited 90% of the time, a rare one 25% of the time, etc. They should default to 50% upon running the migrations.

Species

Species have a new field that allows you to set the inherit chance of the species. They should default to 50 upon running the migrations. IMPORTANT NOTE: If one species is set to 50 and the other to 50, then the likelyhood of inheriting one is the same. However, if one species is set to 100 it does NOT mean it is inherited 100% of the time. If the second species is 50, then the total chance is 150, making the first species twice as likely to be inherited instead.

Subtypes

The same functionality as for species applies.

Trait Categories

Trait categories get two new fields that allow you to set a min and a max number of traits from this category that can be inherited. Let's say you have a trait category for wings and your character can only have one wing trait at a time. You can then set the wings category to inherit 0-1. Or, if you would like to always force a wing trait, 1-1. The default for all categories is 0-5.

New Item Tags

Two new item tags were added. One is the pairing item that is required for the user to create a pairing. The other is a boost item that can boost chances.

Pairing Item Tag

Lets you optionally configure what kind of pairing this item allows. The only mandatory setting is the min and max offspring/MYO slots that should be generated.

Basics

  • min and max amount of offspring - Will pick a number between the two on every myo creation.

Optional The following can be left empty, in which case the traits, species and subtype are solely based on the two parent characters.

  • Offspring Trait - meant to be used as a marker if two species/subtypes were paired and you would like to somehow make that apparent via a special trait. Does not affect pairings of the same species and subtype!
  • Offspring Species - Forces this species onto every offspring generated. This species will be elegible for ALL traits!
  • Offspring Subtype - Forces this subtype onto every offspring unless the offspring species does not match

Restrictions

  • Species Exclusions - enter all species here that this item should not allow to be passed on. If one parent is an excluded species and the other is not, the offspring always is the legal species. If both parents are not valid, you may set a default species to be used instead. If there is no default species, it should not allow the pairing.
  • Subtype Exclusions - enter all subtypes here that this item should not allow to be passed on. Works the same as species including an optional default, but the subtype must match the species.
  • Trait Exclusions - enter all traits that should never be passed on here.
Boost Item Tag

Lets you create items that influence the chance of inheriting a trait of a certain rarity, or the chance of a site setting. Values set here always override the default rarity or setting chance. You could use this to make boost items that make females more likely, or that make rare traits more likely to appear. You must set either a setting or a rarity chance to be overwritten!

Settings Asks for a site setting to be overwritten and the new chance for it.

Rarities Asks for a rarity to be overwritten and the new chance for it.

Usage

Admins/Mods

Other than configurating everything to fit your needs, mods and admins have access to a test roller for the pairings. You can find it in the admin panel. The test roller must have an available pairing/boost item to use, so it is recommended you create those but keep them unreleased for now. Picking items and characters here will not use any actual item, and does not create an actual MYO. Make sure to test your system thoroughly until it yields the results you want! (Please also test with an actual pairing via the user route below).

Members

Members can find their pairings under home -> pairings. They can only create a pairing if they posess a pairing item. The process from pairing to MYO slot goes as follows:

  • In the new tab, the user may add two characters and pick one pairing item + as many boosts as they wish from their inventory.
  • If both characters are owned by the user, the pairing is immediately ready for MYO creation. Otherwise an approval notification is sent to the other user. They can deny or accept the pairing in the approval tab.
  • If the pairing is accepted, the pairing item and boosts are used up. It can be turned into one or more MYO slots depending on the configuration. This happens on the open tab.
  • If the pairing is rejected, the items are given back to the user.
  • Used or rejected pairings are listed in the closed tab.
  • Users are notified if a pairing of theirs has been approved or rejected, or if another user wishes to pair with one of their characters.


Troubleshooting

= MYO creation on local not working

So this is a strange one I noticed as well. If the local is run using php artisan serve instead of through the document root xamp, it seems that the app has issues copying the default placeholder files to the new MYO slot, causing an infinite loading until it exits at 60s. This is also true when creating a MYO slot with the normal admin page for it! I recommend testing locally through automatic serving from the apache server as that seems to work. It should also work without issues on digitalocean and dreamhost.

As the process with all its options is rather complex, I expect issues here and there. If you find something, feel free to contact me- I am cylunny on discord or toyhou.se!

Images

The pairing page on the user side!

See Also

If this extension helped you, feel free to support me on Kofi!