How to Install Book of Spirits Mod in Starbound

This guide is for patching the Starbound mod Book of SpiritsNPC & Monster Name Displayer to add in-built support for custom NPCS, Monsters and chatty objects.

مقدمة

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, إلخ) 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.

ايضا, when i mention that something is harmless, that means that your mod will function normally even ifBook of SpiritsNPC & 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, الاموات الاحياء, lackeys, إلخ) 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(Zombies, Bandits, Lackeys, إلخ) 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), يمكنك العثور عليها هنا:

  • /scripts/bookofspirits/bookofspirits_interact_support.lua

This script shows the displayer when interacting(ه) 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(IE: merchant.npctype):

[
[{ "op" : "add", "طريق" : "/displayTitle", "قيمة" : "Merchant"}]
,[{ "op": "add", "طريق": "/scripts/-", "قيمة": "/scripts/bookofspirits/bookofspirits_interact_support.lua" }]
]

Result:

{
  "يكتب" : "تاجر",
  "baseType" : "قاعدة",
  ...
  "displayTitle" : "Merchant",
  "نصوص" : [
    "/npcs/bmain.lua"
    ,"/scripts/bookofspirits/bookofspirits_interact_support.lua" 
  ]
}

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

[{ "op" : "add", "طريق" : "/identity", "قيمة": { "اسم":"Mutant Miner" }}]

Result:

{
  "identity" :
  {
     "اسم":"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(ه) with an Object. If the displayer doesn’t shows up when interacting, you need to add this script to your Object.

تحذير:

  • You cannot use this feature if the object haves aninteractActionparameter.
  • You can only use this feature if the object can be madechatty”, usually have “نصوص” و “chatOptionsarrays.

Chatty Object Patching-Support

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

[
[{ "op" : "add", "طريق" : "/npcName", "قيمة" : "إليوت"}]
,[{ "op" : "add", "طريق" : "/displayTitle", "قيمة" : "Tech Lab Scientist"}]
,[{ "op": "add", "طريق": "/scripts/-", "قيمة": "/scripts/bookofspirits/bookofspirits_interact_support.lua" }]
]

Result:

{
  "objectName" : "techlabscientist",
  "colonyTags" : ["outpost"],
  ...
  "npcName" : "إليوت",
  "displayTitle" : "Tech Lab Scientist",
  "نصوص" : ["/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)

ملحوظة:
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(IE: punchy.monstertype):

[
[{ "op" : "add", "طريق" : "/shortdescription", "قيمة" : "Punchy"}]
,[{ "op" : "add", "طريق" : "/baseParameters/statusSettings/statusProperties/displayTitle", "قيمة" : "Test Dummy"}]
,[{ "op" : "add", "طريق" : "/baseParameters/scripts/-", "قيمة" : "/scripts/bookofspirits/bookofspirits_monster_support.lua"}]
]

Result:

{
  "يكتب" : "punchy",
  "categories" : [],
  ...
   "shortdescription" : "Punchy",
   "baseParameters" : {
       "statusSettings" : {
          "statusProperties" : {
              "displayTitle" : "Test Dummy"
          }
       }
      ,"نصوص" : [
        "/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.

  • اسم: is the string name that will displayed along side the monster name.
  • skillName: is the skill name type(IE: inkSprayAttack) that will be used to compare if the monster haves that skill.
  • asSuffix(خياري): 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(IE: “largeflying”): the name of the list should be the name of the “يكتب” parameter of the .monstertype file.
  • variants: 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.

  • اسم: the monster name that will be displayed.
  • title(خياري): the title that will be displayed.
  • prefix(خياري): a prefix that will be added to the monster name.
  • parts: this is an array of strings that contains the name of the folder containing the part of the monster.
  • addSkillPrefix(خياري): if set to false, it will not add an skill Prefix to the monster name.

ملحوظة:
If you want to set an specific pattern, that particular entry must have all the part types used by the monster type.
IE: largefish: uses 3 parts as configured in theirpartsarray

لذا, the pattern should have 3 parts as well:

{"اسم" : "SunShark", "title" : "Large Fish Monster", "parts" : ["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" : "add", "طريق" : "/baseParameters/scripts/-", "قيمة" : "/scripts/bookofspirits/bookofspirits_monster_support.lua"}]
]

Result:

{
  "يكتب" : "sb_hugebiped",
  "categories" : ["sb_hugebiped"],
   ...
  ,"baseParameters" : {
    "نصوص" : [
      "/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": "add",
        "طريق": "/monsterTypes/sb_hugebiped",
        "قيمة": {
            "variants": [
                {
                    "اسم": "Birdzilla",
                    "title": "Huge Biped Monster",
                    "parts": ["beak"]
                },
                {
                    "اسم": "Dragonzilla",
                    "title": "Huge Biped Monster",
                    "parts": ["dragon"]
                },
                {
                    "اسم": "Featherzilla",
                    "title": "Huge Biped Monster",
                    "parts": ["feather"]
                },
				{
                    "اسم": "Rhinozilla",
                    "title": "Huge Biped Monster",
                    "parts": ["rhino"]
                }
            ]
        }
    }
]

Result:

{
  ,"monsterTypes" :
  {
   "largeflying" : {...}
    ...
    ,"sb_hugebiped" : {
      "variants" : [
        {"اسم" : "Birdzilla","title" : "^red;Huge Biped Monster","parts" : ["beak"]}
        ,{"اسم" : "Dragonzilla", "title" : "^red;Huge Biped Monster","parts" : ["dragon"]}
        ,{"اسم" : "Featherzilla","title" : "^red;Huge Biped Monster","parts" : ["feather"]}
        ,{"اسم" : "Rhinozilla","title" : "^red;Huge Biped Monster","parts" : ["rhino"]}
       ]
     }
  }
}

Generated Monster Patching-Support Existing Type

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

[
    {
	"op": "add", "طريق": "/monsterTypes/largequadruped/variants/-",
	"قيمة": {"اسم": "New Quadruped 1","title": "Large Quadruped Monster",	"parts": ["blabla1"]}
    }
	,{
	"op": "add", "طريق": "/monsterTypes/largequadruped/variants/-",
	"قيمة": {"اسم": "New Quadruped 2","title": "Large Quadruped Monster",	"parts": ["blabla2"]}
    }
]

Result:

  ,"monsterTypes" :
  {
    "largeflying" : {...}
   ...
    ,"largequadruped" : {
      "variants" : [
        {"اسم" : "Anthurix","prefix" : "Adult", "title" : "Large Quadruped Monster","parts" : ["arrow"]}
        ...
      ,{"اسم": "New Quadruped 1","title": "Large Quadruped Monster",	"parts": ["blabla1"]}
      ,{"اسم": "New Quadruped 2","title": "Large Quadruped Monster",	"parts": ["blabla2"]}
هذا الدليل حول Starbound كتب بواسطة Chofranc. يمكنك زيارة المنشور الأصلي من هذا حلقة الوصل. إذا كان لديك أي مخاوف بشأن هذا الدليل, من فضلك لا تتردد في الاتصال بنا هنا.

عن المؤلف