Modifying stats through items

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
zeltak
Posts: 119
Joined: Fri May 04, 2012 2:33 am

Modifying stats through items

Post by zeltak »

I tried to add EquipmentItem component to a weapon, so I could modify user's stats, for example:

Code: Select all

{
		class = "EquipmentItem",
		energy = -5,
},
but all it does is write it to the item. How can I actually change the user's stats (energy in the example) when wielding the weapon? I tried to check scripting reference for Item, ItemAction and EquipmentItem sections but couldn't figure out how to do it.
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: Modifying stats through items

Post by Prozail »

Code: Select all

defineObject {
	name = "ceremonial_dagger",
	baseObject = "dagger",
	components = {
		{
			class = "EquipmentItem",
			energy = 10,
			health = -10,
			slot = 1,
		}
	}
}
I Believe setting the slot-number is required.. The item above works for me atleast. Also, if it doesn't, try restarting your editor, not just reloading the Project. There are some issues with files being cached sometimes.
User avatar
zeltak
Posts: 119
Joined: Fri May 04, 2012 2:33 am

Re: Modifying stats through items

Post by zeltak »

Thanks, that works. But what does that slot = 1 mean/represent?

edit: Ah, nvm, figured it out.. I was just blind it seems.
Post Reply