Skip to content

Built In Skill Catalog

Moti Barski edited this page Apr 10, 2025 · 1 revision

LivinGrimoire Skill Catalog Feature

The LivinGrimoire has a built-in skill catalog feature that allows for detailed notes and descriptions of each skill. This feature enhances the interactive experience by providing valuable insights into the capabilities and triggers of each skill.

Adding Skill Notes

To add skill notes, you need to override the skillNotes function of the Skill class:

def skillNotes(self, param: str) -> str:
    return "notes unknown"

Example: DiTime Skill

Here is an example from the DiTime skill (a subclass of Skill):

def skillNotes(self, param: str) -> str:
    if param == "notes":
        return "gets time date or misc"
    elif param == "triggers":
        return random.choice(["what is the time", "which day is it", "what is the date", "evil laugh", "good part of day", "when is the fifth"])
    return "time util skill"

Using a Skill Reader Skill: DiAware

Finally, use a skill reader skill, in this case, DiAware. DiAware is unique because its constructor takes in the very Chobit object housing it, giving it access to all the skills in the Chobit object.

case "what can you do":
    if self.skillDex is None:
        self.skillDex = UniqueRandomGenerator(len(self.chobit.get_skill_list()))
    self.skill_for_info = self.skillDex.get_unique_random()
    self.setSimpleAlg(f'{self.chobit._dClasses[self.skill_for_info].__class__.__name__} {self.chobit._dClasses[self.skill_for_info].skillNotes("notes")}')
case "skill triggers":
    self.setSimpleAlg(self.chobit._dClasses[self.skill_for_info].skillNotes("triggers"))

With this setup, you can ask "what can you do" to get suggestions for skills to engage, and complement it with "skill triggers" to see how to work the skill or know about automatic skills and such. This essentially acts as a built-in skill catalog or skill legend.

Clone this wiki locally