I designed this COG for my up-coming Theed level. The concept is based on SM Sith Lord's Sound System COG, although the design is completely different. Basically, that's what it does: when a player hits a switch, music is played on all computers, and a string appears on all computers, displaying the name of the player who turned on the music.
But there's more: the music wav's speed is actually cut down by two, to reduce file size. The COG also slows down the music by two.
Everything works fine, but the only problem is that only the host hears the music right, all other players hear it sped up.
Any ideas?
Here's the COG:
EDIT: ORJ_JoS is right. My bad.
But there's more: the music wav's speed is actually cut down by two, to reduce file size. The COG also slows down the music by two.
Everything works fine, but the only problem is that only the host hears the music right, all other players hear it sped up.
Any ideas?
Here's the COG:
Code:
#======================================================================
# Jedi Knight Cog Script
#
# 00_music.cog
#
# By activating a switch, music will be played (in loop), until
# the switch is turned off.
#
# Concept based on a COG by SM Sith Lord
#
# [Wes Darklighter]
#
# This cog is not made or distributed by LucasArts Entertainment Co.
#=======================================================================
flags=0x240
symbols
message activated
sound wav0
sound music
surface switch
int curcel
int player local
end
#===========================================
code
activated:
player = GetSourceRef();
SetSurfaceCel(switch, 1 - curcel);
curcel = 1 - curcel;
if (GetSurfaceCel(switch) == 1)
{
music = PlaySoundGlobal (wav0, 1, 0, 0x1);
ChangeSoundPitch (music, 0.5, 0.1);
ChangeSoundVol (music, 10, 2);
jkStringClear();
jkStringConcatPlayerName(player);
jkStringConcatSpace();
jkStringConcatAsciiString("turned on the music.");
jkStringOutput(-3, -1);
return;
}
else if (GetSurfaceCel(switch) == 0)
{
jkStringClear();
jkStringConcatAsciiString("lolz. music stopped.");
jkStringOutput(-3, -1);
StopSound(music, 0);
return;
}
EDIT: ORJ_JoS is right. My bad.

