Hello everyone, I’m new here. I just started using Gdevelop and really gave it a good try, but a mechanic I am working on just isn’t working and I would love some help. So the concept is that the player wears three pieces of armor, helmet, platebody and platelegs. His jump when he isn’t wearing it can jump over three blocks, but with every piece of armor the player gets heavier and loses a block of height when jumping. Makes sense? I have really tried and am sure that I have gotten close…hopefully.
Here’s the code so far:
Note that I only have two pieces active currently as I wanted to figure that out before adding the helmet. Thank you for checking it out.
1 Like
Forgot to add that the problem lies in the jumpheight. I know that it’s incorrect, because the jumpheight is essentially the same with each piece that is put on. I just don’t know how to change so as to raise or lower the jump height accordingly.
Hi @Tomahaukur welcome to Gdevelop!
From a quick glance, I think you have too many events for the jump calculation and they are conflicting with each other, plus you don’t have trigger once on some of them, so many of your events are constantly repeating themselves.
For example, if you are wearing both armors, Gdevelop is repeatedly switching between the following actions as you don’t have another condition to specify which event to follow.
Personally, I would simplify it
Since you are new to the engine and maybe want to try your concept first before you make it more complex If you don’t care about your equipment’s weight, you can do the below idea.
Basically, each time your character equips one piece of armor you add 1, and if they remove the equipment or if it breaks you remove 1.
And then you just calculate the weight with this calculation
150 - (Player.TotalEquipments * 20)
150 = Your initial jump height (change it to what you like)
Player.TotalEquipments = The number of equipments on your player
20 = The additional weight from each equipment (change it to what you like)
Just make sure that your TotalEquipments won’t go below 0.
Once you get the hang of it, you can make it more specific, seeing that you already made false/true variables for the torso and legs.
3 Likes
Thank you so much for taking the time to help me. My code was a mess compared to yours and yours actually works. I should be able to figure it out from here. Thanks again!
1 Like
One more thing, is there a way to make it so that it doesn’t matter what order the armor is equipped? Right now, if I put on the chestplate and then the helmet, the TotalEquipment goes right up to 3 and he can’t jump over three blocks; and then it goes to two if I put on the platelegs he can jump over one block again.
Here’s my code currently:
1 Like
No problem!
Instead of having the variable TotalEquipments set to a number you need to put the correct modification sign like my code, which is add

Just add 1 like my example


If you leave it as set instead of add, Gdevelop will just change the TotalEquipments variable based on the last equipment that you picked, while with mine, it will add 1 to your total no matter which equipment you pick.
Unless you want each piece of equipment to weigh differently, if so, the code will have to become a bit more complex.
1 Like
Works like a charm and makes so much sense! Thank you so much!
1 Like
Added [SOLVED] to your post title! 
2 Likes
Thank you! I tried to do it, but couldn’t figure it out 
1 Like
No worries!
Since you are new to the forum, you can only edit your post title for a few minutes after it was posted, while higher Trust Level members (like myself
) can help edit it after that cooldown expires 
2 Likes