Hello everyone! Continuing my questions about the coding of my school project, today I wanna ask for your help with making variables interfere on the battles. The idea of it basically is: If the players HP (8100) loses 1215, the variable's value should go to 9. Whenever the players loses 1215 HP again, the variable's value will go up by 9 again. When it reaches 18, for example, it should make a text box with choices appear in-battle. And these kind of effects would stack up by 18 and 18, with the maximum being 54. When it reaches 54, I'll make it so that a timer starts and after a certain time (that I haven't decided how much yet) it will be addin 1 to the variable, until it reaches 60, wich would result in a game over. Putting the confusion of the variables aside, another problem with all this is that it should aaall be linked to a state, but I don't know how to use custom states or even a custom battle hud to show it on screen. I wanted so that the state would be represented by some kind of bar, that just like a HP one, would be on the battle screen. And, whenever the variable got another 18 on its value, the bar would fill itself a little, until it reached 60. I know this is a lot of stuff and that it probally will be really complicated to do it, so if anyone could be the most specific and detailed with this one I'd be really grateful. Anyways, thanks in advance!
Making variables link to the players HP and influence in-battle
RPG Maker MZ SupportThis you can do in the engine by doing a check on the player HP every time damage is dealt and incrementing your variable if it's less than a certain amount.
These you need plugins for because you can't normally show choices or run timers in battle. I'm a big fan of this plugin because it lets you run parallel common events in battle to do things you normally can't but you have to know what you're doing
You need a plugin for a HUD. SRD HUDMaker is very popular and the easiest to use because it's a WYSIWYG editor.
How exactly do I check it?
Have you done the tutorial that came with MZ? And maybe followed along with a few more from YouTube? If not, I kindly suggest maybe you should.
Don't get me wrong, I'm not trying to discourage you from asking questions, that's absolutely the point of the forums. But you're asking, between your threads so far, how to specifically implement some stuff that can be done with sort of basic things.
You could make a troop event that is triggered by the actor having <= 85% health (and another at 70%, etc.).
You could attach a common event to the attacking skills that checks the actor in there.
Then there are fancier ways to do it using code in a notetag from the VisuStella Battle Core.
The more familiar you are with MZ, the easier it will be to do some of this stuff without having to ask; and conversely, you'll know what it does, so you'll also know what you need to search/ask for a plugin to do.
Don't get me wrong, I'm not trying to discourage you from asking questions, that's absolutely the point of the forums. But you're asking, between your threads so far, how to specifically implement some stuff that can be done with sort of basic things.
You could make a troop event that is triggered by the actor having <= 85% health (and another at 70%, etc.).
You could attach a common event to the attacking skills that checks the actor in there.
Then there are fancier ways to do it using code in a notetag from the VisuStella Battle Core.
The more familiar you are with MZ, the easier it will be to do some of this stuff without having to ask; and conversely, you'll know what it does, so you'll also know what you need to search/ask for a plugin to do.
Does it need the battle system to be unchaged for it to work? I deleted some stuff like the name of the attack option and other things before downloading it, and it just crashes whenever I open the game in it.
I did study by watching some Youtube tutorials, but I totally forgot about MZ's one. I'm going to do it and try your examples, thanks!
Which file did you "delete some stuff" from?
Oh, I didn't delete any files, I just thought it had something to do with the fact that I deleted the names "attack" and "guard" from within the engine itself, because I didn't touch anything else, and I tested whether it would open if I did another project, which happened, so maybe I did something wrong on mine.
You should not be editing the core engine files because:
1. Every plugin and other parts of the engine is built on the assumption that the core files are untouched
2. Any time RPG Maker is updated it overwrites the core files and your changes get erased
3. It makes troubleshooting problems a lot harder because you can't just toggle the core files on and off like you can a plugin.
If you want to edit parts of the core file you should be aliasing those functions or methods in a separate .js file and adding it as a plugin to your project. Then you can easily toggle it on or off.
Oh. I didn't know about that and I've just corrected it right now. Thanks!
Original thread: https://forums.rpgmakerweb.com/threads/making-variables-link-to-the-players-hp-and-influence-in-battle.160356/