attack formula variables

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
622
Reaction score
403
First Language
English
Primarily Uses
RMVXA
Id like an attack to grab the Id of the target and save it in a variable so my state checking method can read it and apply/remove states.

The goal is an attack that binds the user and target together and both lose the state if it falls off one of them (via damage)

Multiple users can be inflicted and have their own specific marked target so i need something to attach the target to the attacker and vice versa.
 

Gamefall Team

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
348
Reaction score
473
First Language
Italian
Primarily Uses
RMMZ
Mmm... How about trying to use a little trick in your damage formula?

Code:
a.atk * 4 - b.def * 2 if v[2] = b.enemy_id || b.id()

Using this formula inside a skill in your database will actually do that:

- First of all, just write the damage formula you want to use for the skill. In the example above, I have used the default one of the attack skill. If you don't want any damage, you can just write 0.

- After that, I have written a "fake" if condition (that will be always true) that actually sets in the variable data array on the index 2 (That is the Variable ID. You can change it with the ID you prefer) the TARGET (b) enemy_id (if the target is an enemy) OR (||) if the target is an actor the actor id (b.id()).

Using this method, you can execute the code for storing the ID in a variable directly in the damage formula :kaojoy:
 

Latest Threads

Latest Posts

Latest Profile Posts

Ami


Imagine you (as Miner) Sleep in the Cave,the other side is a Bunch of Golds,how d'you feel?
finally got footage of my main character running around his corrupted street...
I finally got the ships and water to flow like I wanted to~ the canals are a success. Now to loop the animation for the kites. So many kites.
Bendyizzt wrote on staggqueen's profile.
Hello Newcomer...

Forum statistics

Threads
107,694
Messages
1,031,492
Members
139,818
Latest member
mindofjsp
Top