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
514
Reaction score
242
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

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,096
Members
137,587
Latest member
Usagiis
Top