Skill that Targets Random Ally

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
574
Reaction score
196
First Language
English
Primarily Uses
RMMV
Hey :)

I'm running into a bit of trouble creating a skill. I am hoping to make a healing skill that heals a random (not dead) ally. Is there an easy way of doing this that I'm missing?
 

Shiro-chan

Friendly Neighbourhood Neppy Maid
Veteran
Joined
Aug 7, 2018
Messages
151
Reaction score
42
First Language
German
Primarily Uses
RMVXA
Not exactly, but we do such things the following way:
-have your "random ally" skill affect all your allies, and have it run a common event
In the CE:
-a random value from 1 to [highest number of party member, depending on how many members you have], let's say you have 3 playable chars so it's random1-3
-asign via conditional branches 1 number to a char
-for each member branch make a new Conditional Branch regarding if the character is actually in the team, and a second if the character in question has the first status (defeated/dead), if char is not in team or has that status, it labeljumps back to before the random process and runs again until it finds a character that's in fact in the team
-that character is then applied the effect you want

Possible issues:
-the game may or may not be clever enough to recognise that people beyond the battle team limit (i.e. more than 4 chars in your party) are in fact not in the battle
--this could be solved by modifying the battle base script to apply a particular status to a given party combatant (and remove it after a given battle too), which would also replace the "Are you even in the party?" check
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
To restrict it to those in the active party use this script call in your conditional
$game_party.battle_members.include?($game_actors[x])

where x = the ID of the actor.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Use my Enhanced Random Targets script (note that if you are developing a commercial game, use of this script will require a cheap license before you release the game).

You will need to turn on the "Random Allies" section of the script in order to do this. Go down near the bottom of the script and it will explain how to do this. Then, just set the Scope to "None" for the skill, and use the Notetags to specify the number of random allies that should be targeted (1).
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
574
Reaction score
196
First Language
English
Primarily Uses
RMMV
A bit late on my response, but thank you everyone for your help! :kaopride:
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top