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


I ended up needing to do a chapter one world map remake. It's still WIP but coming along nicely. =D
Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.
I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.

Forum statistics

Threads
107,748
Messages
1,031,863
Members
139,890
Latest member
jpw5280
Top