Skill that Targets Random Ally

Discussion in 'RPG Maker VX Ace' started by Vis_Mage, Oct 7, 2018.

  1. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    401
    Likes Received:
    142
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    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?
     
    #1
  2. Shiro-chan

    Shiro-chan Friendly Neighbourhood Neppy Maid Veteran

    Messages:
    103
    Likes Received:
    23
    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
     
    #2
  3. Kes

    Kes Global Moderators Global Mod

    Messages:
    21,052
    Likes Received:
    10,702
    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.
     
    #3
    Shiro-chan likes this.
  4. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,509
    Likes Received:
    3,763
    Location:
    Florida, USA
    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).
     
    #4
    Shiro-chan and TheoAllen like this.
  5. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    401
    Likes Received:
    142
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    A bit late on my response, but thank you everyone for your help! :kaopride:
     
    #5

Share This Page