Jump to content

Sound descriptor... issues (can't find sound in alias fill dialog/formlist of sounds not working.)


corrado33

Recommended Posts

I've literally just copied most of this example script into my script.

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

A snippit of my script. (Literally the only difference is the first 2 lines and the name of the FoodFormList)

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

Yet mine doesn't work. However, if I print the name of the result of the "GetUseSound()" function, it'll print [sound Descriptor: 000CAF94] (or something similar, I forget the exact syntax). And 000CAF94 IS the 3rd entry in my formlist (entry #2).

 

By all accounts...... this should work. What in the royal hell is going on? (Can you tell I'm frusterated?)

 

So I've done a few... debugging steps.

 

I added these lines to my code.

				debug.messagebox("Formlist sound 3: " + RASFoodFormList.GetAt(2))
				debug.messagebox("Formlist length: " + RASFoodFormList.GetSize())

And the first results in "None"

And the second results in 0.

 

Yes, I made the formlist.

Yes, I added the script property correctly.

Yes, I'm using the most recent version of the .esp file.

 

And I know you're not going to believe me.... because I had to check like 6 times...

 

Therefore, proof.

Food_Form_List.png

 

So, I said "Screw the formlist" and tried to add the sound descriptors manually as individual properties.

 

I couldn't. Even if I had the following code:

sound property mysound auto

I could NOT select ITMFoodEat as the property in the script properties dialog. It just.... wasn't there. The same with ITMPotionUse. But ITMPotionUp was there. I don't understand. Both "ITMPotionUse" and "ITMPotionUp" are in the "Sound Descriptors" category in the creation kit. Literally right next to each other.

 

Can I.... check numbers manually? Obviously GetUseSound() works because I see the result print, but it's just my comparison doesn't work. I tried doing if (tempForm as potion).GetUseSound() == 000CAF94 (and/or 0x000CAF94) but of course there are variable mismatches and yadda yadda yadda.

 

EDIT: F-ing hell. I.... made it work, but it's not pretty. I have NO idea why the formlist wasn't working. I just ended up doing this. I may not have to cast to form since sound descriptor extends form, but I don't care, this works.

if (((tempForm as potion).GetUseSound() as form).GetFormID() == 0x000CAF94)
Edited by corrado33
Link to comment
Share on other sites

For a property, you should use SoundDescriptor instead of Sound.

SoundDescriptor Property mySound Auto

For in a formlist, you should cast the form in the list to SoundDescriptor before the comparison.

If FoodIs.GetSound() == (RASFoodFormList.GetAt(2) as SoundDescriptor)

If the result from the formlist still yields a none value... no idea

 

Why do I suggest this? The sounds you want to work with are listed in the Sound Descriptor object group.

Link to comment
Share on other sites

For a property, you should use SoundDescriptor instead of Sound.

SoundDescriptor Property mySound Auto

For in a formlist, you should cast the form in the list to SoundDescriptor before the comparison.

If FoodIs.GetSound() == (RASFoodFormList.GetAt(2) as SoundDescriptor)

If the result from the formlist still yields a none value... no idea

 

Why do I suggest this? The sounds you want to work with are listed in the Sound Descriptor object group.

 

 

Yeah I tried that before. It doesn't work. Any combination of the above doesn't work.

 

If I use sounddescriptor property I can't select ANYTHING in the pull down menu. (When filling the script property.) (Can you?) I also tried casting the result of the GetAt() as a sound descriptor and that still resulted in a "none".

EDIT: Oh you used "GetSound" instead of "GetUseSound". I didn't try that, but that was never the problem. That part worked! At this point I don't care though cause I'm just using my way haha. Still don't know why the formlist wasn't working.

Edited by corrado33
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...