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
160
Reaction score
30
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
155
Reaction score
94
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
965
Reaction score
708
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
160
Reaction score
30
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
160
Reaction score
30
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
155
Reaction score
94
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
160
Reaction score
30
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
6,611
Reaction score
5,669
First Language
English
Primarily Uses
RMMV

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: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I get haunted from bugs that emit a terrible stench after being killed.
At first, I was going to put player objectives on the screen labeling it as "Helpful voices"... But that's dumb, I have a madness system. It will simply whisper objectives.... I mean they're probably objectives. The voices wouldn't lie right? They're friendly, and ...helpful. So clearly you should do what they say. Just watch the dark corners of your screen for advice and it will all work out! :LZSexcite:
Take care of your immune system: Go to sleep. If you looked at the clock an hour ago or four and it was way late then maybe now is the time. Mmm sleep...
Long time since last post but still here, still working on games. Hope everyone has been well.

Forum statistics

Threads
95,661
Messages
930,872
Members
125,997
Latest member
Jaz_D3mon
Top