Map ability help

So I'm currently building a stealth game and I'm creating some sort of abilities to use on the map to sneak around. I have things like a short range teleport, an invisibility and so on.

However I'm struggling with two points at the moment :

- I set a limited number of use per map using this method :
Each time the ability is used : "control variable : #000XX ability count +=1" and I then a second event page with a condition "if Variable XX > 4(number of use) then read the text : You can't use ABILITY anymore.
--> Right now it is working, however I would like to implement some for of HUD in which I can see the amount of uses remaining. The way I see it is to just display the content of the variable, but I would need to have my variable decrease instead of increase. So it would look like 4>3>2>1>0 (can't use anymore). How could I set up my variable to work in that way ?


- My second issue is that I want the invisibility ability to last for a set number of step. Like player uses Invisibility, walks 4 steps and then he is reavealed. I'm struggling to create a step counter. From what I read the best way is to record the old step value in a variable then the current step value in a new one and substract, but I'm really struggling to do this, can anyone show me how ? Or if there is a better way / plugin that would allow that ?

Or if anyone know if there is such plugin as an ability manager (different from skills from combat) ?

Thanks in advance 🙂
Set the variable to 4, then each time the ability is used, subtract 1. On your event, have the first page with no conditions and the "You can't use ABILITY anymore" text, and the second page has the condition Variable >= 1 (or Variable > 0 - I don't remember if the condition is > or >= )

When the ability is used, set a variable to the number of steps + 4. Then track each time a step is taken, and compare the variable to the current number of steps.

How you do this will depend on how your events are set up at the moment. You say what you're doing, but you haven't shown how you're doing it - parallel events, how are you detecting when the ability is used, etc. If you show screenshots of what you've already got (including the entire event window - don't crop out the tabs or conditions or anything), we'd be better able to give you suggestions that will work with what you've got.
Wow thanks for the quick reply, I'm gonna try this for my use count and see if it work the way I want.

You are right, for the second part, here are the screens :
1596199750647.png
1596199830478.png
Set the variable to 4, then each time the ability is used, subtract 1. On your event, have the first page with no conditions and the "You can't use ABILITY anymore" text, and the second page has the condition Variable >= 1 (or Variable > 0 - I don't remember if the condition is > or >= )

When the ability is used, set a variable to the number of steps + 4. Then track each time a step is taken, and compare the variable to the current number of steps.

How you do this will depend on how your events are set up at the moment. You say what you're doing, but you haven't shown how you're doing it - parallel events, how are you detecting when the ability is used, etc. If you show screenshots of what you've already got (including the entire event window - don't crop out the tabs or conditions or anything), we'd be better able to give you suggestions that will work with what you've got.
So the variable that count ability uses now perfectly works, thanks for that !

I'm still not sure to understand how to make the step count works. How do I set the variable to "number of steps + 4"?
On page 1, do
Code:
Control Variables 6: Steps Remaining = 4
Control Variables 7: Saved Step Count = Steps

On page 2, do
Code:
Control Variables 8: Step Count = Steps
If: Variable 7: Saved Step Count # Variable 8: Step Count
  Control Variables 7: Saved Step Count = Variable 8: Step Count
  Control Variables 6: Steps Remaining -= 1
  If Variable 6: Steps Remaining = 0
    Play SE
    Show Animation
    ... etc
    Control Self Switch A = OFF
  End
End

I think that'll work, but I haven't had coffee yet, so ...
So yeah it seem to be working ! Thanks Shaz 😀

Original thread: https://forums.rpgmakerweb.com/threads/map-ability-help.124770/