Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Cog needed
Cog needed
2001-05-09, 8:19 PM #1
I am in need of a cog that makes a sound come from a surface. Can somebody please help.

------------------
Forget years of training and commitment!
I found a lightsaber in a garage and that makes me a Jedi!
- DCM JK Special Edition
Dont ask me how it works, it just does.
2001-05-10, 6:31 AM #2
Can you give more information? Is the sound on continuosly or does it turn on and off? Let us know and we can make a cog for it. It's easy to do using:
PlaySoundPos(wav, GetSurfaceCenter(surface), volume, mindistance, maxdistance, 0x1);

------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2001-05-10, 2:34 PM #3
I need it so the sound is continuesly playing

------------------
Forget years of training and commitment!
I found a lightsaber in a garage and that makes me a Jedi!
- DCM JK Special Edition
Dont ask me how it works, it just does.
2001-05-10, 3:47 PM #4
Change the 0x1(which is a 'flag') to something else, it's in the JKSpecs but I don't remember what the flag is for repeating sound...I'm just gonna look it up, 'k?
Hey, I'm here! But who cares?
2001-05-10, 3:49 PM #5
Have you tried the cog yet? The flag 0x1 is 'loop until stopped', so I think it should work...
Hey, I'm here! But who cares?
2001-05-10, 4:06 PM #6
Can you please post the whole cog.

------------------
Forget years of training and commitment!
I found a lightsaber in a garage and that makes me a Jedi!
- DCM JK Special Edition
Dont ask me how it works, it just does.
2001-05-11, 2:53 PM #7
Try this. [http://forums.massassi.net/html/smile.gif]
You can play around with the volume and maxdistance numbers when you select the cog in JED, to see how the sound level and distance works in your level. And of course you also enter your own choices for the surface reference and sound file name in JED.
Code:
# soundsurf.cog
# Cog to continuously play a sound from a surface
# 
# Cog not supported by LucasArts Entertainment Co.
symbols
message  startup
surface  surface1
sound  wav=forcefieldhum01.wav
flex  volume=1.0
flex  maxdistance=20
int  channel  local
end
# ==============================
code
startup:
sleep(1.0);
channel = PlaySoundPos(wav,GetSurfaceCenter(surface1),volume,1,maxdistance,0x1);
return;
end


------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton

↑ Up to the top!