Page 1 of 1

Modifying stats through items

Posted: Thu Nov 06, 2014 2:04 am
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.

Re: Modifying stats through items

Posted: Thu Nov 06, 2014 4:30 pm
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.

Re: Modifying stats through items

Posted: Fri Nov 07, 2014 7:20 pm
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.