Master Cabalist
Member
I've come across this before and last time it had to do with instance_create. I can't remember exactly what. Does this look familiar to anyone?
Which way? Can you point me to where on site?Yeah, you can do it in this way and use alpha to reduce opacity.
I did attach a picture. Musn't have taken. OH. Too large.I don't know what you are looking for when you talk about a smear effect....if you can provide details or show me a picture or video I can probably help.
instance_create(700,500, Ring2Bat);
fade_duration =room_speed/2// = 1.5 seconds
alpha_step = 0.1 / fade_duration // the amount by which to decrease the alpha per step
//alpha_step = 0.1;
movement_speed = 0.7 // the amount of pixels per step it floats
image_alpha = 1.0;
alpha = 0.85;
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
y--;
if (alpha <= 0)
{
instance_destroy()
}
fade_duration =room_speed// = 1.5 seconds
alpha_step = 0.1 / fade_duration // the amount by which to decrease the alpha per step
//alpha_step = 0.1;
movement_speed = 0.7 // the amount of pixels per step it floats
image_alpha = 1.0;
alpha = 0.85;
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
y--;
if (alpha <= 0)
{
instance_destroy()
}
instance_create(700,500, Ring3Bat);
fade_duration =room_speed/2// = 1.5 seconds
alpha_step = 0.1 / fade_duration // the amount by which to decrease the alpha per step
//alpha_step = 0.1;
movement_speed = 0.7 // the amount of pixels per step it floats
image_alpha = 1.0;
alpha = 0.85;
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
//y--;
//if (alpha <= 0)
//{
// instance_destroy()
//}
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
//y--;
//if (alpha <= 0)
//{
// instance_destroy()
//}
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
y--;
//if (alpha <= 0)
//{
// instance_destroy()
//}
draw_self();
draw_set_font(CarnivalFont);
draw_text_transformed_color(x+270, y+440, "4", 5, 5, 0, c_black, c_black, c_black, c_black, alpha);
//if (alpha <= 0)
//{
// instance_destroy()
//}
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
y--;
if (alpha <= 0)
{
instance_destroy()
}
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
y--;
//if (alpha <= 0)
//{
// instance_destroy()
//}
alpha -= alpha_step // decrease alpha
image_alpha = alpha;
y--;
if (alpha <= 0)
{
instance_destroy()
}
StartLogoLevel3
. That controller calls the RingBat3. So it has to be instantiated but I search through the code and it doesn't find itvar target = noone;
global.game_map++;
switch(global.game_map)
{
case 1: target = FirstLevel; break;
case 2: target = FirstLevel1B; break;
case 3: target = FirstLevel1C; break;
case 4: target = FirstLevel1D; break;
case 5: target = FirstLevelBOSS; break;
case 6: target = VideoMap; break; ///ForestMap
case 7: target = SecondLevel; break;
case 8: target = SecondLevelB; break;
case 9: target = SecondLevelC; break;
case 10: target = SecondLevelD; break;
case 11: target = SecondLevelD; break;
case 12: target = SecondLevelBOSS; break;
case 13: target = VideoMap; break; //SnowMap
case 20: target = ThirdLevel; break;
case 21: target = ThirdLevelB; break;
case 22: target = ThirdLevelC; break;
case 23: target = ThirdLevelD; break;
case 24: target = ThirdLevelBOSS; break;
case 25: target = VideoMap; break; //LavaMap
case 30: target = FourthLevel;break;
case 31: target = FourthLevelB;break;
case 32: target = FourthLevelC;break;
case 33: target = FourthLevelD;break;
case 34: target = FourthLevelBOSS;break;
case 35: target = VideoMap; break; //JungleMap
case 40: target = FifthLevel; break;
case 41: target = FIfthLevelB; break;
case 42: target = FifthLevelC; break;
case 43: target = FifthLevelD; break;
case 44: target = FifthLevelBOSS; break;
case 45: target = VideoMap; break; //DesertMap
case 50: target = SixthLevel; break;
case 51: target = SixthLevelB; break;
case 52: target = SixthLevelC; break;
case 53: target = SixthLevelD; break;
case 54: target = SixthLevelBOSS; break;
case 55: target = VideoMap; break; //LagoonMap
case 60: target = SeventhLevel; break;
case 61: target = SeventhLevelB; break;
case 62: target = SeventhLevelC; break;
case 63: target = SeventhLevelD; break;
case 64: target = SeventhLevelBOSS; break;
case 65: target = VideoMap; break; //SwampMap
case 70: target = EightLevel; break;
case 71: target = EightLevelB; break;
case 72: target = EightLevelC; break;
case 73: target = EightLevel1D; break;
case 74: target = EightLevel1BOSS; break;
case 75: target = VideoMap;break; //RuinsMap
case 80: target = NinthLevel;break;
case 81: target = NinthLevelB;break;
case 82: target = NinthLevelC;break;
case 83: target = NinthLevelD;break;
case 84: target = VideoMap;break; //StormMap
case 90: target = TenthLevel; break;
case 91: target = TenthLevelB;break;
case 92: target = TenthLevelC;break;
case 93: target = TenthLevelD;break;
case 94: target = TenthLevelBOSS;break;
case 95: target = VideoMap;break; //SkyMap
case 100: target = EleventhLevel;break;
case 101: target = EleventhLevelB;break;
case 102: target = EleventhLevelC;break;
case 103: target = EleventhLevelD;break;
case 104: target = EleventhLevelBOSS;break;
case 105: target = VideoMap;break; //SciFiMap
case 110: target = TwelfthLevel;break;
case 111: target = TwelfthLevelB;break;
case 112: target = TwelfthLevelC;break;
case 113: target = TwelfthLevelD;break;
case 114: target = TwelfthLevelBOSS;break;
}
room_goto(target);
//0 is the indicator , the map
//target is the map to go to
var target = noone;
global.game_map++;
if (room_exists(global.game_map)) {
show_debug_message("Room exists");
}
else {
show_debug_message("Room does not exist");
}
case 10: target = SecondLevelD; break;
case 11: target = SecondLevelD; break;
target = noone;
global.game_map++;
switch(global.game_map)
{
case 1: target = FirstLevel; break;
case 2: target = FirstLevel1B; break;
case 3: target = FirstLevel1C; break;
case 4: target = FirstLevel1D; break;
case 5: target = FirstLevelBOSS; break;
case 6: target = VideoMap; break; ///ForestMap
case 7: target = SecondLevel; break;
case 8: target = SecondLevelB; break;
case 9: target = SecondLevelC; break;
case 10: target = SecondLevelD; break;
case 11: target = SecondLevelBOSS; break;
case 12: target = VideoMap; break;
case 20: target = ThirdLevel; break;
case 21: target = ThirdLevelB; break;
case 22: target = ThirdLevelC; break;
case 23: target = ThirdLevelD; break;
case 24: target = ThirdLevelBOSS; break;
case 25: target = VideoMap; break; //LavaMap
case 30: target = FourthLevel;break;
case 31: target = FourthLevelB;break;
case 32: target = FourthLevelC;break;
case 33: target = FourthLevelD;break;
case 34: target = FourthLevelBOSS;break;
case 35: target = VideoMap; break; //JungleMap
case 40: target = FifthLevel; break;
case 41: target = FIfthLevelB; break;
case 42: target = FifthLevelC; break;
case 43: target = FifthLevelD; break;
case 44: target = FifthLevelBOSS; break;
case 45: target = VideoMap; break; //DesertMap
case 50: target = SixthLevel; break;
case 51: target = SixthLevelB; break;
case 52: target = SixthLevelC; break;
case 53: target = SixthLevelD; break;
case 54: target = SixthLevelBOSS; break;
case 55: target = VideoMap; break; //LagoonMap
case 60: target = SeventhLevel; break;
case 61: target = SeventhLevelB; break;
case 62: target = SeventhLevelC; break;
case 63: target = SeventhLevelD; break;
case 64: target = SeventhLevelBOSS; break;
case 65: target = VideoMap; break; //SwampMap
case 70: target = EightLevel; break;
case 71: target = EightLevelB; break;
case 72: target = EightLevelC; break;
case 73: target = EightLevel1D; break;
case 74: target = EightLevel1BOSS; break;
case 75: target = VideoMap;break; //RuinsMap
case 80: target = NinthLevel;break;
case 81: target = NinthLevelB;break;
case 82: target = NinthLevelC;break;
case 83: target = NinthLevelD;break;
case 84: target = NinthLevelBOSS;break;
case 85: target = VideoMap;break; //StormMap
case 90: target = TenthLevel; break;
case 91: target = TenthLevelB;break;
case 92: target = TenthLevelC;break;
case 93: target = TenthLevelD;break;
case 94: target = TenthLevelBOSS;break;
case 95: target = VideoMap;break; //SkyMap
case 100: target = EleventhLevel;break;
case 101: target = EleventhLevelB;break;
case 102: target = EleventhLevelC;break;
case 103: target = EleventhLevelD;break;
case 104: target = EleventhLevelBOSS;break;
case 105: target = VideoMap;break; //SciFiMap
case 110: target = TwelfthLevel;break;
case 111: target = TwelfthLevelB;break;
case 112: target = TwelfthLevelC;break;
case 113: target = TwelfthLevelD;break;
case 114: target = TwelfthLevelBOSS;break;
}
room_goto(target);
//0 is the indicator , the map
//target is the map to go to
//we
default:
show_debug_message("Target is not being assigned a value as global.game_map was not set to one of the cases in the switch");
break;
Is the smear only with that ghost thing or for the entire room? I'm somewhat doubtful that the effect is caused by the code you posted in particular, does it only happen in a specific room? How are you setting up that room when you're entering it? Does your background have any transparency in it? Also is there any reason why you are skipping cases in that switch statement? Seems like that would be an easy way to have something weird happen to the target variable. Try chucking in:
After your defined cases in the switch statement and see if that debug message gets triggered before any weirdness happens.Code:default: show_debug_message("Target is not being assigned a value as global.game_map was not set to one of the cases in the switch"); break;
if (mouse_check_button_pressed(mb_right))
{
inst = instance_position(mouse_x, mouse_y, BrainParentObject)
inst2 = instance_position(mouse_x,mouse_y, BOSSESParent)
inst3 = instance_position(mouse_x, mouse_y, SpecialBrains)
inst4 = instance_position(mouse_x, mouse_y, FranksParent)
if (SpecialBrains != noone)
{
with (SpecialBrains)
{
if (hp <= 1000)
{
hp_minus = irandom_range(200, 300)
hp -= hp_minus
floater = instance_create_depth(x+10, y-10, -1700, DamageIndicatorObject);
floater.text = string(hp_minus);
if (hp <= 0)
{
instance_create_depth(x, y, -1100,DeadBrainObject);
instance_create_depth(x-150, y-20, -1100, FadingGemObject);
audio_play_sound(DieingBrainSound, 20, false);
instance_destroy()
}
}
}
}
if (inst != noone || inst2 != noone || inst3 != noone || inst4 != noone)
{
/*
for (i=0;i<30;i++)
{
show_debug_message("Getting ready to draw lightning")
//draw_set_color(c_white)
//draw_lightning_simple(x,y,mouse_x,mouse_y,32,60)//render lightning with a single line of code!
draw_lightning_color(path[0], 20, 300, c_blue, c_orange, 1.0, path[1], p_metal, fx.particles, weighting);
}*/
global.tgt_x = mouse_x;
global.tgt_y = mouse_y;
for (i=0;i<room_speed/7;i++)
{
instance_create(global.tgt_x, global.tgt_y,o_lightning_hue)
}
}
}
/*
There is no instance of ghost that I could find either. However if you look at the debugger there are dozens instances of that ghost instance making it evident that the problem to be whatever is causing the instantiate the ghost. Suggestions?I don't see any creation of any object called "ghost" anything in that code. I don't see any calls to other functions either except GM functions. I don't think that code is it. You can always search by text for the name of the ghost object to see exactly where all they are being created from and go from there.
How does that code even run with a 1.4 function in it?instance_create(global.tgt_x, global.tgt_y,o_lightning_hue)
global.tgt_x = mouse_x;
global.tgt_y = mouse_y;
for (i=0;i<room_speed/7;i++)
{
instance_create(global.tgt_x, global.tgt_y,o_lightning_hue)
}
}
}
We mean (assuming this line ends up creating an bunch of FrankGhostObject instances incorrectly).Ok. I think you are talking about two diferent things, What I'm understanding is that i'm using
an instance_create_depth(0,0,-1100, FrankGhostObject) when FrankGhostObject is actually a sprite,
along those lines??
instance_create_depth(0,0,-1100, AnythingThatIsNotAFrankGhostObjectButHasTheSameValueAsTheFrankGhostObjectAssetId);