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.

Alternative NPC interaction button.

Hi all, I was wondering if someone has ever done a script that allows the player to interact with NPCs with more than a single button, thus obtaining different results.
Think about FFX when you hit the square button (right?) to see blitzball abilities of NPCs.

I think it could be done with tag comments in the first row of the event pages.
Say TAG_A is used to identify page processed when the player uses the alternative button and TAG_B or no tag would identify "normal" pages...
 
That, and using the basics of a ring menu with options that match the pages...

Sort of an old LucasArts Ring menu (Hand-action- / Baloon-talk- / Sword-fight- / Eye-examine- / Hand2-steal- )

Something like that, right?
 
Do you mean that the player presses some button and a menu pops up with the "interaction options", or are you just talking about technical similarities with a ring menu from the scripts point of view?
However that could also be a way, but what I had in mind was keyboard shortcuts for every type of actions, so that they could be mapped on the gamepad buttons.
 
I thought about this simple solution:

Code:
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  attr_accessor :interaction_button
  
  alias alt_interaction_update update
  def update
    @interaction_button=0
    # original call
    alt_interaction_update
    # If A button was pressed
    if Input.trigger?(Input::A)
      @interaction_button=1
      # Same position and front event determinant
      check_event_trigger_here([0])
      check_event_trigger_there([0,1,2])
    end
  end
end

The commands for an event can be divided based on the pressed button with the conditional branch using the condition Script: $game_player.interaction_button==0.
 
That is quite interesting, but i didn't look for such a complex system. Besides, the author seems to not care about compatibility, since many methods are directly edited instead of aliased.
Anyway, thank you.
 

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