Here's the script, attached to an activator;
Spoiler
scn mdaRandomHauntSoundY
ref xObject
short xStdSpeed
short xSpeed
short xMaxDisplacement
float xPosY
float xPosMin
float xPosMax
float Timer
begin GameMode
if xObject == 0
set xObject to GetSelf
set xStdSpeed to -400
set xMaxDisplacement to 2000
set xPosY to xObject.getstartingpos y
if xStdSpeed > 0
set xPosMin to xPosY
set xPosMax to xPosY + xMaxDisplacement
else
set xPosMax to xPosY
set xPosMin to xPosY - xMaxDisplacement
set xStdSpeed to -xStdSpeed
endif
endif
If Timer < 15
Set Timer to ( Timer + GetSecondsPassed )
Elseif xPosY <= xPosMin
set xSpeed to xStdSpeed
Playsound3D mdaHaunt01 ; this is a selected folder, not a specific file, therefore playing a random file.
Set Timer to 0
else
set xSpeed to -xStdSpeed
Playsound3D mdaHaunt01 ; same as above!
Set Timer to 0
endif
if xSpeed == 0
return
endif
set xPosY to xObject.getpos Y + xSpeed * getsecondspassed
if xPosY > xPosMax
set xPosY to xPosMax
set xSpeed to 0
endif
if xPosY < xPosMin
set xPosY to xPosMin
set xSpeed to 0
endif
xObject.setpos Y xPosY
xObject.reset3Dstate
End
scn mdaRandomHauntSoundY
ref xObject
short xStdSpeed
short xSpeed
short xMaxDisplacement
float xPosY
float xPosMin
float xPosMax
float Timer
begin GameMode
if xObject == 0
set xObject to GetSelf
set xStdSpeed to -400
set xMaxDisplacement to 2000
set xPosY to xObject.getstartingpos y
if xStdSpeed > 0
set xPosMin to xPosY
set xPosMax to xPosY + xMaxDisplacement
else
set xPosMax to xPosY
set xPosMin to xPosY - xMaxDisplacement
set xStdSpeed to -xStdSpeed
endif
endif
If Timer < 15
Set Timer to ( Timer + GetSecondsPassed )
Elseif xPosY <= xPosMin
set xSpeed to xStdSpeed
Playsound3D mdaHaunt01 ; this is a selected folder, not a specific file, therefore playing a random file.
Set Timer to 0
else
set xSpeed to -xStdSpeed
Playsound3D mdaHaunt01 ; same as above!
Set Timer to 0
endif
if xSpeed == 0
return
endif
set xPosY to xObject.getpos Y + xSpeed * getsecondspassed
if xPosY > xPosMax
set xPosY to xPosMax
set xSpeed to 0
endif
if xPosY < xPosMin
set xPosY to xPosMin
set xSpeed to 0
endif
xObject.setpos Y xPosY
xObject.reset3Dstate
End
What I want is many different random sounds moving back and forth in the same cell.
Furthermore:
I used the markerx.nif for my activator thinking it would be invisible in game... but it's not! I can see many Xs sliding back and forth in my cell. Which was nice for testing, but I got the picture now. Why is it not invisible anymore?!? (used to be a static that I promoted to activator) :brokencomputer:
Edit: Well, apparently, spaces or tabs don't show up in spoiler tags, sorry about that.