How do I check if the item has been flagged as "Food&#34

Post » Sun Nov 18, 2012 10:43 am

I want to apply a spell to the player when the player consumes an item that is flagged as "food". The trick is that I want to do it without editing the food items. Basically, if a player consumes ANY potion that is of type "food", he is affected by the spell for X number of seconds.

It's a tricky problem, I tried several perk-based solutions and even a timed ability, but nothing worked so far. Does anyone have an idea on how to solve this?
User avatar
Emily Jones
 
Posts: 3425
Joined: Mon Jul 17, 2006 3:33 pm

Post » Sun Nov 18, 2012 10:35 am

in the old language, there was "getisformtype" (e.g. getisformtype ALCH, returned 1 or 0), not sure about the papyrus-anologue though
User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Sun Nov 18, 2012 9:10 am

Is there a keyword for Food-Items?
User avatar
e.Double
 
Posts: 3318
Joined: Tue Jul 24, 2007 11:17 pm

Post » Sun Nov 18, 2012 8:27 pm

SKSE's http://www.creationkit.com/IsFood_-_Potion works perfectly. Other than that, you could put all the food items in a FormList and check if they are/aren't in there, but IsFood will also cover mod added Potion forms.
User avatar
Zoe Ratcliffe
 
Posts: 3370
Joined: Mon Feb 19, 2007 12:45 am

Post » Sun Nov 18, 2012 4:31 pm

in the old language, there was "getisformtype" (e.g. getisformtype ALCH, returned 1 or 0), not sure about the papyrus-anologue though
gettype it is for papyrus, http://www.creationkit.com/GetType_-_Form you go
User avatar
Cassie Boyle
 
Posts: 3468
Joined: Sun Nov 05, 2006 9:33 am

Post » Sun Nov 18, 2012 9:37 am

VendorItemFood and VendorItemFoodRaw

Is there a keyword for Food-Items?
User avatar
Hannah Barnard
 
Posts: 3421
Joined: Fri Feb 09, 2007 9:42 am

Post » Sun Nov 18, 2012 6:32 pm

So it will be something like...

Spoiler

Keyword property VendorItemFood autoKeyword property VendorItemFoodRaw autoBool Function myFoodTest(Form akItem)	if (akItem as Potion || akItem as Ingredient) ; fast		return true	elseif (akItem.hasKeyword(VendorItemFood) || akItem.hasKeyword(VendorItemFoodRaw)) ; slow		return true	endif	return falseendFunction
User avatar
Darlene Delk
 
Posts: 3413
Joined: Mon Aug 27, 2007 3:48 am


Return to V - Skyrim