النتائج 1 إلى 2 من 2

الموضوع: [ درس + مثال + سكربت ] جعل الشخصيات تجري ورائك فيRMVX ..

  1. #1
    التسجيل
    09-09-2005
    الدولة
    العراق - بغداد / سوريا - دمشق
    المشاركات
    1,668

    Post [ درس + مثال + سكربت ] جعل الشخصيات تجري ورائك فيRMVX ..

    السلام عليكم و رحمة الله و بركاته

    حبيت أن أقدم مشاركة بعد أنقطاعي أو عدم و جود مواضيع لي أصلاً في المنتدى .. الدرس هذا سوف يطبق على برنامج RPG Maker VX .. وهو يحتوي على درس مصور و كذلك سكربت و مثال للسكربت .. أرجو الأستمتاع ..

    - - - - - - -

    أولاً هذ االسكربت و هو الشيء المهم في الدرس :


    كود PHP:
      # MAX_SIZE is the max size of the followers. 
    كود PHP:
    [center]  # CATERPILLAR is the switch to turn on or off followers. The default is 2
      #--------------------------------------------------------------------------
      # * Constants
      #--------------------------------------------------------------------------
      
    MAX_SIZE 8
      CATERPILLAR 
    2
    class Game_Player
      
    #--------------------------------------------------------------------------
      # * Move Down
      #     turn_enabled : a flag permits direction change on that spot
      #--------------------------------------------------------------------------
      
    def move_down(turn_enabled true)    
        
    super(turn_enabled)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Left
      #     turn_enabled : a flag permits direction change on that spot
      #--------------------------------------------------------------------------
      
    def move_left(turn_enabled true)
        
    super(turn_enabled)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Right
      #     turn_enabled : a flag permits direction change on that spot
      #--------------------------------------------------------------------------
      
    def move_right(turn_enabled true)
        
    super(turn_enabled)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move up
      #     turn_enabled : a flag permits direction change on that spot
      #--------------------------------------------------------------------------
      
    def move_up(turn_enabled true)
        
    super(turn_enabled)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Lower Left
      #--------------------------------------------------------------------------
      
    def move_lower_left
        super
      end
      
    #--------------------------------------------------------------------------
      # * Move Lower Right
      #--------------------------------------------------------------------------
      
    def move_lower_right
        super
      end
      
    #--------------------------------------------------------------------------
      # * Move Upper Left
      #--------------------------------------------------------------------------
      
    def move_upper_left
        super
      end
      
    #--------------------------------------------------------------------------
      # * Move Upper Right
      #--------------------------------------------------------------------------
      
    def move_upper_right
        super
      end
    end
    class Game_Follower Game_Character
      
    #--------------------------------------------------------------------------
      # * Public Instance Variables
      #--------------------------------------------------------------------------
      
    attr_reader   :actor
      attr_accessor 
    :move_speed
      
    #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      
    def initialize(actor)
        
    super()
        @
    through true
        
    @actor actor
      end
      
    #--------------------------------------------------------------------------
      # * Set Actor
      #--------------------------------------------------------------------------
      
    def actor=(actor)
        @
    actor actor
        setup
      end
      
    #--------------------------------------------------------------------------
      # * Setup
      #--------------------------------------------------------------------------
      
    def setup
        
    if @actor != nil      
          
    @character_name $game_actors[@actor].character_name
          
    @character_index $game_actors[@actor].character_index
        
    else
          @
    character_name ""
          
    @character_index 0
        end
        
    @opacity 255
        
    @blend_type 0
        
    @priority_type 0
      end
      
      
    #--------------------------------------------------------------------------
      # * Screen Z
      #--------------------------------------------------------------------------
      
    def screen_z
        
    if $game_player.== @and $game_player.== @y
          
    return $game_player.screen_z 1
        end
        super
      end
      
    #--------------------------------------------------------------------------
      # * Same Position Starting Determinant (Disabled)
      #--------------------------------------------------------------------------
      
    def check_event_trigger_here(triggers)
        
    result false
        
    return result
      end
      
    #--------------------------------------------------------------------------
      # * Front Envent Starting Determinant (Disabled)
      #--------------------------------------------------------------------------
      
    def check_event_trigger_there(triggers)
        
    result false
        
    return result
      end
      
    #--------------------------------------------------------------------------
      # * Touch Event Starting Determinant (Disabled)
      #--------------------------------------------------------------------------
      
    def check_event_trigger_touch(xy)
        
    result false
        
    return result
      end
    end
    class Spriteset_Map
      alias_method 
    :spriteset_map_create_characters, :create_characters
      def create_characters
        spriteset_map_create_characters
        $game_party
    .followers.each do |char|
          @
    character_sprites << Sprite_Character.new(@viewport1char)
        
    end
      end
    end
    class Game_Party
      
    #--------------------------------------------------------------------------
      # * Public Instance Variables
      #--------------------------------------------------------------------------
      
    attr_reader :followers
      
    #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_party_initialize, :initialize
      def initialize
        trick_caterpillar_party_initialize
        
    @followers = Array.new(MAX_SIZE 1) {Game_Follower.new(nil)}
        @
    move_list = []
      
    end
      
    #--------------------------------------------------------------------------
      # * Update Followers
      #--------------------------------------------------------------------------
      
    def update_followers
        flag 
    $game_player.transparent || $game_switches[CATERPILLAR]
        @
    followers.each_with_index do |chari|
          
    char.actor = @actors[1]
          
    char.move_speed $game_player.move_speed
          
    if $game_player.dash?
            
    char.move_speed += 1
          end
          char
    .update
          char
    .transparent flag
        end
      end
      
    #--------------------------------------------------------------------------
      # * Move To Party 
      #--------------------------------------------------------------------------
      
    def moveto_party(xy)
        @
    followers.each {|charchar.moveto(xy)}
        @
    move_list.clear
      end
      
    #--------------------------------------------------------------------------
      # * Move Party 
      #--------------------------------------------------------------------------
      
    def move_party
        
    @move_list.each_index do |i|
          if @
    followers[i] == nil
            
    @move_list[i...@move_list.size] = nil
            next
          end
          
    case @move_list[i].type
          when 2
            
    @followers[i].move_down(*@move_list[i].args)
          
    when 4
            
    @followers[i].move_left(*@move_list[i].args)
          
    when 6
            
    @followers[i].move_right(*@move_list[i].args)
          
    when 8
            
    @followers[i].move_up(*@move_list[i].args)
          
    when j
            
    @followers[i].move_lower_left
          when 3
            
    @followers[i].move_lower_right
          when 7
            
    @followers[i].move_upper_left
          when 9
            
    @followers[i].move_upper_right
          when 5
            
    @followers[i].jump(*@move_list[i].args)
          
    end
        end
      end
      
    #--------------------------------------------------------------------------
      # * Add Move List
      #--------------------------------------------------------------------------
      
    def update_move(type, *args)
        
    move_party
        
    @move_list.unshift(Game_MoveListElement.new(typeargs))
      
    end
    end
    class Game_MoveListElement
      
    #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      
    def initialize(typeargs)
        @
    type type
        
    @args args
      end
      
    #--------------------------------------------------------------------------
      # * Type
      #--------------------------------------------------------------------------
      
    def type
        
    return @type 
      end
      
    #--------------------------------------------------------------------------
      # * Args
      #--------------------------------------------------------------------------
      
    def args
        
    return @args
      end
    end
    class Game_Player
      
    #--------------------------------------------------------------------------
      # * Public Instance Variables
      #--------------------------------------------------------------------------
      
    attr_reader :move_speed
      
      
    #--------------------------------------------------------------------------
      # * Update
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_update, :update
      def update
        $game_party
    .update_followers
        trick_caterpillar_player_update
      end
      
    #--------------------------------------------------------------------------
      # * Moveto
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_moveto, :moveto
      def moveto
    (xy)
        
    $game_party.moveto_party(xy)
        
    trick_caterpillar_player_moveto(xy)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Down
      #-------------------------------------------------------------------------- 
      
    alias_method :trick_caterpillar_player_move_down, :move_down
      def move_down
    (turn_enabled true)
        if 
    passable?(@x, @y+1)
          
    $game_party.update_move(2turn_enabled)
        
    end    
        trick_caterpillar_player_move_down
    (turn_enabled)    
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Left
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_move_left, :move_left
      def move_left
    (turn_enabled true)
        if 
    passable?(@x-1, @y)
          
    $game_party.update_move(4turn_enabled)
        
    end
        trick_caterpillar_player_move_left
    (turn_enabled)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Right
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_move_right, :move_right
      def move_right
    (turn_enabled true)
        if 
    passable?(@x+1, @y)
          
    $game_party.update_move(6turn_enabled)
        
    end
        trick_caterpillar_player_move_right
    (turn_enabled)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Up
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_move_up, :move_up
      def move_up
    (turn_enabled true)
        if 
    passable?(@x, @y-1)
          
    $game_party.update_move(8turn_enabled)
        
    end
        trick_caterpillar_player_move_up
    (turn_enabled)
      
    end
      
    #--------------------------------------------------------------------------
      # * Move Lower Left
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_move_lower_left, :move_lower_left
      def move_lower_left
        
    if passable?(@1, @y) and passable?(@x, @1)
          
    $game_party.update_move(1)
        
    end
        trick_caterpillar_player_move_lower_left
      end
      
    #--------------------------------------------------------------------------
      # * Move Lower Right
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_move_lower_right, :move_lower_right
      def move_lower_right
        
    if passable?(@1, @y) and passable?(@x, @1)
          
    $game_party.update_move(3)
        
    end
        trick_caterpillar_player_move_lower_right
      end
      
    #--------------------------------------------------------------------------
      # * Move Upper Left
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_move_upper_left, :move_upper_left
      def move_upper_left
        
    if passable?(@1, @y) and passable?(@x, @1)
          
    $game_party.update_move(7)
        
    end
        trick_caterpillar_player_move_upper_left
      end
      
    #--------------------------------------------------------------------------
      # * Move Upper Right
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_move_upper_right, :move_upper_right
      def move_upper_right
        
    if passable?(@1, @y) and passable?(@x, @1)
          
    $game_party.update_move(9)
        
    end
        trick_caterpillar_player_move_upper_right
      end
      
    #--------------------------------------------------------------------------
      # * Jump
      #--------------------------------------------------------------------------
      
    alias_method :trick_caterpillar_player_jump, :jump
      def jump
    (x_plusy_plus)
        
    new_x = @x_plus
        new_y 
    = @y_plus
        
    if (x_plus == and y_plus == 0) or passable?(new_xnew_y)
          
    $game_party.update_move(5x_plusy_plus)
        
    end
        trick_caterpillar_player_jump
    (x_plusy_plus)
      
    end
    end
    [/center

    و الان الى الشرح :

    أولاً أفتح البرنامج ..


    و بعدها قم بأختيار نشىء أو فتح مشروع ..


    و بعدها أختار محرر السكربت من شريط المهام الخاص بالبرنامج ..


    قم بالنزول حتى الوصول الى سكربت الرئيسي الـ Main سوف تجد مكان فراغ فوقه أضغط عليه ..


    قم بتسميته أي أسم شئت ولكن الأهم أنه يكون فوق السكربت Main ..وقم بعدها بلصق السكربت الذي وضعته في الأعلى في المكان الابيض المجاور لأسم السكربت ..

    تفضلو هذا مثال لدرسنا هذا اليوم فيه السكربت و أشياء أخرى :


    أنتظرو دروسي الأخرى ..

  2. #2
    التسجيل
    08-08-2003
    الدولة
    &Oslash;...In My Painest Dreams...&Oslash;
    المشاركات
    344

    رد: [ درس + مثال + سكربت ] جعل الشخصيات تجري ورائك فيRMVX ..

    مشكووووور^^




    ..كنوز لم يتم اكتاشفها من قبل الكثيرين...
    اذكار...{الا بذكر الله تطمئن القلوب}..اذكر الله يذكرك

    قل سبحان الله وبحمده 100 مره تغفر ذنوبك وان كانت مثل زبد البحر
    لا تستصعبها هيا رددها

ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •