Particles don't want to disappear instantly

Arkanio

Member
Using Game Maker Studio 2

ok for a little bit of context i'm doing a game of puzzle where you have to switch between dimension to get to impossible places and since there is particle in dimension 1 when you switch of dimension (dimension 2) we can see the particle disappear but slowly and i want them to disappear instantly (totally not see them disappear)

i set the part_particles_clear but it dont work :/

here's the code
________________________________________________________________________________________
Create Event :
alarm[0] = 3
alarm[1] = 10

CorruptedSmokeSys = part_system_create()
CorruptedSmokePart = part_type_create()
part_type_sprite(CorruptedSmokePart,SSmoke,0,0,0)
part_type_life(CorruptedSmokePart,60,120)
part_type_size(CorruptedSmokePart,1,0.5,0,0)
part_type_direction(CorruptedSmokePart,0,0,0,0)
part_type_speed(CorruptedSmokePart,0.2,0.4,0,0)
part_type_alpha3(CorruptedSmokePart,0,0.1,0)

MyEmitter = part_emitter_create(CorruptedSmokeSys)
part_emitter_region(CorruptedSmokeSys,MyEmitter,x-32,x+32,y-32,y+32,ps_shape_rectangle, ps_distr_linear)

CorruptedSmokeSysL = part_system_create()
CorruptedSmokePartL = part_type_create()
part_type_sprite(CorruptedSmokePartL,SSmoke,0,0,0)
part_type_life(CorruptedSmokePartL,60,120)
part_type_size(CorruptedSmokePartL,1,0.5,0,0)
part_type_direction(CorruptedSmokePartL,180,180,0,0)
part_type_speed(CorruptedSmokePartL,0.2,0.4,0,0)
part_type_alpha3(CorruptedSmokePartL,0,0.1,0)


MyEmitterL = part_emitter_create(CorruptedSmokeSysL)
part_emitter_region(CorruptedSmokeSysL,MyEmitterL,x-32,x+32,y-32,y+32,ps_shape_rectangle, ps_distr_linear)

FlameSys = part_system_create()
FlamePart = part_type_create()
part_system_depth(FlamePart,layer_get_depth(layer_get_id("CorruptedBG")))
part_type_sprite(FlamePart,sprite82,0,0,1)
part_type_life(FlamePart,60,180)
part_type_size(FlamePart,1,0.5,0,0)
part_type_direction(FlamePart,90,90,0,0)
//part_type_orientation(FlamePart,-25,-25,0,0,0)
part_type_speed(FlamePart,0.5,0.8,0,0)
part_type_alpha3(FlamePart,0,1,0)
part_system_layer(FlameSys, layer_get_id("CorruptedParticles"));


MyEmitterF = part_emitter_create(FlameSys)
part_emitter_region(FlameSys,MyEmitterF,x-32,x+32,y-32,y+32,ps_shape_rectangle, ps_distr_linear)

__________________________________________________________________________________
alarm 0 event :

alarm[0] = 3
part_emitter_burst (CorruptedSmokeSys, MyEmitter, CorruptedSmokePart,1)
part_emitter_burst (CorruptedSmokeSysL, MyEmitterL, CorruptedSmokePartL,1)

__________________________________________________________________________________
alarm 1 event :

alarm[1] = 60
part_emitter_burst (FlameSys, MyEmitterF, FlamePart, 1)

___________________________________________________________________________________
Press A (the key to switch the dimension : (also when you press A global.dimension switch between 0 and 1)

if global.dimension != 0
{
part_particles_clear(CorruptedSmokeSys)
part_emitter_clear(CorruptedSmokeSys,MyEmitter)
part_particles_clear(CorruptedSmokeSysL)
part_emitter_clear(CorruptedSmokeSysL,MyEmitterL)
part_particles_clear(FlameSys)
part_emitter_clear(FlameSys,MyEmitterF)
}
 
I forget the function names off hand (replying from my phone) but you may need to draw the particles manually
I forget it's name but basically like objects have draw_self() particles have a similar function. If you run the draw function manually then you should be able to instantly hide the particles by stopping the draw event for them.
 

Arkanio

Member
I forget the function names off hand (replying from my phone) but you may need to draw the particles manually
I forget it's name but basically like objects have draw_self() particles have a similar function. If you run the draw function manually then you should be able to instantly hide the particles by stopping the draw event for them.
sorry, i don't really understand (i'm new on programming)
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
The _clear functions should remove all particles from a system... Add a breakpoint to the A key event code and then in the debugger step through that piece of code to make sure that it's actually being run.

That said, I have questions (unrelated to the issue, but it'll help me get an idea of what you are doing)... Are the particles, systems and emitters in a persistent object? And are you changing room when you change "dimension" or is it all in one room? Also, if you are using the emitter clear function, remember that the emitters will be "reset" and will need their position and size and particle type all set up again.
 

Arkanio

Member
the particles, systems and emitters are not in a persistent object! the 2 dimension are all in one room ! how do i add a breakpoint (sorry if i am a bit new on proggraming) and sorry for the late reply
 

Yal

šŸ§ *penguin noises*
GMC Elder
Are you running the game in Debug Mode? Breakpoints won't apply in normal mode. (Press F6 instead of F5 to run in debug mode)
 

Arkanio

Member
Well i was in debug mode and it dont work and is there a limit of Press "Key" with the free trial ?
 
Top