Hello again,
so there's a problem I have: When I hit an invincibility monitor and then hit a speed sneaker monitor while being invincible, the invincibility theme just restarts instead of playing the speed sneakers theme.
And the speed sneakers theme wont play even when the invincibility wears off, as it plays the level theme instead.
And when the speed sneakers wear off like that, the level theme restarts as if the speed sneakers theme did play (even though it didn't).
Here's the code (inside the Step Event of the object that handles all music and jingles):
Code:
/* Speed Sneaker */
if(instance_exists(par_player))
{
if(instance_exists(global.main_player))
{
if(global.main_player.speed_sneakers_timer > 1)
{
if not(FMODInstanceIsPlaying(sneakersong)) and sneaker_already_played = false
{
//caster_stop(caster_handle);
//caster_play(speed_sneaker_jingle,caster_volume,caster_pitch)
FMODInstanceStop(caster_handle);
FMODInstanceStop(invincibilitysong);
FMODInstanceStop(invincibility_jingle);
sneakersong = FMODSoundPlay(speed_sneaker_jingle);
sneaker_already_played = true;
break;
};
if not(FMODInstanceIsPlaying(speed_sneaker_jingle)) and sneaker_already_played = false
{
//caster_stop(caster_handle);
//caster_play(speed_sneaker_jingle,caster_volume,caster_pitch)
FMODInstanceStop(caster_handle);
FMODInstanceStop(invincibilitysong);
FMODInstanceStop(invincibility_jingle);
sneakersong = FMODSoundPlay(speed_sneaker_jingle);
sneaker_already_played = true;
break;
};
};
else if(global.main_player.speed_sneakers_timer == 1)
{
//if(FMODInstanceIsPlaying(sneakersong))
//{
//caster_stop(speed_sneaker_jingle)
FMODInstanceStop(sneakersong);
FMODInstanceStop(speed_sneaker_jingle);
sneaker_already_played = false;
//caster_loop(caster_handle,caster_volume,caster_pitch)
current_song = FMODSoundLoop(caster_handle);
//};
};
};
};
/* Invincibility */
if(instance_exists(par_player))
{
if(instance_exists(global.main_player))
{
if(global.main_player.invincibility_timer != 0 && global.main_player.invincibility = 1 && global.main_player.super_state == false)
{
if not(FMODInstanceIsPlaying(invincibilitysong))
{
//caster_stop(caster_handle);
//caster_stop(speed_sneaker_jingle);
//caster_loop(invincibility_jingle,caster_volume,caster_pitch)
FMODInstanceStop(caster_handle);
FMODInstanceStop(sneakersong);
FMODInstanceStop(speed_sneaker_jingle);
invincibilitysong = FMODSoundLoop(invincibility_jingle);
break;
};
};
else if(global.main_player.invincibility_timer == 0)
{
if(FMODInstanceIsPlaying(invincibilitysong))
{
//caster_stop(invincibility_jingle)
//caster_loop(caster_handle,caster_volume,caster_pitch)
FMODInstanceStop(invincibilitysong);
current_song = FMODSoundLoop(caster_handle);
};
};
};
};
Just so you know, just hitting the speed sneaker monitor while not being invincible does produce the speed sneaker theme, just as it should.
So yeah, I would be glad if someone could help me out on that nutcracker...
Hello again,
so there's a problem I have: When I hit an invincibility monitor and then hit a speed sneaker monitor while being invincible, the invincibility theme just restarts instead of playing the speed sneakers theme.
And the speed sneakers theme wont play even when the invincibility wears off, as it plays the level theme instead.
And when the speed sneakers wear off like that, the level theme restarts as if the speed sneakers theme did play (even though it didn't).
Here's the code (inside the Step Event of the object that handles all music and jingles):
[code]
/* Speed Sneaker */
if(instance_exists(par_player))
{
if(instance_exists(global.main_player))
{
if(global.main_player.speed_sneakers_timer > 1)
{
if not(FMODInstanceIsPlaying(sneakersong)) and sneaker_already_played = false
{
//caster_stop(caster_handle);
//caster_play(speed_sneaker_jingle,caster_volume,caster_pitch)
FMODInstanceStop(caster_handle);
FMODInstanceStop(invincibilitysong);
FMODInstanceStop(invincibility_jingle);
sneakersong = FMODSoundPlay(speed_sneaker_jingle);
sneaker_already_played = true;
break;
};
if not(FMODInstanceIsPlaying(speed_sneaker_jingle)) and sneaker_already_played = false
{
//caster_stop(caster_handle);
//caster_play(speed_sneaker_jingle,caster_volume,caster_pitch)
FMODInstanceStop(caster_handle);
FMODInstanceStop(invincibilitysong);
FMODInstanceStop(invincibility_jingle);
sneakersong = FMODSoundPlay(speed_sneaker_jingle);
sneaker_already_played = true;
break;
};
};
else if(global.main_player.speed_sneakers_timer == 1)
{
//if(FMODInstanceIsPlaying(sneakersong))
//{
//caster_stop(speed_sneaker_jingle)
FMODInstanceStop(sneakersong);
FMODInstanceStop(speed_sneaker_jingle);
sneaker_already_played = false;
//caster_loop(caster_handle,caster_volume,caster_pitch)
current_song = FMODSoundLoop(caster_handle);
//};
};
};
};
/* Invincibility */
if(instance_exists(par_player))
{
if(instance_exists(global.main_player))
{
if(global.main_player.invincibility_timer != 0 && global.main_player.invincibility = 1 && global.main_player.super_state == false)
{
if not(FMODInstanceIsPlaying(invincibilitysong))
{
//caster_stop(caster_handle);
//caster_stop(speed_sneaker_jingle);
//caster_loop(invincibility_jingle,caster_volume,caster_pitch)
FMODInstanceStop(caster_handle);
FMODInstanceStop(sneakersong);
FMODInstanceStop(speed_sneaker_jingle);
invincibilitysong = FMODSoundLoop(invincibility_jingle);
break;
};
};
else if(global.main_player.invincibility_timer == 0)
{
if(FMODInstanceIsPlaying(invincibilitysong))
{
//caster_stop(invincibility_jingle)
//caster_loop(caster_handle,caster_volume,caster_pitch)
FMODInstanceStop(invincibilitysong);
current_song = FMODSoundLoop(caster_handle);
};
};
};
};
[/code]
Just so you know, just hitting the speed sneaker monitor while not being invincible does produce the speed sneaker theme, just as it should.
So yeah, I would be glad if someone could help me out on that nutcracker...