I wrote this awhile ago when I knew more about cog. I set it down, and forget everything. So now trying to fix it, I have no idea what's wrong with it.
It works fine the first time through the level. But if you die and the level restarts, it won't revert back to the loudest sound. It resets the sector speeds but the sound stays the same volume it was before you died until the switch is activated.
Again, I have absolutely no clue what I'm doing here and there are some portions that I commented out. Be nice
It works fine the first time through the level. But if you die and the level restarts, it won't revert back to the loudest sound. It resets the sector speeds but the sound stays the same volume it was before you died until the switch is activated.
Again, I have absolutely no clue what I'm doing here and there are some portions that I commented out. Be nice

Code:
symbols
sector thrustsector1
sector thrustsector2
sector thrustsector3
sector thrustsector4
vector thrust_vec
flex thrust_speed_high
flex thrust_speed_low
flex thrust_speed_off
message activated
message startup
sound click
sound powerdown
sound powerup
sound rumble
int one local
surface button
end
# ========================================================================================
code
startup:
SetSectorThrust(thrustsector1, thrust_vec, thrust_speed_high);
SetSectorThrust(thrustsector2, thrust_vec, thrust_speed_high);
SetSectorThrust(thrustsector3, thrust_vec, thrust_speed_high);
SetSectorThrust(thrustsector4, thrust_vec, thrust_speed_high);
SetWallCel(button, 2);
one=SectorSound(thrustsector1, rumble, 1);
#one=SectorSound(thrustsector2, rumble, 1);
#one=SectorSound(thrustsector3, rumble, 1);
#one=SectorSound(thrustsector4, rumble, 1);
return;
activated:
if (GetSenderRef()==button)
{
if (GetWallCel(button)==2)
{
SetWallCel(button, 1);
PlaySoundPos(click, SurfaceCenter(button), 1, -1, -1, 0);
PlaySoundPos(powerdown, SurfaceCenter(button), 1, -1, -1, 0);
SetSectorThrust(thrustsector1, thrust_vec, thrust_speed_low);
SetSectorThrust(thrustsector2, thrust_vec, thrust_speed_low);
SetSectorThrust(thrustsector3, thrust_vec, thrust_speed_low);
SetSectorThrust(thrustsector4, thrust_vec, thrust_speed_low);
#ChangeSoundVol(one, .5, .1);
StopSound(one, 0);
one=SectorSound(thrustsector1, rumble, .5);
}
else if (GetWallCel(button)==1)
{
SetWallCel(button, 0);
PlaySoundPos(click, SurfaceCenter(button), 1, -1, -1, 0);
PlaySoundPos(powerdown, SurfaceCenter(button), 1, -1, -1, 0);
SetSectorThrust(thrustsector1, thrust_vec, thrust_speed_off);
SetSectorThrust(thrustsector2, thrust_vec, thrust_speed_off);
SetSectorThrust(thrustsector3, thrust_vec, thrust_speed_off);
SetSectorThrust(thrustsector4, thrust_vec, thrust_speed_off);
#ChangeSoundVol(one, .1, .1);
StopSound(one, 0);
one=SectorSound(thrustsector1, rumble, 0);
}
else
{
SetWallCel(button, 2);
PlaySoundPos(click, SurfaceCenter(button), 1, -1, -1, 0);
PlaySoundPos(powerup, SurfaceCenter(button), 1, -1, -1, 0);
SetSectorThrust(thrustsector1, thrust_vec, thrust_speed_high);
SetSectorThrust(thrustsector2, thrust_vec, thrust_speed_high);
SetSectorThrust(thrustsector3, thrust_vec, thrust_speed_high);
SetSectorThrust(thrustsector4, thrust_vec, thrust_speed_high);
#ChangeSoundVol(one, 1, .1);
StopSound(one, 0);
one=SectorSound(thrustsector1, rumble, 1);
}
}
return;
