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.

Help with Advanced Targeting

I'm trying to change the keys that have to be pressed to change between single/all and enemy/ally.

I already did the single/all part:
Code:
update_l if @scope.single_all?

#...

  #--------------------------------------------------------------------------
  # * Update L Button
  #--------------------------------------------------------------------------
  def update_l
    # Return if Key is not triggered
    return if not Input.repeat?(Input::L)
    # Save Type
    old_type = @type
    # If Single All
    if @scope.single_all?
      # Set to New Type
      case @type
      when 'all_actors'
        @type = 'actor'
      when 'actor'
        @type = 'all_actors'
      when 'enemy'
        @type = 'all_enemies'
      when 'all_enemies'
        @type = 'enemy'
      end
    end
    # Return if not type Changed
    return if old_type == @type
    # Play se
    $game_system.se_play($data_system.cursor_se)
    # Setup index
    setup_index
    # Set Visible Arrows
    set_visibility
  end
I need help to change the enemy/ally part like this (hope I can explain):
- I want to switch between enemies and allies pressing LEFT or RIGHT (left for allies and right for enemies) but only when the cursor is at the first actor and at the last enemy. I know I have to mess with actors and allies index but I don't have any idea how to change it to work like that.

This is the script I'm trying to modify:
http://www.rmxp.org/forums/showthread.php?t=8633

Can anyone know what to modify to make it work? Thanks in advance.
 

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