I'm trying to make it so that this cog plays one of the four wavs whenever the light flickers to the highlight, but i can't seem to get it to play the sounds.
I tried 'PlaySoundThing(rand()*sound);' but i got a bunchload of syntax errors, and I'm not to cog-literate, so any help would be appreciated.
------------------
Last week I cudn't evn spel grajuat, but now I is one.
I tried 'PlaySoundThing(rand()*sound);' but i got a bunchload of syntax errors, and I'm not to cog-literate, so any help would be appreciated.
Code:
# Jedi Knight Cog Script
#
# Made by Stormtrooper
# modified from 00_thinglight.cog
# [YB]
#
# NOT Supported By LucasArts Entertainment Co.
# Script that causes the light value attached to a thing to flicker between two values
# (Stormtrooper-added sound thing to make a lightning-thunder effect)
symbols
thing lightthing desc=thing_to_light
sound sound0 desc=lightning_sound
sound sound1 desc=lightning_sound1
sound sound2 desc=lightning_sound2
sound sound3 desc=lightning_sound3
flex lowlight=0.1 desc=off_light_val
flex highlight=0.6 desc=on_light_val
flex offmax=0.5 desc=max_off_interval
flex onmax=1.0 desc=max_on_interval
message startup
end
# COG Section
code
startup:
while(1) {
thinglight(lightthing, lowlight, 0.0);
sleep(rand()*offmax);
thinglight(lightthing, highlight, 0.0);
PlaySoundThing(sound, lightthing, 1.5, 10.0, -1, 0x10080);
sleep(rand()*onmax);
}
stop;
end------------------
Last week I cudn't evn spel grajuat, but now I is one.
![http://forums.massassi.net/html/wink.gif [http://forums.massassi.net/html/wink.gif]](http://forums.massassi.net/html/wink.gif)
![http://forums.massassi.net/html/tongue.gif [http://forums.massassi.net/html/tongue.gif]](http://forums.massassi.net/html/tongue.gif)
You don't need the *1 on the end of the volumes Rand().