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.

two_swords_style

Tdata

Sponsor

I would like to know the simplest way to change the two_swords_style flag.  Nothing fancy, i just want one of my characters to have a the option to be either...
 
You will need this little code.
Code:
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :two_swords_style
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_vx_actor_tss_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    dargor_vx_actor_tss_setup(actor_id)
    @two_swords_style = $data_actors[actor_id].two_swords_style
  end
end

With that, you can change the two_swords_style flag by using
Code:
$game_actors[actor_id].two_swords_style = flag

Take care!
-Dargor
 
Dargor you don't need

Code:
  #--------------------------------------------------------------------------
  # * Get [Dual Wield] Option
  #--------------------------------------------------------------------------
  def two_swords_style
    return @two_swords_style
  end

if two_swords_style is an attr_accessor
 
Your method is the same as mine. If we look at the members method in Game_Party, it looks like:
Code:
#--------------------------------------------------------------------------
# * Get Members
#--------------------------------------------------------------------------
def members
  result = []
  for i in @actors
    result.push($game_actors[i])
  end
  return result
end
Note the result.push($game_actors[ i]). It adds a $game_actors object in the array so $game_party.members[0] = $game_actors[ x].
 

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