Script references for last element id used on enemy

Status
Not open for further replies.

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
As I said in title, I need references for scripting with last element id used on enemy, in addition I must insert into a variable the last element id used on a specified enemy and compare with latest(more recent) element id used.

example:
enemy hit by ice by a member, then another member hit same enemy by fire, how to call references for that?Which is the best way to use in enemy or skills category?
would be useful a common event in battle(through yanfly script)?
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Hello, you can't reference that cause once an action is done, it's done; the engine don't keep track of the last element used.
I think the easier way to do this would be to use states. When an enemy is hit by a fire skill, it receive a "fire state" lasting a couples of turns. When hit by ice while the "fire state" is still active, it alter the effect of ice (amplifying damage I guess...), than remove "fire state" and add "ice state", and so on.
You can set a state for each elements or have a single state that react differently dependending of the element, using scripting notetags of YEP_BuffsStatesCore.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
You can grab the last action through a common event run as an Effect for the skill.

Code:
BattleManager._action.item().damage.elementId
But yeah, better off using a state.
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
As I wrote in private Ossra, there's the problem of natural defence.

If a monster have 300% def to fire and the state vulnerability set 200% bonus, this does not count as a vulnerability.

even setting a vulnerability higher would be unbalanced cause some monsters will get huge damage and others instead the normal bonus(example 1000% on a 100% resistance monster is 900% and 1000% on a 500% resistance only 500%).
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
In addition, not every monster must get the combo skill damage, only some:

for the rocky monsters:

ice fire combo

for normal monsters not.
So I cannot set this state on skill effect cause will be applied to all targeted monsters.
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
So I cannot set this state on skill effect cause will be applied to all targeted monsters.
You can have the state to be conditionally applied depending on enemy id?
Code:
<Before Eval>
  if (target._enemyId === X) {
    target.addState(Y)
  }
</Before Eval>
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
yeah through yanfly battle scripts, I will use that, in case I will pm you and Ossra in future for a better solution, thanks
 
  • Like
Reactions: TSR

Touchfuzzy

Rantagonist
Staff member
Lead Eagle
Joined
Feb 28, 2012
Messages
7,303
Reaction score
8,928
First Language
English
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

On my journey of character rework: I had this character, she was meant to be just a princess that joins your party. And at long term she was just uninteresting... So I tweaked her to be a rebel agaisn't the royalty before meeting up with the party.

Quick tip for any other ametuer pixel artists! When trying to create a colour palette, enabling Antialiasing can speed up the process of creating different shades! Just place your lightest colour and your darkest colour next to each other, select both pixels, and stretch it out!
Revolutionizing the JRPG Industry: Knocking on Doors.

Take that, murderhobos.
Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.

Forum statistics

Threads
106,054
Messages
1,018,578
Members
137,843
Latest member
Betwixt000
Top