RMMV lunatic moted selecting state affected allies

Lu_

Veteran
Veteran
Joined
Sep 26, 2019
Messages
40
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
493
Reaction score
222
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

being able to transition music seamlessly is amazing. my main character's theme has lyrics and it goes from vocal version to istrumental when he leaves his room. and vice versa. and thanks to a plugin, the transition is seamless. I love it.
All of the auditions for our game are so good, I'm so glad I'm not in charge of choosing completely. lol I just can't with some of them. I listen to them on repeat. XD
Working on a Patch to integrate AlphaABS into random generated Dungeons. Was a bit tricky, but the outcome is a real Life Changer!!

Will release it the next days!
Been pretty busy... but I got a better headset for recording and listening today. Dad says that he'll consider taking me to Great Wolf Lodge for the first time once I finish summer classes (my final semester!) I'll be taking my plushie friends with me: Bendy, Lolbit, and Helen Henny. (I WUV PLUSHIES!)
SF_Monster3,4 added!

Forum statistics

Threads
105,651
Messages
1,015,295
Members
137,327
Latest member
Mezzy
Top