RMMV lunatic moted selecting state affected allies

Lu_

Veteran
Veteran
Joined
Sep 26, 2019
Messages
41
Reaction score
14
First Language
German
Primarily Uses
RMMV
i am using 2 states to kinda bind an enemy and an actor. that the enemy dies when the actor dies and the other way around. i am using this in the actors state
Code:
if (target.hp <= 0) {
  var enemies = origin.opponentsUnit().aliveMembers();
  for (var i = 0; i < enemies.length; ++i) {
       var enemy = enemies[i];
       if (enemy.isStateAffected(26)) {
           enemy.startAnimation(161);
           enemy.setHp(0);
           enemy.clearResult();
           enemy.performCollapse();
       }
  };
}
and its working perfectly. the enemy dies when the actor dies. but it wont work the other way around. thats the enemys state
Code:
if (target.hp <= 0) {
  var members = origin.???Unit().aliveMembers();
  for (var i = 0; i < members.length; ++i) {
       var actor = members[i];
       if (actor.isStateAffected(25)) {
           actor.startAnimation(161);
           actor.setHp(0);
           actor.clearResult();
           actor.performCollapse();
       }
  };
}
i dont know how to call on actors
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
542
Reaction score
255
First Language
German
Primarily Uses
RMMV
i dont know how to call on actors
JavaScript:
$gameActors.actor(1)
// this is actor 1
JavaScript:
$gameParty.leader()
// this is the Group Leader (actor)
you can find a lot of Helpful Scriptcalls here:
Usefull Scriptcalls Info (Page is not made by me)
alternative Scriptcall List (Page is not made by me)

Example :
JavaScript:
       if ($gameActors.actor(1).isStateAffected(25)) {
           $gameActors.actor(1).startAnimation(161);
           $gameActors.actor(1).setHp(0);
           $gameActors.actor(1).clearResult();
           $gameActors.actor(1).performCollapse();
       }
Also try to use the Console f8 and use things like :
"$gameActors.actor(1)" (enter)
to find out how they are related to other things within Your System
Screenshot_6.png


Edit 1
another Example for Console f8 with using :
"$gameActors" (enter)
Screenshot_7.png


Edit 2
SideNote:
JavaScript:
$gameActors._data.length;

// returns the Number of Actors in Your Project
example Img:
Screenshot_8.png
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,469
Members
137,821
Latest member
Capterson
Top