Difference between revisions of "GetUseSound- Potion"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Kerberus14
(Created page with "Script example of debugging GetUseSound(): File:http://puu.sh/hFanV/5ef356185f.png The FormList we're using has "NPCHumanEatSoup", "ITMPotionUse" and "ITMFoodEat". "NPCHu...")
 
imported>Kerberus14
Line 1: Line 1:
Script example of debugging GetUseSound():
Script example of debugging GetUseSound():


[[File:http://puu.sh/hFanV/5ef356185f.png]]
#[[File:http://puu.sh/hFanV/5ef356185f.png]]
The FormList we're using has "NPCHumanEatSoup", "ITMPotionUse" and "ITMFoodEat".
#The FormList we're using has "NPCHumanEatSoup", "ITMPotionUse" and "ITMFoodEat".
"NPCHumanEatSoup" is playing when the player eats a stew or soup item.
#"NPCHumanEatSoup" is playing when the player eats a stew or soup item.
"ITMPotionUse" is playing when the player drinks a potion or any liquid item such as ale or wine.
#"ITMPotionUse" is playing when the player drinks a potion or any liquid item such as ale or wine.
"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.




Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
#Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)


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

Revision as of 16:18, 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.


  1. Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
  1. FoodIs = akBaseObject as Potion
  2. Int Index = FoodFormList.GetSize()
  3. IsMeat=0
  4. IsLiquid=0
  5. IsSoup=0
  6. While Index
  7. Index-=1
  8. if FoodIs.GetUseSound()==FoodFormList.GetAt(2) && IsMeat!=1
  9. Debug.Messagebox("IsMeat")
  10. IsMeat=1
  11. elseif FoodIs.GetUseSound()==FoodFormList.GetAt(1) && IsLiquid!=1
  12. Debug.Messagebox("IsLiquid")
  13. IsLiquid=1
  14. elseif FoodIs.GetUseSound()==FoodFormList.GetAt(0) && IsSoup!=1
  15. IsSoup=1
  16. Debug.Messagebox("IsSoup")
  17. endif
  18. endwhile