User Tools

Site Tools


docs:phenotypes

PhenotypeResource files are used to describe the phenotype features that are to be applied to a Character. They should be stored in /resources/phenotype_db/.

New PhenotypeResources can be created from the Godot GUI by right-clicking the phenotype_db folder and selecting New Resource and then selecting PhenotypeResource from the menu.

Phenotypes can be applied directly to Character nodes in the editor using the Node Inspector. Or they can applied programmatically using the Phenotype Database.

Phenotype Database

All of the PhenotypeResource files that are detected are made available by this database object. You can access a Dictionary containing all of these resources at DB.Phenotypes.list.

The player character's phenotype is a bit special. It is accessed instead via the methods DB.Phenotypes.get_playerphenotype() and DB.Phenotypes.save_player_phenotype().

Class Reference

PhenotypeDB

Constants

  • SECTION: String = “Phenotype”
    • Section of player phenotype config file to find player phenotype settings
  • DEFAULT_SKIN: String = “default_player”
    • Name of default player skin. This file must exist in /resources/phenotype_db/.

Properties

  • list: Dictionary
    • Keys are filenames in phenotype_db folder, values are loaded PhenotypeResources

Methods

  • get_player_phenotype() → PhenotypeResource
    • Reads the player's phenotype from save file and returns it's resource
  • save_player_phenotype(pheno: PhenotypeResource) → void
    • Saves the player's phenotype to the save file
  • save_player_phenotype_as_dict(pheno: Dictionary) → void
    • Saves the player's phenotype to the save file

PhenotypeResource

Properties

  • skin_color: Color
  • hat_color: Color
  • hair_color: Color
  • shirt_color: Color
  • pants_color: Color
  • shoe_color: Color
  • hat_type: String
  • hair_type: String
  • face_type: String
  • shirt_type: String
  • pants_type: String
  • shoe_type: String

Methods

  • as_dictionary() → Dictionary
    • Type casts object to a dictionary
docs/phenotypes.txt · Last modified: 2021/02/25 06:59 by 86.106.143.100