protection on shield not working ? - solved

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

protection on shield not working ? - solved

Post by Drakkan »

Have i missed something ?
why when I set protection for some shield its not working ? :/

example:

Code: Select all

defineObject{
	name = "test_shield",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/crystal_shield.fbx",
		},
		{
			class = "Item",
			uiName = "test shiel",
			description = " no proterction bonus when equiped ",
                        gfxAtlas = "mod_assets/icons/drakkanicons.tga",
	                gfxIndex = 54,
			weight = 12,
			traits = { "shield", "epic" },
		},
		{
			class = "EquipmentItem",
			protection = 10,
			immunities = { "petrified" },
		},
	},
}
Last edited by Drakkan on Thu Apr 09, 2015 7:51 am, edited 1 time in total.
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: protection on shield not working ?

Post by Skuggasveinn »

Protection is a part of the armor traits and gets applied when in item is in an armor slot.
Protection is be design ignored when its being held to prevent someone holding a heavy armor and getting the protection bonus.

If you want an Item to apply the protection bonus when being held (also known as a weapon slot) you need to assign the EquipmentItem class to a specific slot by doing slot = "Weapon",

Code: Select all

defineObject{
   name = "test_shield",
   baseObject = "base_item",
   components = {
      {
         class = "Model",
         model = "assets/models/items/crystal_shield.fbx",
      },
      {
         class = "Item",
         uiName = "test shiel",
         description = " no proterction bonus when equiped ",
         gfxAtlas = "mod_assets/icons/drakkanicons.tga",
         gfxIndex = 54,
         weight = 12,
         traits = { "shield", "epic" },
      },
      {
         class = "EquipmentItem",
         slot = "Weapon",                   -- THIS WILL GIVE YOU THE PROTECTION WHEN PLACED IN A WEAPON SLOT    
         protection = 10,
         immunities = { "petrified" },
      },
   },
}

kind regards
Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: protection on shield not working ?

Post by Drakkan »

Skuggasveinn wrote:Protection is a part of the armor traits and gets applied when in item is in an armor slot.
Protection is be design ignored when its being held to prevent someone holding a heavy armor and getting the protection bonus.

If you want an Item to apply the protection bonus when being held (also known as a weapon slot) you need to assign the EquipmentItem class to a specific slot by doing slot = "Weapon",

Code: Select all

defineObject{
   name = "test_shield",
   baseObject = "base_item",
   components = {
      {
         class = "Model",
         model = "assets/models/items/crystal_shield.fbx",
      },
      {
         class = "Item",
         uiName = "test shiel",
         description = " no proterction bonus when equiped ",
         gfxAtlas = "mod_assets/icons/drakkanicons.tga",
         gfxIndex = 54,
         weight = 12,
         traits = { "shield", "epic" },
      },
      {
         class = "EquipmentItem",
         slot = "Weapon",                   -- THIS WILL GIVE YOU THE PROTECTION WHEN PLACED IN A WEAPON SLOT    
         protection = 10,
         immunities = { "petrified" },
      },
   },
}

kind regards
Skuggasveinn.
make sense. thanks Skugg !
Breath from the unpromising waters.
Eye of the Atlantis
Post Reply