Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Ally = Enemy?

I was wondering if there was a way you could call up an ally as an enemy in battle, using their abilities and stats, even their equipment. I want to make it that way because there are two actors that join your party, but you also have to fight them, sometimes immediately.

Also, is there a way to determine an actor by an enemies stats? Say, just have an enemy join you, but as an actor. In battle, it would probably still be processed as an enemy, and do things like it is programmed to do there.

Thanks ahead of time.
 
Since Game_Actor and Game_Enemy aren't equal in terms of atributes, you can't simply "pass" data over, for example the equipment, which isn't included in the Game_Enemy module at all. What you can do is storing $game_party.actors[index].base_atk, as well as the other attributes in variables and use them as startup values for an enemy, for example by adding something around this:
Code:
Game_Battler
  #--------------------------------------------------------------------------
  alias variable_enemy_atk atk
  def atk
    for i in $game_actors
      if @battler_name == $game_actors[i].name
        return $game_actors[i].base_atk
      end
    end
    variable_enemy_atk
  end
  #--------------------------------------------------------------------------
end
Try this by inserting it in a new script above main. I didn't test it, but it should work when you name an enemy with an attack of any number (you can let it rest at 0, because it'll get changed either way), it's passing the attack value from the actor to the enemy directly... you can duplicate this script thrice to get the other attributes as well.

EDIT: Changed $data_actors to $game_actors for obvious reasons... >_<
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top