Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
hogdogger

Make Enemy Un-selectable?

Question

Hello everyone! I've been reading this forum for a long time but I've finally hit a snag that's puzzled me enough to need to ask for help. Any input would be appreciated!

 

I'm making my last boss and the idea is that it's a robot with an armored exterior and then a vulnerable core. What I want to do is make it so that the core is not selectable unless the armor is KO'ed. After 3 or so turns, the armor regenerates and you must get through it again to continue damaging the core.

 

Since I can't find a way to make the core un-selectable on its own or have it disappear and reappear, what I ended up trying to do was:

 

1. Make the graphic of the core part of the battleback

2. Make the battler graphic of the core just invisible

3. Have the armor face enemy immortal, and transform into the core enemy upon its HP reaching zero.

4. Use a variable to keep track of the core's HP so that after 3 turns, the core can transform back into the face, and the next time the face is KO'ed, the variable will restore the core's HP level.

 

The problem is that upon KO'ing the face for the first time, the battle freezes. There's a hangup somewhere that I'm not getting.

 

 

XjqKD.png

 

sg3D1.png

I put the "force action" at the end to see if that would get things to move on but it didn't.

 

E4Lm3.png

 

yHitr.png

 

Every enemy on the screen is supposed to die when the core's HP is depleted but not until then.

 

 

I have messed around with "Turn" and "Moment" settings but none of that seems to change anything.

Edited by hogdogger

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

This seems all very complicated to me. The solution that comes to my mind is to make the core dead, I mean, technically dead. Thus you can't interact with it anymore. Then, when the armor is low on HP, you may respawn the core and kill the armor. You could use a variable to keep track of the core's HP while it's down to give it back when the armor wears out. Also, you could display a picture in place of the core, so that the player gets the impression it's still there and alive.

Share this post


Link to post
Share on other sites
  • 0

Here this is what I use, http://www.rpgrevolution.com/forums/index.php?showtopic=40199

 

and if you're using Tankentai SBS I have the fix for that since this script won't work without the fix.

Share this post


Link to post
Share on other sites
  • 0

I haven't evented in ages... Seems too complicated for me.

 

So, instead, here's a scripting solution that might help you out (I hope this is what you are looking for)

 

Instructions:

- Place script above main, but below other scripts (blah blah as usual)

- Create a new state in the database called "non-targetable" or something similar (MAKE NOTE OF THE STATE'S ID NUMBER)

- Head to the top of the script, and set the NON_TARGETABLE_STATE_ID equal to the number of the state's id in the database

- When enemy has state "Non-Targetable" they CANNOT be selected

 

Caveats:

- Because of the nature of RMXP's default scripts, the methods for selecting targets had to be completely overridden; THEREFORE, there is a VERY high chance of compatibility issues with any custom script that affects the targeting system/enemy target arrow

 

Demo:

This demo contains a rudimentary replication of what you are trying to achieve (to give you an idea)

Try out the battle test for the first troop, lemme know if that's what you are looking for

(the hellhound has 5 hp, so you can kill it in one hit, and revives after 3 turns)

(you could probably make a better battle event setup than me...honestly I'm no eventer)

(the state "non-targetable" is setup to NOT modify the enemy's stats, and priority is set to 0, this is so if you want to use this feature on an actor, the text "non-targetable" will not show up in the state listing.)

http://dl.dropbox.com/u/30100812/Unselect.exe

 

 

class Arrow_Base
 # --------------------------------------------------------------------------
 # CONFIGURATION
 # --------------------------------------------------------------------------
 # Set this value equal to the id of the "non-targetable" state
 # you created in the database
 # --------------------------------------------------------------------------

 NOT_TARGETABLE_STATE_ID = 17

 # --------------------------------------------------------------------------
 # END CONFIGURATION
 # --------------------------------------------------------------------------
end

class Arrow_Enemy < Arrow_Base
 def update
   super
   # Skip if indicating a nonexistant enemy
   $game_troop.enemies.size.times do
     break if self.enemy.exist? && !self.enemy.state?(NOT_TARGETABLE_STATE_ID)
     @index += 1
     @index %= $game_troop.enemies.size
   end
   # Cursor right
   if Input.repeat?(Input::RIGHT)
     $game_system.se_play($data_system.cursor_se)
     $game_troop.enemies.size.times do
       @index += 1
       @index %= $game_troop.enemies.size
       break if self.enemy.exist? && !self.enemy.state?(NOT_TARGETABLE_STATE_ID)
     end
   end
   # Cursor left
   if Input.repeat?(Input::LEFT)
     $game_system.se_play($data_system.cursor_se)
     $game_troop.enemies.size.times do
       @index += $game_troop.enemies.size - 1
       @index %= $game_troop.enemies.size
       break if self.enemy.exist? && !self.enemy.state?(NOT_TARGETABLE_STATE_ID)
     end
   end
   # Set sprite coordinates
   if self.enemy != nil
     self.x = self.enemy.screen_x
     self.y = self.enemy.screen_y
   end
 end
end

class Game_Troop
 def random_target_enemy(hp0 = false)
   # Initialize roulette
   roulette = []
   # Loop
   @enemies.each do |enemy|
     # If it fits the conditions
     if (!hp0 && enemy.exist?) || (hp0 && enemy.hp0?) && !enemy.state?(NOT_TARGETABLE_STATE_ID)
       # Add an enemy to the roulette
       roulette.push(enemy)
     end
   end
   # If roulette size is 0
   if roulette.size == 0
     return nil
   end
   # Spin the roulette, choose an enemy
   return roulette[rand(roulette.size)]
 end
end

 

If you want the ability to make Actors non-targetable in the same sense, add this script as well:

 

 

class Arrow_Actor < Arrow_Base
 def update
   super
   # Skip if indicating a non-targetable actor
   $game_party.actors.each do |actor|
     break if !actor.state?(NOT_TARGETABLE_STATE_ID)
     @index += 1
     @index %= $game_party.actors.size
   end
   # Cursor right
   if Input.repeat?(Input::RIGHT)
     $game_system.se_play($data_system.cursor_se)
     $game_party.actors.each do |actor|
       @index += 1
       @index %= $game_party.actors.size
       break if !actor.state?(NOT_TARGETABLE_STATE_ID)
     end
   end
   # Cursor left
   if Input.repeat?(Input::LEFT)
     $game_system.se_play($data_system.cursor_se)
     $game_party.actors.each do |actor|
       @index += $game_party.actors.size - 1
       @index %= $game_party.actors.size
       break if !actor.state?(NOT_TARGETABLE_STATE_ID)
     end
   end
   # Set sprite coordinates
   if self.actor != nil
     self.x = self.actor.screen_x
     self.y = self.actor.screen_y
   end
 end
end

class Game_Party
 def random_target_actor(hp0 = false)
   # Initialize roulette
   roulette = []
   # Loop
   @actors.each do |actor|
     if (!hp0 && actor.exist?) || (hp0 && actor.hp0?) && !actor.state?(NOT_TARGETABLE_STATE_ID)
       # Get actor class [position]
       position = $data_classes[actor.class_id].position
       # Front guard: n = 4; Mid guard: n = 3; Rear guard: n = 2
       n = 4 - position
       # Add actor to roulette n times
       n.times do
         roulette.push(actor)
       end
     end
   end
   # If roulette size is 0
   if roulette.size == 0
     return nil
   end
   # Spin the roulette, choose an actor
   return roulette[rand(roulette.size)]
 end
end

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...