[XP] RMX-OS Following

Started by Wizered67, March 12, 2011, 12:19:39 pm

Previous topic - Next topic

Wizered67

RMX-OS Following
Authors: Wizered67
Version: 0.90
Type: RMX-OS Party Addon
Key Term: RMX-OS Plugin



Introduction

This script adds a new command allowing player's to follow each other. It can be very helpful in parties, but you do not have to be in the same party as the other person. I got this idea while trying to get my friend to follow me while testing some stuff in my game.


Features


  • Plugin for following.

  • Makes it easier to follow.

  • No Server Extension.

  • Easy to use.




Screenshots

None


Demo

None


Script

Spoiler: ShowHide

#------------------------------------------------------------------------------
#                  RMX-OS Following
#                     by Wizered67
#                          V 0.90
# All errors should be reported at www.chaos-project.com.
#------------------------------------------------------------------------------
class Game_Player
attr_accessor :following
alias init_add_follow initialize
def initialize
  @following = nil
  init_add_follow
end

alias update_following_check_add update
def update
   unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
   if @following != nil
     update_following
     end
  end
update_following_check_add
  end

  def update_following
if @old_following_x != @following.x || @old_following_y != @following.y
$game_player.path_target_x = @following.x
$game_player.path_target_y = @following.y
@old_following_x = @following.x
@old_following_y = @following.y
end
end
end

module RMXOS
  module Documentation
  PARAMETERS['follow']    = 'PLAYER' 
  DESCRIPTIONS['follow']    = 'Lets you follow another player. You can stop with /stopfollow'
  PARAMETERS['stopfollow']    = 'none' 
  DESCRIPTIONS['stopfollow']    = 'Stops you from following a player anymore.'
end
class Network
   alias check_normal_commands_follow_add check_normal_commands
  def check_normal_commands(message)
    case message
    when /\A\/follow (\S+)/
     command_follow($1)
      return true
    when /\A\/stopfollow\Z/
     command_stop_follow
      return true
    end
    return check_normal_commands_follow_add(message)
  end
 
  def command_follow(player)
  @players.any? {|key, value|
  $game_player.following = value if value.username == player }
end

  def command_stop_follow
    $game_player.following = nil
   add_message(nil,'You stop following.', RMXOS::Data::ColorOK)
    end
end
end


This requires Blizz-ABS also, and you must place it below Blizz-ABS.


Instructions

Just add below Blizz-ABS.


Compatibility

Requires Blizz-ABS and RMX-OS. For the third time, make sure it goes below Blizz-ABS.


Credits and Thanks


  • Wizered67

  • Winkio for adding the pathfinder to Blizz-ABS.

  • Blizzard for Blizz-ABS.

  • Nathmatt because I borrowed a little from his player drop down window.




Author's Notes

For best results, you may want to consider adding this to nathmatt's drop down window. This script is not 100% finished yet. If there are any errors, please report them. I appreciate any feedback you have to give.