Difference between revisions of "GetUseSound- Potion"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Kerberus14
imported>Kerberus14
Line 7: Line 7:
#"ITMFoodEat" is playing when the player eats any meat items similar to chicken breast, dog meat or horse meat.
#"ITMFoodEat" is playing when the player eats any meat items similar to chicken breast, dog meat or horse meat.


== Example ==
<source lang="papyrus">
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)


#Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
FoodIs = akBaseObject as Potion
 
Int Index = FoodFormList.GetSize()
#FoodIs = akBaseObject as Potion
Int IsMeat=0
#Int Index = FoodFormList.GetSize()
Int IsLiquid=0
#IsMeat=0
Int IsSoup=0
#IsLiquid=0
While Index
#IsSoup=0
Index-=1
#While Index
if FoodIs.GetUseSound()==FoodFormList.GetAt(2) && IsMeat!=1
# Index-=1
Debug.Messagebox("IsMeat")
# if FoodIs.GetUseSound()==FoodFormList.GetAt(2) && IsMeat!=1
IsMeat=1
# Debug.Messagebox("IsMeat")
elseif FoodIs.GetUseSound()==FoodFormList.GetAt(1) && IsLiquid!=1
# IsMeat=1
Debug.Messagebox("IsLiquid")
# elseif FoodIs.GetUseSound()==FoodFormList.GetAt(1) && IsLiquid!=1
IsLiquid=1
# Debug.Messagebox("IsLiquid")
elseif FoodIs.GetUseSound()==FoodFormList.GetAt(0) && IsSoup!=1
# IsLiquid=1
IsSoup=1
# elseif FoodIs.GetUseSound()==FoodFormList.GetAt(0) && IsSoup!=1
Debug.Messagebox("IsSoup")
# IsSoup=1
endif
# Debug.Messagebox("IsSoup")
endwhile
# endif
</source>
#endwhile

Revision as of 16:20, 7 May 2015

Script example of debugging GetUseSound():

  1. File:Http://puu.sh/hFanV/5ef356185f.png
  2. The FormList we're using has "NPCHumanEatSoup", "ITMPotionUse" and "ITMFoodEat".
  3. "NPCHumanEatSoup" is playing when the player eats a stew or soup item.
  4. "ITMPotionUse" is playing when the player drinks a potion or any liquid item such as ale or wine.
  5. "ITMFoodEat" is playing when the player eats any meat items similar to chicken breast, dog meat or horse meat.

Example

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)

FoodIs = akBaseObject as Potion
Int Index = FoodFormList.GetSize()
Int IsMeat=0
Int IsLiquid=0
Int IsSoup=0
While Index
	Index-=1
		if FoodIs.GetUseSound()==FoodFormList.GetAt(2) && IsMeat!=1
	Debug.Messagebox("IsMeat")
	IsMeat=1
		elseif FoodIs.GetUseSound()==FoodFormList.GetAt(1) && IsLiquid!=1
	Debug.Messagebox("IsLiquid")
	IsLiquid=1
		elseif FoodIs.GetUseSound()==FoodFormList.GetAt(0) && IsSoup!=1
	IsSoup=1
	Debug.Messagebox("IsSoup")
		endif
endwhile