RMMV What script call to check if actor is taking damage?

dwiseman57

Merchant Prince Digital
Veteran
Joined
Jun 29, 2014
Messages
68
Reaction score
11
First Language
English
Primarily Uses
N/A
I am using SumrndmDde to make a custom battle HUD in MV. Frontview.

I want to display a picture, (e.g a lightning bolt) over my actors face when the actor is attacked.

In the "condition" field of Hud Maker, I need to put something like

Code:
BattleManager._targets._actorID==1

So that the picture will only display, if the actor ID being targeted is "1"

But it doesn't work. I'm not very familiar with JS or BattleManager so I'm not sure if I am even close.
Whats the best way of populating the "condition" on sumrndmDde Hud Maker so that my picture only shows whilst the actor is being attacked ?

Please help?

1642001339145.png
 

dwiseman57

Merchant Prince Digital
Veteran
Joined
Jun 29, 2014
Messages
68
Reaction score
11
First Language
English
Primarily Uses
N/A
Can anyone help?
 

dwiseman57

Merchant Prince Digital
Veteran
Joined
Jun 29, 2014
Messages
68
Reaction score
11
First Language
English
Primarily Uses
N/A

Oxem

Veteran
Veteran
Joined
Sep 30, 2015
Messages
30
Reaction score
8
First Language
French
Primarily Uses
Im looking for that too but im on MZ
 

dwiseman57

Merchant Prince Digital
Veteran
Joined
Jun 29, 2014
Messages
68
Reaction score
11
First Language
English
Primarily Uses
N/A
Sadly I never got an answer :( hope you have more luck than me
 

Oxem

Veteran
Veteran
Joined
Sep 30, 2015
Messages
30
Reaction score
8
First Language
French
Primarily Uses
I will let you know friend !

PS : I finally found a way this morning ! but im not sure if it will work on mv too

In Hud maker make a variable condition like this for your picture.

and in your yanfly action sequence (for every enemy attack in order to know which actor is selected at the beginning of the action sequence) put this script call :
$gameVariables.setValue(19, BattleManager._targets[0].index());

It should work !
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,553
Reaction score
3,619
First Language
English
Primarily Uses
RMMV
@dwiseman57 You had the right idea, but your JavaScript syntax was very wrong. Try:
Code:
BattleManager._targets.includes($gameActors.actor(1))

@Oxem In this case, it might work out for you. But as a general rule we're not supposed to necro-post, especially when your question isn't actually the same question as the existing thread (the code could be different in MZ).
 

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
447
Reaction score
368
First Language
German
Primarily Uses
RMMV
@ATT_Turan I would expand the condition to something like this:
JavaScript:
BattleManager._targets.includes($gameActors.actor(1)) && BattleManager._subject.isEnemy()
Otherwise your damage indicators will also show up when an actor gets targeted by another actor's heal spell or similar. Of course the exact conditions you want would heavily depend on the specific project.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,553
Reaction score
3,619
First Language
English
Primarily Uses
RMMV
@eomereolsson Pssh, I often get a lightning bolt on my face when a friend heals me.

...good call. :stickytongue:
 

Oxem

Veteran
Veteran
Joined
Sep 30, 2015
Messages
30
Reaction score
8
First Language
French
Primarily Uses
If i didn't, the thread will be remain unanswered. I didn't know about this rule.
Anyway hope it will work !
 

Latest Threads

Latest Profile Posts

DamageEvil_5.png added!
index.php

Rendering the intro for the 4 time today, everytime it finished I noticed something that I found off and had to fix it and render it all over again...
Would not be so bad if it was not for my PC having the speed of a slug.:kaoswt2:
Tried something. Little sneak peak of Unity AD.
M42S7Us.gif

It's the little things. Lengthened the time the bar fades in and out to be a bit more comfortable.

Forum statistics

Threads
125,739
Messages
1,173,123
Members
164,888
Latest member
EternalLord
Top