Is there a script to make train actors face the same way as the player?
#11
Well, Dog Wulfo already provided you with this:

Code:
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
  #--------------------------------------------------------------------------
  # * Move Left
  # id: party member ID
  #--------------------------------------------------------------------------
  def make_me_move_left(id)
    character = @characters[id]
    character.move_left
  end

  def members_turn_down
    @characters.each{|c| c.turn_down }
  end

  def members_turn_left
    @characters.each{|c| c.turn_left }
  end

  def members_turn_right
    @characters.each{|c| c.turn_right }
  end

  def members_turn_up
    @characters.each{|c| c.turn_up }
  end
end

You'd still need to make the lead character turn left or anywhere else manually. Happy with a sweat

Or use this extended patch instead. Grinning

Code:
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
  #--------------------------------------------------------------------------
  # * Move Left
  # id: party member ID
  #--------------------------------------------------------------------------
  def make_me_move_left(id)
    character = @characters[id]
    character.move_left
  end

  def members_turn_down
    $game_player.turn_down
    @characters.each{|c| c.turn_down }
  end

  def members_turn_left
    $game_player.turn_left
    @characters.each{|c| c.turn_left }
  end

  def members_turn_right
    $game_player.turn_right
    @characters.each{|c| c.turn_right }
  end

  def members_turn_up
    $game_player.turn_up
    @characters.each{|c| c.turn_up }
  end
end

EDIT:

Here's the script call:

$game_party.members_turn_left
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply
#12
For a lark, here is an example script that makes all the following party members face the same direction as the player no matter what direction they are moving.

Code:
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
#  and items. Refer to "$game_party" for the instance of this class.
#==============================================================================

class Game_Party

  #--------------------------------------------------------------------------
  # * Face Down
  #    id: party member ID
  #--------------------------------------------------------------------------
  def face_down(id)
    #
    character = @characters[id]                   # Get the train 'actor' by ID
    character.turn_down                           # Use Game_Character turn cmd
    #
  end

  #--------------------------------------------------------------------------
  # * Face Left
  #    id: party member ID
  #--------------------------------------------------------------------------
  def face_left(id)
    #
    character = @characters[id]                   # Get the train 'actor' by ID
    character.turn_left                           # Use Game_Character turn cmd
    #
  end

  #--------------------------------------------------------------------------
  # * Face Right
  #    id: party member ID
  #--------------------------------------------------------------------------
  def face_right(id)
    #
    character = @characters[id]                   # Get the train 'actor' by ID
    character.turn_right                          # Use Game_Character turn cmd
    #
  end

  #--------------------------------------------------------------------------
  # * Face Up
  #    id: party member ID
  #--------------------------------------------------------------------------
  def face_up(id)
    #
    character = @characters[id]                   # Get the train 'actor' by ID
    character.turn_up                             # Use Game_Character turn cmd
    #
  end  

end



#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias game_char_all_party_faces update
  
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    #
    if self.is_a?(Game_Player)                    # If testing the player
      change_facing(@direction)                   # Change facing on player dir
    end
    game_char_all_party_faces                     # Perform the original call
    #
  end
  
  #--------------------------------------------------------------------------
  # * Change facing direction of party members
  #     facing : player facing direction
  #--------------------------------------------------------------------------
  def change_facing(facing)
    #
    for actor in 0..2                             # Cycle through followers
      case facing                                 # Branch on player direction
      when 2 ; $game_party.face_down(actor)       # Run face down for actor
      when 4 ; $game_party.face_left(actor)       # Run face left for actor
      when 6 ; $game_party.face_right(actor)      # Run face right for actor
      when 8 ; $game_party.face_up(actor)         # Run face up for actor
      end
    end
    #
  end
  
end
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply
#13
Thanks for the help, kyonides and DerVVulfman!

I realized I could use the previous make_me_turn script call and put those in a common event with conditional branches that checked the player's direction.  Happy with a sweat That solved it

There are some instances in the game where you could approach story-related NPCs from various directions, and so I couldn't just use make_me_turn_right or any specific direction because I would not know where the player would approach the NPC from. Only realized today that I could use conditional branches to find out.  Laughing
[Image: SP1-Writer.png]
[Image: SP1-PixelArtist.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
   How do I make skills that never miss, and a status that causes skills to never miss? Ace_V 3 990 02-18-2026, 02:51 PM
Last Post: Ace_V
   Lead Actor Swapper script error Ace_V 25 13,820 09-07-2025, 01:22 PM
Last Post: DerVVulfman
   How do I make a PNG image (or animation) show up when a character dies? Ace_V 6 4,078 08-31-2025, 11:07 PM
Last Post: kyonides
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 3 5,333 11-22-2024, 07:02 PM
Last Post: JayRay
   Actors & enemies without Morale Bennerdeben 4 7,478 07-15-2023, 06:21 PM
Last Post: Bennerdeben
   Script compatibility help Lord Vectra 3 9,549 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 29,731 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   "Wait" in the script Whisper 13 27,772 04-28-2020, 04:06 PM
Last Post: Whisper
   Skill Cooldown script Fenriswolf 11 27,697 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Help iwth script (RGSS Player crash) Whisper 3 12,613 06-17-2017, 05:03 PM
Last Post: Whisper



Users browsing this thread: 4 Guest(s)