GMS 2.3+ Effects do not show up at all

The title says it all. I put effects and they do not show up at all. I think I do not have the files for the effects so that the compiler I take.Can you help me?
 

flyinian

Member
explosions,smoke,elipse
So, with that. I think we need to see your code that relates to the effects in question before anyone can help.

P.S. You can look up "gms2 effects tutorials" on youtube and see if a video can answer your question.

@Amon I don't think a dislike is really appropriate here. @VL2M STUDIO is a new member and probably new to coding. But, to each their own. Even though it is the wrong category. :)
 
Last edited:
So, with that. I think we need to see your code that relates to the effects in question before anyone can help.

P.S. You can look up "gms2 effects tutorials" on youtube and see if a video can answer your question.

@Amon I don't think a dislike is really appropriate here. @VL2M STUDIO is a new member and probably new to coding. But, to each their own.
i think it is not the code.The code should normally work fine.But sure.
GML:
if(hp_ > 1)
{
 effect_create_below(ef_explosion, 0, 0, 3,c_white);
}
 

flyinian

Member
i think it is not the code.The code should normally work fine.But sure.
GML:
if(hp_ > 1)
{
effect_create_below(ef_explosion, 0, 0, 3,c_white);
}
With a quick glance at the manual. I would suspect the depth being wrong and/or using a "3" for size is breaking the code since the manual says," With this function you can create a simple effect beneath all instances of your room it is actually created at a depth of 100000 . If the effect is anything other ef_rain or ef_snow then you can define an x/y position to create the effect, and the size can be a value of 0, 1, or 2, where 0 is small, 1 is medium and 2 is large. ".

The x & y coordinates may be causing issues as well.
...
If the "hp" is health points than anything with a hp greater than 1 will create the effects, continuously. Until dead. You might be looking for, " hp < 1 " ? With that, it'll spawn the effects when dead. You'll need to add a check so the effects only happens once(or as many time as you want).
 
With a quick glance at the manual. I would suspect the depth being wrong and/or using a "3" for size is breaking the code since the manual says," With this function you can create a simple effect beneath all instances of your room it is actually created at a depth of 100000 . If the effect is anything other ef_rain or ef_snow then you can define an x/y position to create the effect, and the size can be a value of 0, 1, or 2, where 0 is small, 1 is medium and 2 is large. ".

The x & y coordinates may be causing issues as well.
I made that code to test if the explosions worked. So yeah maybe that code is not good.
GML:
with(other){
        effect_create_above(ef_explosion,x,y,1,c_orange);
        hp_+=o_weaponry.weapon_power;
}
instance_destroy();
Here is some code I created for a dummy that has as "hp" the dealt damage. This is a code for rocket impact. The code worked before. I did reinstall Gamemaker when I reinstalled Windows. Maybe that is the problem.
 

flyinian

Member
I made that code to test if the explosions worked. So yeah maybe that code is not good.
GML:
with(other){
        effect_create_above(ef_explosion,x,y,1,c_orange);
        hp_+=o_weaponry.weapon_power;
}
instance_destroy();
Here is some code I created for a dummy that has as "hp" the dealt damage. This is a code for rocket impact. The code worked before. I did reinstall Gamemaker when I reinstalled Windows. Maybe that is the problem.
I'm not to experienced using "Other" so, I can't comment on that.

hp_+=o_weaponry.weapon_power; //Looks like you are trying to minus(adding w/ current code) the weapon's damage from the hp when the enemy is already dead?


Here is my example:

GML:
create:
depth = -10000; // testing purposes. This should be top layer if nothing is drawn in the GUI.


step:
if(hp_ < 1)
{
show_debug_message("HP < 1 , Explosion effects executed and instance destoryed");
effect_create_below(ef_explosion,x ,y 2, 2,c_white);
instance_destroy();
};
 
Last edited:
GML:
create:
depth = -10000; // testing purposes


step:
if(hp_ < 1)
{
effect_create_below(ef_explosion, x, y, 2,c_white);
instance_destroy();
};
Nope.0 results.
Something is wrong with my installation. I can feel it. I'll think of a way. Sorry if I wasted your time .I appreciate your help.
 

flyinian

Member
Nope.0 results.
Something is wrong with my installation. I can feel it. I'll think of a way. Sorry if I wasted your time .I appreciate your help.
I don't think its your installation. I've wasted more of my time than anyone else. So, no worries.

I did the below code and it works for me.

Try this:
Place this code into the step event of a persistent/existing object and press space.
Adjust the x and y coordinates to your specific needs.
Its not using the hp but, it should be easy to edit the code so it works for what you want.

GML:
if(keyboard_check_pressed(vk_space))
{
    depth = -10000;
show_debug_message("HP < 1 , Explosion effects executed and instance destoryed");
effect_create_below(ef_explosion, x, y, 2,c_white);
};

If the first one worked, Then try this in your object that you want to spawn an explosion on death.:

GML:
if(hp_ < 1)
{
depth = -10000;
show_debug_message("HP < 1 , Explosion effects executed and instance destoryed");
effect_create_below(ef_explosion, x, y, 2,c_white);
instance_destroy();
};
If this doesn't work then the issue may lay else where.



P.S. I make a lot of edits to my posts so, double check them before trying code or any suggestions.
 
Last edited:
I don't think its your installation. I've wasted more of my time than anyone else. So, no worries.

I did the below code and it works for me.

Try this:
Place this code into the step event of a persistent/existing object and press space.
Adjust the x and y coordinates to your specific needs.
Its not using the hp but, it should be easy to edit the code so it works for what you want.

GML:
if(keyboard_check_pressed(vk_space))
{
    depth = -10000;
show_debug_message("HP < 1 , Explosion effects executed and instance destoryed");
effect_create_below(ef_explosion, x, y, 2,c_white);
};
still no explosion
 

flyinian

Member
still no explosion
Give us(me) all of your code that relates to the effects and the object that "hp" relates to.

Did you adjust the x and Y to your needs? They can't be "X" and "Y". Replace with a number. Example: for me, I have a 640 x 360 room. So I replaced the x and y with 100. That'll be about the top left corner for me. If not in an object/instance that has its own x and y values and the values are within the camera/view.



also, Is the object in the room/exists? If not, then this code definitely won't work. You should be able to tell if the debug message shows in the output window of the IDE.
 
Last edited:
Ok so I've made a new project where all you have to do is press space and it will call the explosion effect. No results.
Thanks again for offering to help me. I'll look more into it later
 

kburkhart84

Firehammer Games
One thing about using "other" is that its only useful in certain places. One such place is inside a collision event, where 'other' is the id of the instance you are colliding with. So, if you are trying to do something like with(other), its going to fail because you aren't in one of those events and 'other' points to nothing.

In that new project...did you actually put an instance of that object in the room? And that code, you put it in the step event?
 

kburkhart84

Firehammer Games
If you want to send me the project files(the new test project, not the one you are working on), in a download link, whatever, I'll see what it does on my system if you would like.
 

flyinian

Member
@kburkhart84 You could also make a new project and place the code into it and get it to work. Then send it to @VL2M STUDIO and have them test it. At that point, if it doesn't work then it's probably their installation/ who knows what.
 

kburkhart84

Firehammer Games
@kburkhart84 You could also make a new project and place the code into it and get it to work. Then send it to @VL2M STUDIO and have them test it. At that point, if it doesn't work then it's probably their installation/ who knows what.
I prefer to let @VL2M STUDIO send me the project that is already set up. This way I can catch an error if there is one. It is likely easier for me to figure out the error than for VL2M to compare bit by bit their project to my version honestly.
 

FrostyCat

Member
I'm pretty sure it's because the depth that effect_create_below acts at is below the depth of the Background layer, and if it's left as a solid fill at default, that would completely cover up the effect. Try effect_create_above to see if it shows up that way.
 

kburkhart84

Firehammer Games
It is showing up just fine on my installation of GMS 2.3.1.536.
Likewise. Literally NO changes except what the IDE does due to older version update.

1. Extract RAR.
2. Double-click test.yyp
3. IDE opens, shows message that the project was created in older IDE(which happens every time you update a project, at least to me).
4. Click Play Button.
5. Hit space, and see the explosion.

So, I don't know what's going on with your system, but at the least it isn't the code itself.
 
Top