[RMVX ACE] TRYING TO MAKE A SKILL THAT IS BOTH OFFENSIVE AND DEFENSIVE
Posts
Pages:
1
So I am trying to make an attack that lowers the opponents hit rate as well as providing a small amount of HP and MP recovery.
First thing is, I know that I cannot just throw the 'add state' and 'recover HP' and 'Recover MP' all into the "on use effects" because it will just heal the monster as well as reduce its hit rate.
I also noticed "change HP" and "change MP" only allows you to put in specific values and NOT percents. So, I just cannot throw a simple change hp/mp common even flag onto the move.
Now, I know that variables are a thing but I do not know much about them. I did watch one video on variables but the uploader only touched up on the basics. He never went into percentages or anything. But I did notice that "mod" looks like this: Variable Operation %=20
So, I set my common variable event like this: https://i.imgur.com/cocA6JM.jpg
And I set my skill up like this: https://i.imgur.com/FMKBms0.jpg
Did I set this up right? I feel that it needs to be more complex than that.
I really don't have a way to test it yet. The character is going to learn the skill through the MSQ and he is going to learn it mid-battle through a battle event and by the time it comes to do the battle, it would already be too late if it goes wrong. So, I want to make sure I got it right before I get to that part in testing.
Is what I did how that is supposed to be done? If not, then what do I need to do to make this skill the way I want?
First thing is, I know that I cannot just throw the 'add state' and 'recover HP' and 'Recover MP' all into the "on use effects" because it will just heal the monster as well as reduce its hit rate.
I also noticed "change HP" and "change MP" only allows you to put in specific values and NOT percents. So, I just cannot throw a simple change hp/mp common even flag onto the move.
Now, I know that variables are a thing but I do not know much about them. I did watch one video on variables but the uploader only touched up on the basics. He never went into percentages or anything. But I did notice that "mod" looks like this: Variable Operation %=20
So, I set my common variable event like this: https://i.imgur.com/cocA6JM.jpg
And I set my skill up like this: https://i.imgur.com/FMKBms0.jpg
Did I set this up right? I feel that it needs to be more complex than that.
I really don't have a way to test it yet. The character is going to learn the skill through the MSQ and he is going to learn it mid-battle through a battle event and by the time it comes to do the battle, it would already be too late if it goes wrong. So, I want to make sure I got it right before I get to that part in testing.
Is what I did how that is supposed to be done? If not, then what do I need to do to make this skill the way I want?
The '%' operator is the modulus operator. It basically returns the remainder portion of a division operation. So, what's happening in your Common Event is that whatever number is stored in `$game_variables[4]` will divide by 20, then return the remainder of that division back into `$game_variables[4]`. Likewise, whatever number is stored into `$game_variables[5]` will divide by 10, then return the remainder of that division back into `$game_variables[5]`.
Technically, do to what the skill intends, what you could do in that Common Event, is something like...
...this into the Script Event-Command. I think. I could be temporarily forgetting the syntax of the `ceil` method in Ace, since I've been working in MZ more recently.
*Edit: Gave this a few brief tests in a clean project. I will note that using this method did not print the restoration of HP/MP into the battle log, but, the other effects of the skill should print as normal.
*Edit2: For the sake of completeness, there are percentile-based options under the "Effect" portion for HP and MP in regards to items and skills. Of course, such effects apply to the target, and not the user, so it's not relevant in this case. Still, I thought I should mention it since the options that were discussed in the OP did not.
Technically, do to what the skill intends, what you could do in that Common Event, is something like...
# Note: I'm assuming "Justin" is the actor in position 1 in the database. $game_actors[1].hp += ($game_actors[1].mhp * 0.2).ceil $game_actors[1].mp += ($game_actors[1].mmp * 0.1).ceil
...this into the Script Event-Command. I think. I could be temporarily forgetting the syntax of the `ceil` method in Ace, since I've been working in MZ more recently.
*Edit: Gave this a few brief tests in a clean project. I will note that using this method did not print the restoration of HP/MP into the battle log, but, the other effects of the skill should print as normal.
*Edit2: For the sake of completeness, there are percentile-based options under the "Effect" portion for HP and MP in regards to items and skills. Of course, such effects apply to the target, and not the user, so it's not relevant in this case. Still, I thought I should mention it since the options that were discussed in the OP did not.
You could just assign a variable to the actors max HP and Max MP, then do some basic arithmetic. If you want their HP to increase by 5%, then divide the variable by 20 and increase the actors current HP by the variable. Ruby doesn't like floats for some reason, and in game variables are always integers, so if you want something like 3% you could multiply the actors max HP by 3, then divide by 100 to get that. Usually my workaround for things like that.
Pages:
1
















