Come installare la mod Libro degli spiriti in Starbound

Questa guida riguarda l'aggiornamento della mod Starbound Book of Spirits – PNG & Visualizzatore nomi mostri per aggiungere il supporto integrato per NPC personalizzati, Monsters and chatty objects.

introduzione

This mod have high priority and should load before any other mods that uses its features so isn’t necesary to include it in your metadata file. The main features of this mod includes displaying the name of the entity, a custom title if it haves one and in the case of monsters, it displays if they are of a rare breed(Albino Poptop, Fire Gleap, eccetera) and elite.

There are two displayers, name displayer and title displayer which will automatically show depending on the configuration of the entity which i will describe in the sections below.

Anche, when i mention that something is harmless, that means that your mod will function normally even ifBook of Spirits – PNG & Monster Name Displayerisn’t installed.

I recommend you to unpack the mod since there are some files that you may need to copy into your mod and it can help you to understand better what you need to patch.

Naming rules for hostile NPCS:
I set a fixed name for generic hostile NPCs(bandits, zombies, lackeys, eccetera) since in most video games only important hostile NPCs have name to highlight their importance over mobs.

NPC parameters

The name displayer picks any of the following configuration of the NPC as their name:

  • npcname variable.
  • name variable that can be assigned within their identity table.
  • the random generated name that is assigned to them.

This is a personal preference but you may want to set a name for generic hostile NPCs(Zombie, Banditi, Lackeys, eccetera) that act as monsters.

The title displayer picks the following variable that is added by this mod which is harmless:

  • displayTitle

There is also a new harmless behaviour script that is added by this mod that you must copy if there is an NPC that is overriding the base behaviour script(Merchants for example), Potete trovare qui:

  • /scripts/bookofspirits/bookofspirits_interact_support.lua

This script shows the displayer when interacting(E) with an NPC. If the displayer doesn’t shows up when interacting, you need to add this script to your NPC.

NPC Patching-Support

The following is the patching proccess but you can add it directly into your mod, i think that is easier to understand the variable positions this way.

To give an NPC a title and if is overriding the behaviour script(CIOÈ: merchant.npctype):

[
[{ "op" : "aggiungere", "sentiero" : "/displayTitle", "valore" : "Merchant"}]
,[{ "op": "aggiungere", "sentiero": "/scripts/-", "valore": "/scripts/bookofspirits/bookofspirits_interact_support.lua" }]
]

Risultato:

{
  "genere" : "merchant",
  "baseType" : "base",
  ...
  "displayTitle" : "Merchant",
  "scripts" : [
    "/npcs/bmain.lua"
    ,"/scripts/bookofspirits/bookofspirits_interact_support.lua" 
  ]
}

To set a fixed name for the npc(mutantminer.npctype):

[{ "op" : "aggiungere", "sentiero" : "/identity", "valore": { "nome":"Mutant Miner" }}]

Risultato:

{
  "identity" :
  {
     "nome":"Mutant Miner"
  }
}

Chatty Objects Parameters

The following variables and script are harmless and are added by this mod:

The name displayer picks the following configuration of the object as their npc name:

  • npcName

The title displayer picks the following variable that is added by this mod which is harmless:

  • displayTitle

There is also a new script that that you must copy into your mod:

  • /scripts/bookofspirits/bookofspirits_interact_support.lua

This script shows the displayer when interacting(E) with an Object. If the displayer doesn’t shows up when interacting, you need to add this script to your Object.

Avvertimento:

  • You cannot use this feature if the object haves aninteractActionparameter.
  • You can only use this feature if the object can be madechatty”, usually havescripts” e “chatOptionsarrays.

Chatty Object Patching-Support

To give an object a name and title(CIOÈ: techlabscientist.object):

[
[{ "op" : "aggiungere", "sentiero" : "/npcName", "valore" : "Elliot"}]
,[{ "op" : "aggiungere", "sentiero" : "/displayTitle", "valore" : "Tech Lab Scientist"}]
,[{ "op": "aggiungere", "sentiero": "/scripts/-", "valore": "/scripts/bookofspirits/bookofspirits_interact_support.lua" }]
]

Risultato:

{
  "objectName" : "techlabscientist",
  "colonyTags" : ["avamposto"],
  ...
  "npcName" : "Elliot",
  "displayTitle" : "Tech Lab Scientist",
  "scripts" : ["/scripts/chattyObject.lua","/scripts/bookofspirits/bookofspirits_interact_support.lua"]
}

Monster Parameters

The name displayer picks the following configuration of the monster as their name:

  • shortdescription

The title displayer picks the following variable that is added by this mod which is harmless:

  • displayTitle(this is added as an statusProperties)

Nota:
Rare Monsters variants have a custom title in the format(check /monsters/flyers/agrobat/iceagrobat.monstertype.patch):
^yellow; Rare Breed^reset;

There is also a new harmless script that is added by this mod that you must copy if there is a Monster that can be set as elite or that can have dynamic custom titles and dynamic names such as Generated monsters:

  • /scripts/bookofspirits/bookofspirits_monster_support.lua

There is also a new file that contains additional configurations for Generated Monsters that you must check if adding new types of generated monsters, it will be explained in more detail in their corresponding section:

  • /monsters/bookofspirits_generated.config

Monster Patching-Support

To give a Monster a name, title and display it as elite if is configured as elite(CIOÈ: punchy.monstertype):

[
[{ "op" : "aggiungere", "sentiero" : "/shortdescription", "valore" : "Punchy"}]
,[{ "op" : "aggiungere", "sentiero" : "/baseParameters/statusSettings/statusProperties/displayTitle", "valore" : "Test Dummy"}]
,[{ "op" : "aggiungere", "sentiero" : "/baseParameters/scripts/-", "valore" : "/scripts/bookofspirits/bookofspirits_monster_support.lua"}]
]

Risultato:

{
  "genere" : "punchy",
  "categories" : [],
  ...
   "shortdescription" : "Punchy",
   "baseParameters" : {
       "statusSettings" : {
          "statusProperties" : {
              "displayTitle" : "Test Dummy"
          }
       }
      ,"scripts" : [
        "/monsters/monster.lua",
       ,"/scripts/bookofspirits/bookofspirits_monster_support.lua"
      ]
   }
}

Generated Monster Parameters

Generated Monsters have a whole new configuration file that contains parameters to set the name and custom title for generated monsters based on their parts.

The config file: /monsters/bookofspirits_generated.config

There is also a new script: “/scripts/bookofspirits/bookofspirits_monster_support.luathat must be copied into your mod and added into the script array of the generated monster.

skillPrefixes

This is a JSON array of objects that contains a list of the skill types from the special skill of the monster that will be used to determine the prefix of the monster name.

  • nome: is the string name that will displayed along side the monster name.
  • skillName: is the skill name type(CIOÈ: inkSprayAttack) that will be used to compare if the monster haves that skill.
  • asSuffix(opzionale): if set to true, the skill name will be added after the monster name.

monsterTypes

This contains a list with the name of the monster type and its variants. This list is used to determine the monster name and title based on the head part of the monster or an specific part pattern of your choice.

  • monster type(CIOÈ: “largeflying”): the name of the list should be the name of the “genere” parameter of the .monstertype file.
  • varianti: in this JSON array of objects, you put the different part combinations that the generated monster can have.

Variants Parameters

This JSON array of objects contains a series of variables which will be used to configure the generated monster name and title based on the parts given in their entry. It supports multiple parts pattern but its recommended to put entries with just the head part first.

  • nome: the monster name that will be displayed.
  • titolo(opzionale): the title that will be displayed.
  • prefisso(opzionale): a prefix that will be added to the monster name.
  • parti: this is an array of strings that contains the name of the folder containing the part of the monster.
  • addSkillPrefix(opzionale): if set to false, it will not add an skill Prefix to the monster name.

Nota:
If you want to set an specific pattern, that particular entry must have all the part types used by the monster type.
CIOÈ: largefish: utilizza 3 parts as configured in their “parti” array

Così, the pattern should have 3 parts as well:

{"nome" : "SunShark", "titolo" : "Large Fish Monster", "parti" : ["shark","sunfish","sunfish"]}

Generated Monsters Patching-Support For New Types

For this example i will use thesb_hugebiped.monstertypeof Betabound which is a new type of generated monster.

Remember to copy “/scripts/bookofspirits/bookofspirits_monster_support.luainto your mod in the same folder path.

To give support for a new generated monster type(add it directly into your mod or patch it if you are patching other user’s mod):

[
[{ "op" : "aggiungere", "sentiero" : "/baseParameters/scripts/-", "valore" : "/scripts/bookofspirits/bookofspirits_monster_support.lua"}]
]

Risultato:

{
  "genere" : "sb_hugebiped",
  "categories" : ["sb_hugebiped"],
   ...
  ,"baseParameters" : {
    "scripts" : [
      "/monsters/monster.lua",
      "/monsters/sb_miniboss.lua"
     ,"/scripts/bookofspirits/bookofspirits_monster_support.lua"
     ]
   }
}

Then you must patch the file/monsters/bookofspirits_generated.configas a file/monsters/bookofspirits_generated.config.patch“:

[
    {
        "op": "aggiungere",
        "sentiero": "/monsterTypes/sb_hugebiped",
        "valore": {
            "varianti": [
                {
                    "nome": "Birdzilla",
                    "titolo": "Huge Biped Monster",
                    "parti": ["beak"]
                },
                {
                    "nome": "Dragonzilla",
                    "titolo": "Huge Biped Monster",
                    "parti": ["Drago"]
                },
                {
                    "nome": "Featherzilla",
                    "titolo": "Huge Biped Monster",
                    "parti": ["feather"]
                },
				{
                    "nome": "Rhinozilla",
                    "titolo": "Huge Biped Monster",
                    "parti": ["rhino"]
                }
            ]
        }
    }
]

Risultato:

{
  ,"monsterTypes" :
  {
   "largeflying" : {...}
    ...
    ,"sb_hugebiped" : {
      "varianti" : [
        {"nome" : "Birdzilla","titolo" : "^red;Huge Biped Monster","parti" : ["beak"]}
        ,{"nome" : "Dragonzilla", "titolo" : "^red;Huge Biped Monster","parti" : ["Drago"]}
        ,{"nome" : "Featherzilla","titolo" : "^red;Huge Biped Monster","parti" : ["feather"]}
        ,{"nome" : "Rhinozilla","titolo" : "^red;Huge Biped Monster","parti" : ["rhino"]}
       ]
     }
  }
}

Generated Monster Patching-Support Existing Type

To add a new variant to an existing monster type(CIOÈ: largequadruped.monstertype), you must patch the file/monsters/bookofspirits_generated.configas a file/monsters/bookofspirits_generated.config.patch“:

[
    {
	"op": "aggiungere", "sentiero": "/monsterTypes/largequadruped/variants/-",
	"valore": {"nome": "New Quadruped 1","titolo": "Large Quadruped Monster",	"parti": ["blabla1"]}
    }
	,{
	"op": "aggiungere", "sentiero": "/monsterTypes/largequadruped/variants/-",
	"valore": {"nome": "New Quadruped 2","titolo": "Large Quadruped Monster",	"parti": ["blabla2"]}
    }
]

Risultato:

  ,"monsterTypes" :
  {
    "largeflying" : {...}
   ...
    ,"largequadruped" : {
      "varianti" : [
        {"nome" : "Anthurix","prefisso" : "Adult", "titolo" : "Large Quadruped Monster","parti" : ["freccia"]}
        ...
      ,{"nome": "New Quadruped 1","titolo": "Large Quadruped Monster",	"parti": ["blabla1"]}
      ,{"nome": "New Quadruped 2","titolo": "Large Quadruped Monster",	"parti": ["blabla2"]}
Questa guida su Starbound è stato scritto da Chofranc. Puoi visitare la pubblicazione originale da questo collegamento. In caso di dubbi su questa guida, per favore non esitate a contattarci qui.

Circa l'autore