Difference between revisions of "GetUseSound- Potion"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Kerberus14
imported>Kerberus14
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
Script example of debugging GetUseSound():
[[Category:Scripting]]
[[Category:Papyrus]]
'''Member of:''' [[Potion Script]]


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


#FoodIs = akBaseObject as Potion
== Return Value ==
#Int Index = FoodFormList.GetSize()
Returns the Form ID of the SoundDescriptor that the potion uses.
#IsMeat=0
 
#IsLiquid=0
== Example ==
#IsSoup=0
<source lang="papyrus">
#While Index
 
# Index-=1
Debugging GetUseSound()
# if FoodIs.GetUseSound()==FoodFormList.GetAt(2) && IsMeat!=1
 
# Debug.Messagebox("IsMeat")
The FormList we're using has "NPCHumanEatSoup", "ITMPotionUse" and "ITMFoodEat" as Sound Descriptors.
# IsMeat=1
"NPCHumanEatSoup" is playing when the player eats a stew or soup item.
# elseif FoodIs.GetUseSound()==FoodFormList.GetAt(1) && IsLiquid!=1
"ITMPotionUse" is playing when the player drinks a potion or any liquid item such as ale or wine.
# Debug.Messagebox("IsLiquid")
"ITMFoodEat" is playing when the player eats any meat items similar to chicken breast, dog meat or horse meat.
# IsLiquid=1
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
# elseif FoodIs.GetUseSound()==FoodFormList.GetAt(0) && IsSoup!=1
 
# IsSoup=1
FoodIs = akBaseObject as Potion
# Debug.Messagebox("IsSoup")
Int Index = FoodFormList.GetSize()
# endif
Int IsMeat=0
#endwhile
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
</source>

Latest revision as of 16:37, 7 May 2015

Member of: Potion Script

Syntax[edit | edit source]

Form Function GetUseSound()


Parameters[edit | edit source]

None.

Return Value[edit | edit source]

Returns the Form ID of the SoundDescriptor that the potion uses.

Example[edit | edit source]

Debugging GetUseSound()

The FormList we're using has "NPCHumanEatSoup", "ITMPotionUse" and "ITMFoodEat" as Sound Descriptors.
"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.
"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)

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