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
472
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:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

currently listening to Driftwood Gaming streaming some MZ dev time and it's delightful! had no idea they were this entertaining, love it
In quarantine, will be tested soon. This year is really something... special.
I was at another orientation yesterday and I realized I'll be working with an old friend! We met at the local water park a few years back and it was so nice to see her again! We had a chat, and next week when I officially start, I'll see if maybe we can trade our Zoom IDs so we can talk!
I made some sideview closets for MV!
You can find them in my MV resource thread.

Forum statistics

Threads
105,510
Messages
1,014,330
Members
137,197
Latest member
Nicole_cc
Top