Page 1 of 1

No empty flask after using a potion?

Posted: Sat Feb 02, 2013 7:53 pm
by crisman
I just realize now none of my modded potions spawn an empty flask after using them.
A simple example, an antivenom potion casting a poison shield after drinking it.
my code is:

Code: Select all

defineObject{
		name = "potion_cure_poison",
		class = "Item",
		uiName = "Antivenom",
		model = "assets/models/items/flask_full.fbx",
		gfxIndex = 149,
		consumable = true,
		potion = true,
		onUseItem = function(self, champion)	
		playSound("consume_potion")
		champion:setCondition("poison", 0)
		champion:setCondition("poison_shield", 120)
		return true
		end,
		weight = 0.6,
	}
What am I doing wrong? :cry:
it's identical to the original asset, except for the line 'champion:setCondition("poison_shield", 120)'
Thank you all! :D

Re: No empty flask after using a potion?

Posted: Sat Feb 02, 2013 8:01 pm
by LordGarth
add this

emptyItem = "flask"

LordGarth

Re: No empty flask after using a potion?

Posted: Sat Feb 02, 2013 8:16 pm
by LordGarth
put a , after "flask" of course

LG

Re: No empty flask after using a potion?

Posted: Sat Feb 02, 2013 8:28 pm
by crisman
Many thanks, that did the trick ;)

Re: No empty flask after using a potion?

Posted: Sat Feb 02, 2013 8:34 pm
by Komag
so that means this isn't working correctly:
potion: a boolean flag which indicates that the item is a potion. Potions are turned into empty flasks when consumed.
but at least there is a workaround :)

Re: No empty flask after using a potion?

Posted: Sat Feb 02, 2013 8:51 pm
by crisman
That's exactly what I was thinking...
The weird thing is it's the first time I notice that, and I have plenty of modded potions...
Am I too much distracted, or it's a new bug of a recent update?...
Anyway with this workaround it won't bother anymore me if it's a bug or not :mrgreen: