Thordon123

Veteran
Veteran
Joined
Feb 4, 2018
Messages
52
Reaction score
6
First Language
English
Primarily Uses
RMMV
Hi all, I'm working on a combat system at the moment where players can choose to either dodge or attack with extra accuracy each turn. What I want, ultimately, is for the player to choose a skill ( called "Aimed Attack") that works like a normal attack, but gives a 1-turn duration 30% boost to Hit Chance beforehand. My problem is that such a skill actually has two targets- the player first for the buff, and then the monster after for the damage, and I don't know how to accomplish that. Is there any way to do this?

Thanks in advance!

PS: I know the skill sounds kinda dumb without context but I've lowered the hit chances for actors and enemies to 70% average so that the decision of whether or not to aim becomes important.

PSS: Also I know that I could give a restriction to the Aimed state to force the player to attack, but in that case they don't choose their target which defeats the purpose
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
12,003
First Language
English
Primarily Uses
RMVXA
You can do this using the damage formula. I am assuming that the HIT buff is being done by creating a state. For the sake of this example, let us assume it is state 59.

a.add_state[59]; a.atk * 4 - b.def * 2

Of course you can change the a.atk * 4 - b.def * 2 to whatever damage formula you are using.
 

Thordon123

Veteran
Veteran
Joined
Feb 4, 2018
Messages
52
Reaction score
6
First Language
English
Primarily Uses
RMMV
Hey thanks! I just tried that, but unfortunately it only deals null damage now :p More and more bugs...
 

Thordon123

Veteran
Veteran
Joined
Feb 4, 2018
Messages
52
Reaction score
6
First Language
English
Primarily Uses
RMMV
I think putting the add state command in the damage formula prevents the ability from dealing damage. Unfortunately, adding the state to the effects box only applies it to the enemy
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
12,003
First Language
English
Primarily Uses
RMVXA
I use that sort of formula a lot, and adding a state should not produce zero damage.
BUT I noticed an error in what I gave you. I used [] brackets, and it should have been () brackets, so try
a.add_state(59); a.atk * 4 - b.def *2
obviously changing the 59 to the number slot of the state you actually want to add.
 

Thordon123

Veteran
Veteran
Joined
Feb 4, 2018
Messages
52
Reaction score
6
First Language
English
Primarily Uses
RMMV
Ah I see. I put it in but now the game crashes and I get the message:
-------------------------------------------
Script 'Game_Battler' Line 352: SyntaxError occured

Unexpected tSTAR, expecting $end
a.add_state(26); a.atk * 4 - b.def *2
-------------------------------------------------------
I tried changing the damage formula to

a.add_state(26); a.atk * 4 - b.def *2; end;

but that didn't work either, same error message though displaying the updated formula

Also, 26 is the state number I'm using

EDIT: I'm still screwing with it but it insists that there should be an end command somewhere. Wherever I put it it doesn't work, though.
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
12,003
First Language
English
Primarily Uses
RMVXA
Try
a.add_state(26); end; a.atk * 4 - b.def * 2

"ends" are always my weak spot. Notice that there is a semi-colon after the 'end' as well as after adding the state.

My problem is that I am not on my laptop, so can't check what's in my own database for reference.
 

Thordon123

Veteran
Veteran
Joined
Feb 4, 2018
Messages
52
Reaction score
6
First Language
English
Primarily Uses
RMMV
Okay, I'll keep screwing with it.

If it isn't asking too much, could you inbox me your formula once you've got your laptop again?

Thanks again for all the help!

Edit: Unfortunately it still doesn't work... same error message...
 

Latest Threads

Latest Posts

Latest Profile Posts

Nightmare... Dreamt I posted a GFX resource post. With a work in progress glove icon that tinted to different colors. In the wrong forum. And I was in such a panic. I saw people writing posts in response, those "..." you see in discord and such. So I frantically tried to report my post as wrong forum, editing to say it's the wrong forum and that I "accidentally" posted it too early... Very odd dream to be honest...
The youngest photo of you is also the oldest photo of you.
People need to stop submitting their game to every single game jam without even reading the jam rules (╯°□°)╯︵ ┻━┻
Mom tested positive for COVID thanks to a single stupid coworker of hers not taking sh*t serious.
I'll prolly won't be on here for a while as we deal with this.
So before I inevitably start a new project to reorganize myself (I will make sure to save important info dw), I will make an external list of what I want in the final database.

Forum statistics

Threads
117,195
Messages
1,105,393
Members
153,334
Latest member
oGinToki
Top