Enemy skill which adds enemies to the current battle

● ARCHIVED · READ-ONLY
Started by Countyoungblood 7 posts View original ↗
  1. as stated above, Id like an enemy to be able to bring more enemies into battle.

    I tried:
    $game_troop.members.new(1)

    which did nothing.. so i tried looking at game_enemy and game_troop to try to find something i could work with.. i found:

    Game_Enemy.new(@enemies.size, member.enemy_id) which i filled with 1,1 thinking @enemies.size would mean how many? and the id of the monster id want to add.

    this also, did nothing.

    Code:
    def setup(troop_id)
        clear
        @troop_id = troop_id
        @enemies = []
        troop.members.each do |member|
          next unless $data_enemies[member.enemy_id]
          enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
          enemy.hide if member.hidden
          enemy.screen_x = member.x
          enemy.screen_y = member.y
          @enemies.push(enemy)
        end
        init_screen_tone
        make_unique_names
      end

    I believe the answer is here somewhere but I don't understand how to accomplish this.


    could i call setup with the same troop id? even if that worked wouldnt it reset the monsters who called it?
    i see enemy.hide.. is this what happens when enemies are killed but the battle isnt finished? if this were the case then reviving the enemies would work.. i think. will continue to tinker but id appreciate input.

    update: so enemies can revive eachother just like the party can.. so for my uses a spell that revives enemies will work just fine. so issue resolved.
  2. here is another method:
    Add the enemies you want to add later to the troop as normal, then right-click them and select "appear halfway" and they'll become transparent and will not be available at the start of the battle.
    then have your skill call a common event and in the event, use the "enemy appear" command to make any of those hidden enemies available at that moment (one command per enemy, the number is the index of the enemy in the troop)
  3. Ah see i havent really gotten into events yet i will have to look into what options they add
  4. that is rather backwards - its usually easier to learn events first and only go to scripts for things that can't be done by events, especially because event commands are much better integrated into the engine compared to scripts (where you have to make sure everything works for yourself)
  5. So far Ive only been using the very basic events like doors chests monsters shops.. i haven't actually needed anything else because my project is pretty minimalist. one island with one shop one dungeon and one boss. no item upgrades, no storyline, no cutscenes, no dialog, no level ups. just combat mechanics and synergistic equipment.
  6. The issue is resolved, but if you know why your last attempt was vain is because the sprite battler of the enemy need to be refreshed.

    The battle starts with a fixed number of sprite battlers. One that handle the image that shows in the game is separated with the one that handle the enemy game object (one that contains information of HP/MP/States etc). You add one enemy, you have to refresh the sprites as well. This may need a script. May or may not easy to make. But again, you can do workaround like appear halfway, but u still limited to maximum 8 battlers at once.
  7. TheoAllen said:
    The issue is resolved, but if you know why your last attempt was vain is because the sprite battler of the enemy need to be refreshed.

    The battle starts with a fixed number of sprite battlers. One that handle the image that shows in the game is separated with the one that handle the enemy game object (one that contains information of HP/MP/States etc). You add one enemy, you have to refresh the sprites as well. This may need a script. May or may not easy to make. But again, you can do workaround like appear halfway, but u still limited to maximum 8 battlers at once.

    ah, well i was ok with the idea of having to call a function to do what needed to be done in order to add the enemy but Im very new to both ruby and rgss.. so though i had a vague idea i couldnt piece it together. Im aiming to learn a bit of ruby while I poke around and learn the capabilities of the damage formula at the same time.