So in my game, I want there to be a sniper character with an "Aimed Shot" ability. How I'd like it to work is like the move Focus Punch in Pokemon. Everyone else moves before them. If they don't take damage on that turn, they unleash a powerful attack on a single target that never misses. If they do take damage, the attack fails or misses. How would I do this?
Focus Punch-like attack
RPG Maker VXAce SupportI'm no RM scripter but I do know how to program.
Basically you have a boolean variable set to true which becomes false when hp is reduced.
If you use a speed mechanic, make sure when player chooses that attack, his speed is set to be last.
When everyone has attacked, check the boolean for its value. If it returns true, then FOCUS PUNCH!!! after the attack, set his speed back. (this trick is good only if you dont have a priority mechanic, else just decrease priority just like in pokemon)
I hope that helped. 🙂
Yay for Pokemon
Basically you have a boolean variable set to true which becomes false when hp is reduced.
If you use a speed mechanic, make sure when player chooses that attack, his speed is set to be last.
When everyone has attacked, check the boolean for its value. If it returns true, then FOCUS PUNCH!!! after the attack, set his speed back. (this trick is good only if you dont have a priority mechanic, else just decrease priority just like in pokemon)
I hope that helped. 🙂
Yay for Pokemon
If I got what you want, I think this what you want, although you can't make the action 'miss', but instead make the charge state removeable when damaged, stoping the charge.
Unfortunately that plugin is for MV, and I'm using VX Ace.
I'm going to be honest, a lot of that just flew straight over my head. If I understood you correctly, I'm not sure this would work. I'd have to set a variable to be equal to his current HP at the start of the turn, then somehow check if that variable changed at the end of the turn.
yeah something like
hp_checker = player_hp;
doPunch = true;
and then later, something which occurs whenever a character executes a turn
if(player_hp<hp_checker){
doPunch = false;}
and then when the player/puncher takes his turn
if(doPunch){
insert attack code here*}
Note that that only covers if he attacks or not, not the attack being last. (which would then rely on a speed or priority mechanic)
hp_checker = player_hp;
doPunch = true;
and then later, something which occurs whenever a character executes a turn
if(player_hp<hp_checker){
doPunch = false;}
and then when the player/puncher takes his turn
if(doPunch){
insert attack code here*}
Note that that only covers if he attacks or not, not the attack being last. (which would then rely on a speed or priority mechanic)
Okay, now you've completely lost me.
Lol. Wait, do you know how to script? or are you learning RM scripting BEFORE you actually know how to program? which I would then understand. Coz if the former, discussing the logic to you would be easy 🙂
I have no scripting knowledge whatsoever.
If I understood correctly, you had a game idea, downloaded RM, and straight off went asking how to do what you want?
If yes, then I very strongly recommend you watch some basic tutorials on youtube first. So you would get an idea of how scripting actually works.
If yes, then I very strongly recommend you watch some basic tutorials on youtube first. So you would get an idea of how scripting actually works.
or is there an easy drag and drop (or similar) feature for RM coz I'm not really familiar w/ it lol
You don't need to know scripting to make games with it.
yeah after actually doing some youtubing myself (oh the irony).. figured it's pretty way different. But I'd still get into it 😉
Edit: Seems like what you want to achieve is much more complicated. RPG maker is less flexible than Game maker since it aims to be user friendly.
What I know so far is:
For the decreased priority, you could by default add Speed to every skill (eg. +100 depending on your players' base speed). Since every skill gets the same plus, it won't affect anything.
NOW the Snipe skill won't have this plus, and depending on ur characters speeds, this could mean the user pretty much moves last.
If your MAX obtainable speed is 100, add 200 to all skills except Snipe.
What this means is:
+300 priority +1
+200 Normal
+100 priority -1
+0 priority -2
Get it so far?
About the damage, you could make a switch which gets toggled when user is hit. If he gets hit, it should be switched off/0
On the damage Formula, simply multiply the whole thing to the switch value.
After attacking remember to change the switch back to 1
@Nin Double posting is against the forum rules.
For the sake of efficiency, I would prefer to setup such skills differently, but that would require some coding. Anyway, this isn't too difficult to pull off with events.
(Check Spoiler For Examples)
The actor using this skill will only need to learn Aimed Shot, the FIRE skill should be left out of all skill lists.
Note the speed setting on the Aimed Shot skill, I set it to an extremely high value so that the skill is executed first during a turn, giving enemies an opportunity to interrupt the skill during a turn. The skill itself targets one enemy but, all it does is add the Aiming state to the user. The aiming state will be removed if the user of the skill receives damage or is restricted in any way. Finally there's a troop event that checks if an actor, Brenda in this case, has the aiming state during the end of the turn. If so, the FIRE skill is executed on the last target (this is why aimed shot needs to target an enemy) and the aiming state is removed.
Unless I missed something, I think that about covers it. Again, there are better ways to do this, but that would require going beyond the event system.
For the sake of efficiency, I would prefer to setup such skills differently, but that would require some coding. Anyway, this isn't too difficult to pull off with events.
(Check Spoiler For Examples)
The actor using this skill will only need to learn Aimed Shot, the FIRE skill should be left out of all skill lists.
Note the speed setting on the Aimed Shot skill, I set it to an extremely high value so that the skill is executed first during a turn, giving enemies an opportunity to interrupt the skill during a turn. The skill itself targets one enemy but, all it does is add the Aiming state to the user. The aiming state will be removed if the user of the skill receives damage or is restricted in any way. Finally there's a troop event that checks if an actor, Brenda in this case, has the aiming state during the end of the turn. If so, the FIRE skill is executed on the last target (this is why aimed shot needs to target an enemy) and the aiming state is removed.
Unless I missed something, I think that about covers it. Again, there are better ways to do this, but that would require going beyond the event system.
Is there any way to do this without having to add a page to every troop page?
Base Troop Events by Yanfly. It's a useful script to have in general, and it would be a lot easier than redesigning the event.
Original thread: https://forums.rpgmakerweb.com/threads/focus-punch-like-attack.66145/



