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

MerchantLegends

Merchant Prince Digital
Regular
Joined
Jun 29, 2014
Messages
71
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
 

Oxem

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

MerchantLegends

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

Oxem

Regular
Regular
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
Regular
Joined
Jul 2, 2014
Messages
11,035
Reaction score
8,955
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

Regular
Regular
Joined
Sep 29, 2021
Messages
582
Reaction score
508
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
Regular
Joined
Jul 2, 2014
Messages
11,035
Reaction score
8,955
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

Regular
Regular
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 Posts

Latest Profile Posts

This hero got 99 problems, but an elf ain't one of them. Just enjoying the sunset with Prim.
Some storyboard thingies for an opening cutscene, I started work on it a couple months ago but I didn't get much done.
Cutscecne-Story-Board.png
Is it okay to post links to your game when its completed in the profile posts here? I'm wondering because I've never done it out of concern it may come off as gauche, or may be against some rule or something, but I've seen others do it.
Okay... I went and got examined... apparently I have had 'cardiac events'. But the current problem is a bit of inflammation around my heart, and in airways. So... got some medication and two days off work. Yay. :p

Forum statistics

Threads
134,797
Messages
1,250,733
Members
177,589
Latest member
scott_wollman
Top