Страница 8 из 147 ПерваяПервая ... 6789101858108 ... ПоследняяПоследняя
Показано с 71 по 80 из 1470

Тема: Помощь с скриптами (RGSS)

  1. #71
    Бывалый Аватар для Inkognitoo
    Информация о пользователе
    Регистрация
    30.09.2008
    Адрес
    Пермь.
    Сообщений
    988
    Записей в дневнике
    4
    Репутация: 16 Добавить или отнять репутацию

    По умолчанию

    Теперь еще один вопрос, по этому же скрипту, как сделать так что бы чар отражался только в зеркале, а не на всей стене)

  2. #72
    Бывалый Аватар для Dark32
    Информация о пользователе
    Регистрация
    30.12.2008
    Адрес
    Арзамас
    Сообщений
    640
    Записей в дневнике
    2
    Репутация: 20 Добавить или отнять репутацию

    По умолчанию

    поробуй графику эвенту поставить ввиде зеркала или чего там.
    Нужна помощь в скриптах? Запутался? Голова не варит?
    Читал это и это тоже? Не помогло? Тогда тебе сюда!
    Спойлер •••:
    Цитата Сообщение от Реймон
    В мире нет вещей которые нельзя решить с помощью сладостей
    Цитата Сообщение от Ундер
    Ночью можно обойтись и без сладостей...

  3. #73
    Бывалый Аватар для Inkognitoo
    Информация о пользователе
    Регистрация
    30.09.2008
    Адрес
    Пермь.
    Сообщений
    988
    Записей в дневнике
    4
    Репутация: 16 Добавить или отнять репутацию

    По умолчанию

    Нет, что то другое(

  4. #74
    Создатель Аватар для Рольф
    Информация о пользователе
    Регистрация
    14.04.2008
    Адрес
    Южно- Сахалинск/Пенза
    Сообщений
    10,283
    Записей в дневнике
    2
    Репутация: 108 Добавить или отнять репутацию

    По умолчанию

    Я просто занет, а на словах я помог. Тож то сумел вспомнить. Будет время по смотрю.

  5. #75
    Новичок Аватар для SlashBeast
    Информация о пользователе
    Регистрация
    16.06.2009
    Адрес
    Москва
    Сообщений
    25
    Репутация: 0 Добавить или отнять репутацию

    По умолчанию

    Какая часть скрипта отвечает за стрелочку 16х16 внизу мессаги?
    Мне бы ее подвинуть вправо. (Мейкер XP)

  6. #76

    По умолчанию

    SlashBeast
    Хех, это тебе править Window надо! poccil его переписывал. К сожалению, чистого под рукой нет (нет времени искать), а вот немного подпорченный:
    Спойлер Window:
    Код:
    #===============================================================================
    # Custom Window v1.2
    # Автор оригинала: poccil
    # Над скриптом измывались: Equilibrium Keeper [ICQ: 470355387]
    #===============================================================================
    class Window
      #-----------------------------------------------------------------------------
      attr_reader :tone
      attr_reader :color
      attr_reader :blend_type
      attr_reader :contents_blend_type
      attr_reader :viewport
      attr_reader :contents
      attr_reader :space_x
      attr_reader :space_y
      attr_reader :ox
      attr_reader :oy
      attr_reader :x
      attr_reader :y
      attr_reader :z
      attr_reader :width
      attr_reader :active
      attr_reader :pause
      attr_reader :height
      attr_reader :opacity
      attr_reader :back_opacity
      attr_reader :contents_opacity
      attr_reader :visible
      attr_reader :cursor_rect
      attr_reader :openness
      attr_reader :stretch
      #-----------------------------------------------------------------------------
      def windowskin
        @_windowskin
      end
      #-----------------------------------------------------------------------------
      def initialize(viewport = nil, space_x = 16, space_y = 16)
        @sprites = {}
        @spritekeys = [
          "back",
          "corner0","side0","scroll0",
          "corner1","side1","scroll1",
          "corner2","side2","scroll2",
          "corner3","side3","scroll3",
          "cursor","contents","pause"
        ]
        @sidebitmaps = [nil, nil, nil, nil]
        @cursorbitmap = nil
        @bgbitmap = nil
        @viewport = viewport
        for i in @spritekeys
          @sprites[i] = Sprite.new(@viewport)
        end
        @disposed = false
        @tone = Tone.new(0, 0, 0)
        @color = Color.new(0, 0, 0, 0)
        @blankcontents = Bitmap.new(1, 1) # RGSS2 requires this
        @contents = @blankcontents
        @_windowskin = nil
        @rpgvx = false # Set to true to emulate RPGVX windows
        @x = 0
        @y = 0
        @width = 0
        @openness = 255
        @height = 0
        @space_x = space_x
        @space_y = space_y
        @ox = 0
        @oy = 0
        @z = 0
        @stretch = true
        @visible = true
        @active = true
        @blend_type = 0
        @contents_blend_type = 0
        @opacity = 255
        @back_opacity = 255
        @contents_opacity = 255
        @cursor_rect = WindowCursorRect.new(self)
        @cursorblink = 0
        @cursoropacity = 255
        @pause = false
        @pauseopacity = 255
        @pauseframe = 0
        privRefresh(true)
      end
      #-----------------------------------------------------------------------------
      def dispose
        unless self.disposed?
          for i in @sprites
            i[1].dispose if i[1]
            @sprites[i[0]] = nil
          end
          for i in 0...@sidebitmaps.length
            @sidebitmaps[i].dispose if @sidebitmaps[i]
            @sidebitmaps[i] = nil
          end
          @blankcontents.dispose
          @cursorbitmap.dispose if @cursorbitmap
          @backbitmap.dispose if @backbitmap
          @sprites.clear
          @sidebitmaps.clear
          @_windowskin = nil
          @_contents = nil
          @disposed = true
        end
      end
      #-----------------------------------------------------------------------------
      def openness=(value)
        @openness = value
        @openness = 0 if @openness < 0
        @openness = 255 if @openness > 255
        privRefresh
      end
      #-----------------------------------------------------------------------------
      def stretch=(value)
        @stretch = value
        privRefresh(true)
      end
      #-----------------------------------------------------------------------------
      def visible=(value)
        @visible = value
        privRefresh
      end
      #-----------------------------------------------------------------------------
      def viewport=(value)
        @viewport = value
        for i in @spritekeys
          @sprites[i].dispose
          if @sprites[i].is_a?(Sprite)
            @sprites[i] = Sprite.new(@viewport)
          elsif @sprites[i].is_a?(Plane)
            @sprites[i] = Plane.new(@viewport)
          else
            @sprites[i] = nil
          end
        end
        privRefresh(true)
      end
      #-----------------------------------------------------------------------------
      def z=(value)
        @z = value
        privRefresh
      end
      #-----------------------------------------------------------------------------
      def disposed?
        return @disposed
      end
      #-----------------------------------------------------------------------------
      def contents=(value)
        @contents = value
        privRefresh
      end
      #-----------------------------------------------------------------------------
      def windowskin=(value)
        @_windowskin = value
        if value && value.is_a?(Bitmap) && !value.disposed? && value.width == 128
          @rpgvx = true
        else
          @rpgvx = false
        end
        privRefresh(true)
      end
      #-----------------------------------------------------------------------------
      def ox=(value)
        @ox = value
        privRefresh
      end
      #-----------------------------------------------------------------------------
      def active=(value)
        @active = value
        privRefresh(true)
      end
      #-----------------------------------------------------------------------------
      def cursor_rect=(value)
        if !value
          @cursor_rect.empty
        else
          @cursor_rect.set(value.x, value.y, value.width, value.height)
        end
      end
      #-----------------------------------------------------------------------------
      def oy=(value)
        @oy = value
        privRefresh
      end
      #-----------------------------------------------------------------------------
      def width=(value)
        @width = value
        privRefresh(true)
      end
      #-----------------------------------------------------------------------------
      def height=(value)
        @height=value
        privRefresh(true)
      end
      #-----------------------------------------------------------------------------
      def pause=(value)
        @pause=value
        @pauseopacity=0 if !value
        privRefresh
      end
      #-----------------------------------------------------------------------------
      def x=(value)
      @x=value
      privRefresh
     end
     def y=(value)
      @y=value
      privRefresh
     end
     def opacity=(value)
      @opacity=value
      @opacity=0 if @opacity<0
      @opacity=255 if @opacity>255
      privRefresh
     end
     def back_opacity=(value)
      @back_opacity=value
      @back_opacity=0 if @back_opacity<0
      @back_opacity=255 if @back_opacity>255
      privRefresh
     end
     def contents_opacity=(value)
      @contents_opacity=value
      @contents_opacity=0 if @contents_opacity<0
      @contents_opacity=255 if @contents_opacity>255
      privRefresh
     end
     def tone=(value)
      @tone=value
      privRefresh
     end
     def color=(value)
      @color=value
      privRefresh
     end
     def blend_type=(value)
      @blend_type=value
      privRefresh
     end
     def flash(color,duration)
      return if disposed?
      for i in @sprites
       i[1].flash(color,duration)
      end
     end
     def update
      return if disposed?
      mustchange=false
      if @active
       if @cursorblink==0
        @cursoropacity-=8
        @cursorblink=1 if @cursoropacity<=128
       else
        @cursoropacity+=8
        @cursorblink=0 if @cursoropacity>=255
       end
       mustchange=true if !@cursor_rect.isEmpty?
      else
       mustchange=true if @cursoropacity!=128
       @cursoropacity=128
      end
      if @pause
       @pauseframe=(Graphics.frame_count / 8) % 4
       @pauseopacity=[@pauseopacity+64,255].min
       mustchange=true
      end
      privRefresh if mustchange
      for i in @sprites
       i[1].update
      end
     end
     private
     def ensureBitmap(bitmap,dwidth,dheight)
      if !bitmap||bitmap.disposed?||bitmap.width<dwidth||bitmap.height<dheight
       bitmap.dispose if bitmap
       bitmap=Bitmap.new([1,dwidth].max,[1,dheight].max)
      end
      return bitmap
     end
     def tileBitmap(dstbitmap,dstrect,srcbitmap,srcrect)
      return if !srcbitmap || srcbitmap.disposed?
      left=dstrect.x
      top=dstrect.y
      y=0;loop do break unless y<dstrect.height
       x=0;loop do break unless x<dstrect.width
        dstbitmap.blt(x+left,y+top,srcbitmap,srcrect)
        x+=srcrect.width
       end
       y+=srcrect.height
      end
     end
     def privRefresh(changeBitmap=false)
      return if self.disposed?
      backopac=self.back_opacity*self.opacity/255
      contopac=self.contents_opacity
      cursoropac=@cursoropacity*contopac/255
      for i in 0...4
       @sprites["corner#{i}"].bitmap=@_windowskin
       @sprites["scroll#{i}"].bitmap=@_windowskin
      end
      @sprites["pause"].bitmap=@_windowskin
      @sprites["contents"].bitmap=@contents
      if @_windowskin && !@_windowskin.disposed?
       for i in 0...4
        @sprites["corner#{i}"].opacity=@opacity
        @sprites["corner#{i}"].tone=@tone
        @sprites["corner#{i}"].color=@color
        @sprites["corner#{i}"].blend_type=@blend_type
        @sprites["corner#{i}"].visible=@visible
        @sprites["side#{i}"].opacity=@opacity
        @sprites["side#{i}"].tone=@tone
        @sprites["side#{i}"].color=@color
        @sprites["side#{i}"].blend_type=@blend_type
        @sprites["side#{i}"].visible=@visible
        @sprites["scroll#{i}"].opacity=@opacity
        @sprites["scroll#{i}"].tone=@tone
        @sprites["scroll#{i}"].blend_type=@blend_type
        @sprites["scroll#{i}"].color=@color
        @sprites["scroll#{i}"].visible=@visible
       end
       for i in ["back","cursor","pause","contents"]
        @sprites[i].color=@color
        @sprites[i].tone=@tone
        @sprites[i].blend_type=@blend_type
       end
       @sprites["contents"].blend_type=@contents_blend_type
       @sprites["back"].opacity=backopac
       @sprites["contents"].opacity=contopac
       @sprites["cursor"].opacity=cursoropac
       @sprites["pause"].opacity=@pauseopacity
       @sprites["back"].visible=@visible
       @sprites["contents"].visible=@visible && @openness==255
       @sprites["pause"].visible=@visible && @pause
       @sprites["cursor"].visible=@visible && @openness==255
       hascontents=(@contents && !@contents.disposed?)
       @sprites["scroll0"].visible = @visible && hascontents && @oy > 0
       @sprites["scroll1"].visible = @visible && hascontents && @ox > 0
       @sprites["scroll2"].visible = @visible && hascontents && (@contents.width - @ox) > @width - @space_x * 2
       @sprites["scroll3"].visible = @visible && hascontents && (@contents.height - @oy) > @height - @space_y * 2
      else
       for i in 0...4
        @sprites["corner#{i}"].visible=false
        @sprites["side#{i}"].visible=false
        @sprites["scroll#{i}"].visible=false
       end
       @sprites["contents"].visible=@visible && @openness==255
       @sprites["contents"].color=@color
       @sprites["contents"].tone=@tone
       @sprites["contents"].blend_type=@contents_blend_type
       @sprites["contents"].opacity=contopac
       @sprites["back"].visible=false
       @sprites["pause"].visible=false
       @sprites["cursor"].visible=false
      end
      for i in @sprites
       i[1].z=@z 
      end
      if @rpgvx
        @sprites["cursor"].z=@z#+1 # For Compatibility
        @sprites["contents"].z=@z#+2 # For Compatibility
        @sprites["pause"].z=@z#+2 # For Compatibility
      else
        @sprites["cursor"].z=@z+1 # For Compatibility
        @sprites["contents"].z=@z+2 # For Compatibility
        @sprites["pause"].z=@z+2 # For Compatibility
      end
      if @rpgvx
       trimX=64
       trimY=0
       backRect=Rect.new(0,0,64,64)
       blindsRect=Rect.new(0,64,64,64)
      else
       trimX=128
       trimY=0
       backRect=Rect.new(0,0,128,128)
       blindsRect=nil
      end
      @sprites["corner0"].src_rect.set(trimX, trimY + 0, 16, 16);
      @sprites["corner1"].src_rect.set(trimX + 48, trimY + 0, 16, 16);
      @sprites["corner2"].src_rect.set(trimX, trimY + 48, 16, 16);
      @sprites["corner3"].src_rect.set(trimX + 48, trimY + 48, 16, 16);
      @sprites["scroll0"].src_rect.set(trimX + 24, trimY + 16, 16, 8) # up
      @sprites["scroll3"].src_rect.set(trimX + 24, trimY + 40, 16, 8) # down
      @sprites["scroll1"].src_rect.set(trimX + 16, trimY + 24, 8, 16) # left
      @sprites["scroll2"].src_rect.set(trimX + 40, trimY + 24, 8, 16) # right
      cursorX=trimX
      cursorY=trimY+64
      sideRects=[
       Rect.new(trimX + 16,trimY + 0, 32, 16),
       Rect.new(trimX, trimY + 16, 16, 32),
       Rect.new(trimX + 48, trimY + 16, 16, 32),
       Rect.new(trimX + 16, trimY + 48, 32, 16)
      ]
      if @width > space_x * 2 && @height > space_y * 2
       @sprites["contents"].src_rect.set(@ox, @oy, @width - space_x * 2, @height - space_y * 2)
      else
       @sprites["contents"].src_rect.set(0, 0, 0, 0)
      end
      pauseRects=[
       trimX + 32,trimY + 64,
       trimX + 48,trimY + 64,
       trimX + 32,trimY + 80,
       trimX + 48,trimY + 80,
      ]
      pauseWidth = 16
      pauseHeight = 16
      @sprites["pause"].src_rect.set(
        pauseRects[@pauseframe*2],
        pauseRects[@pauseframe*2+1],
        pauseWidth,pauseHeight
      )
      @sprites["pause"].x = @x + (@width / 2) - (pauseWidth / 2)
      @sprites["pause"].y = @y + @height - 16 # 16 refers to skin margin
      @sprites["contents"].x = @x + @space_x
      @sprites["contents"].y = @y + @space_y
      @sprites["corner0"].x=@x
      @sprites["corner0"].y=@y
      @sprites["corner1"].x=@x+@width-16
      @sprites["corner1"].y=@y
      @sprites["corner2"].x=@x
      @sprites["corner2"].y=@y+@height-16
      @sprites["corner3"].x=@x+@width-16
      @sprites["corner3"].y=@y+@height-16
      @sprites["side0"].x=@x+16
      @sprites["side0"].y=@y
      @sprites["side1"].x=@x
      @sprites["side1"].y=@y+16
      @sprites["side2"].x=@x+@width-16
      @sprites["side2"].y=@y+16
      @sprites["side3"].x=@x+16
      @sprites["side3"].y=@y+@height-16
      @sprites["scroll0"].x = @x+@width / 2 - 8
      @sprites["scroll0"].y = @y+8
      @sprites["scroll1"].x = @x+8
      @sprites["scroll1"].y = @y+@height / 2 - 8
      @sprites["scroll2"].x = @x+@width - 16
      @sprites["scroll2"].y = @y+@height / 2 - 8
      @sprites["scroll3"].x = @x+@width / 2 - 8
      @sprites["scroll3"].y = @y+@height - 16
      @sprites["back"].x=@x+2
      @sprites["back"].y=@y+2
      @sprites["cursor"].x=@x+16+@cursor_rect.x
      @sprites["cursor"].y=@y+16+@cursor_rect.y
      if changeBitmap && @_windowskin && !@_windowskin.disposed?
       width=@cursor_rect.width
       height=@cursor_rect.height
       if width > 0 && height > 0
          cursorrects=[
           # sides
           Rect.new(cursorX+2, cursorY+0, 28, 2),
           Rect.new(cursorX+0, cursorY+2, 2, 28),
           Rect.new(cursorX+30, cursorY+2, 2, 28),
           Rect.new(cursorX+2, cursorY+30, 28, 2),
           # corners
           Rect.new(cursorX+0, cursorY+0, 2, 2),
           Rect.new(cursorX+30, cursorY+0, 2, 2),
           Rect.new(cursorX+0, cursorY+30, 2, 2),
           Rect.new(cursorX+30, cursorY+30, 2, 2),
           # back
           Rect.new(cursorX+2, cursorY+2, 28, 28)
          ]
          margin=2
          fullmargin=4
          @cursorbitmap = ensureBitmap(@cursorbitmap, width, height)
          @cursorbitmap.clear
          @sprites["cursor"].bitmap=@cursorbitmap
          @sprites["cursor"].src_rect.set(0,0,width,height)
          rect = Rect.new(margin,margin, 
                           width - fullmargin, height - fullmargin)
          @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[8])
          @cursorbitmap.blt(0, 0, @_windowskin, cursorrects[4])# top left
          @cursorbitmap.blt(width-margin, 0, @_windowskin, cursorrects[5]) # top right
          @cursorbitmap.blt(0, height-margin, @_windowskin, cursorrects[6]) # bottom right
          @cursorbitmap.blt(width-margin, height-margin, @_windowskin, cursorrects[7]) # bottom left
          rect = Rect.new(margin, 0, 
                           width - fullmargin, margin)
          @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[0])
          rect = Rect.new(0, margin, 
                          margin, height - fullmargin)
          @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[1])
          rect = Rect.new(width - margin, margin, 
                          margin, height - fullmargin)
          @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[2])
          rect = Rect.new(margin, height-margin, 
                          width - fullmargin, margin)
          @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[3])
       else
          @sprites["cursor"].visible=false
          @sprites["cursor"].src_rect.set(0,0,0,0)
       end
       for i in 0..3
        dwidth=(i==0||i==3) ? @width-32 : 16
        dheight=(i==0||i==3) ? 16 : @height-32
        @sidebitmaps[i]=ensureBitmap(@sidebitmaps[i],dwidth,dheight)
        @sprites["side#{i}"].bitmap=@sidebitmaps[i]
        @sprites["side#{i}"].src_rect.set(0,0,dwidth,dheight)
        @sidebitmaps[i].clear
        if sideRects[i].width>0 && sideRects[i].height>0
         @sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect,
          @_windowskin,sideRects[i])
        end
       end
       backwidth=@width-4
       backheight=@height-4
       if backwidth>0 && backheight>0
        @backbitmap=ensureBitmap(@backbitmap,backwidth,backheight)
        @sprites["back"].bitmap=@backbitmap
        @sprites["back"].src_rect.set(0,0,backwidth,backheight)
        @backbitmap.clear
        if @stretch
         @backbitmap.stretch_blt(@sprites["back"].src_rect,@_windowskin,backRect)
        else
         tileBitmap(@backbitmap,@sprites["back"].src_rect,@_windowskin,backRect)
        end
        if blindsRect
         tileBitmap(@backbitmap,@sprites["back"].src_rect,@_windowskin,blindsRect)
        end
       else
        @sprites["back"].visible=false
        @sprites["back"].src_rect.set(0,0,0,0)
       end
      end
      if @openness!=255
       opn=@openness/255.0
       for k in @spritekeys
        sprite=@sprites[k]
        ratio=(@height<=0) ? 0 : (sprite.y-@y)*1.0/@height
        sprite.zoom_y=opn
        sprite.oy=0
        sprite.y=(@y+(@height/2.0)+(@height*ratio*opn)-(@height/2*opn)).floor
       end
      else
       for k in @spritekeys
        sprite=@sprites[k]
        sprite.zoom_y=1.0
       end
      end
      i=0
      # Ensure Z order
      for k in @spritekeys
       sprite=@sprites[k]
       y=sprite.y
       sprite.y=i
       sprite.oy=(sprite.zoom_y<=0) ? 0 : (i-y)/sprite.zoom_y
      end
     end
    end

    Я там делал менябельным расстояние содержимого от рамки окна. И даже сделал. Вот только не помню - здесь или в другом скрипте. Если не в этом, то скорее всего он на половину испорчен и условно не работоспособен. Но ты проверь - вдруг случится чудо.

    Что касается стрелки, то там их две. Одна - когда окно можно прокрутить, вторая - говорит, что нужно нажать кнопку. Если тебе последнюю, то вот (наверное ):
    Спойлер Стрелка:
    Код:
     pauseRects=[
       trimX + 32,trimY + 64,
       trimX + 48,trimY + 64,
       trimX + 32,trimY + 80,
       trimX + 48,trimY + 80,
      ]
      pauseWidth = 16
      pauseHeight = 16
      @sprites["pause"].src_rect.set(
        pauseRects[@pauseframe*2],
        pauseRects[@pauseframe*2+1],
        pauseWidth,pauseHeight
      )
      @sprites["pause"].x = @x + (@width / 2) - (pauseWidth / 2)
      @sprites["pause"].y = @y + @height - 16 # 16 refers to skin margin

    А если другую - ищи сам. Она там, рядышком.

    P.S. Если совсем припрет - пиши в приват, может, найдется минутка.

  7. #77
    Пользователь Аватар для Demonic
    Информация о пользователе
    Регистрация
    09.09.2009
    Сообщений
    75
    Репутация: 6 Добавить или отнять репутацию

    По умолчанию

    не актуально
    Последний раз редактировалось Demonic; 10.09.2009 в 19:36.

  8. #78

    По умолчанию

    Вот такой скрипт.Должен превращать графику мэйкера в нечто напоминающие 3d.Если кто то попробует и запустит пожалуйста рад буду услышать отзывы

    А вот ссылка на то что должно получится http://brmaker.com.br/forum/script-M...-Xp-t2268.html

    Сам скрипт

    =begin

    Mode07 on the Map!
    Includes:
    Mode07 v0.6
    Overworld Sprite Resize
    Written by mewsterus

    Special Thanks:
    Fanha Giang (for a reverse engineered Tilemap class)
    --------------------------------------------------------------------------------
    Instructions:
    --------------------------------------------------------------------------------
    To install, just insert this in a descriptive code slot right above Main.
    This is different than previous instructions; please read the next paragraph.

    If you had a previous install of this script and need an original version of
    Spriteset_Map, one can be found at:
    http://www.rpg-palace.com/scripts/spriteset_map.txt

    To activate Mode07, add [#XX] to the map's name, replacing XX with the
    percentage of Mode07 to apply. Greater numbers will result in a more slanted
    world.

    To activate overworld sprite resize, add [OV] to the map's name. This will make
    sprites smaller on that map.

    For the purposes of location scripts, these identifiers will not appear.


    Examples:

    "Overworld[#40]" will result in a slant identical to the second screenshot.
    "Underworld[OV]" will resize only the player character to a small size, as if
    seen from high above.
    "Atthelevelworld[OV][#12]" will result in the player being resized, and a modest
    slant of 12%
    "JustPlainWorld" will result in the same old map you've always seen.

    To add a sky, simply use the panorama with the tileset. Also, events will not
    be drawn flat with the map. Any vertical objects such as trees should be put
    in events and displayed that way.

    You can also add a sky by adding a fog. If you add this, you can make it look
    like the first screenshot.

    A note on the $strip_size variable; the default value is 8, however there is
    extremely minimal, almost nonexistant lag with 16. The screen is extremely
    smooth with 4, or even 2. If you're having major problems with lag, you may
    need to use 32, but it won't look too pretty.
    --------------------------------------------------------------------------------
    * Draw_Tilemap v1.72-0.6
    Fanha Giang, 02/12/2006 (mm/dd/yyyy)
    Edited for Mode07 by mewsterus 08/08/2006 (mm/dd/yyyy)
    =end
    #================================================= ==============================

    $width = 640 # Screen width (will not change resolution,
    $height = 480 # Screen height here for compatibility)
    $ov_zoom = 0.6 # Overworld zoom multiplier
    $strip_size = 8 # Size of each strip of the map. Higher numbers will lag less.
    # Recommended that this number be a power of 2.
    # Do not make higher than 64.
    $curve = true # Whether the map is curled, for overworlds (old method)
    $data_map = load_data("Data/MapInfos.rxdata")
    #================================================= ==============================

    class RPG::MapInfo
    def name # Definition prevents location scripts from reading anything within
    return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
    end
    #-----------------------------------------------------------------------------
    def original_name
    return @name
    end
    #-----------------------------------------------------------------------------
    def overworld?
    return @name.scan(/[OV]/).size > 0
    end
    #-----------------------------------------------------------------------------
    def pitch
    @name =~ /\[#[ ]*([00-99]+)\]/i
    return $1
    end
    end
    #================================================= ==============================

    class Draw_Tilemap # This class controls a set of sprites, with different Z
    # values, arranged into horizontal bars
    attr_accessor :tileset
    attr_accessor :map_data
    attr_accessor riorities
    attr_accessor :autotiles
    attr_accessor :bitmaps
    attr_accessor itch
    attr_accessor x
    attr_accessor y
    attr_accessor lus_y
    INDEX = # Autotile definitions
    [
    26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33,
    26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11,
    26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33,
    26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11,
    24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11,
    14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
    28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35,
    38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45,
    24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
    16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47,
    36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
    36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7
    ]
    X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
    Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing; up, up, down, down
    #-----------------------------------------------------------------------------
    def initialize
    # Get initial data from Game_Map
    @tileset = RPG::Cache.tileset($game_map.tileset_name)
    @map_data = $game_map.data
    @priorities = $game_map.priorities
    @autotiles = []
    for i in 0..6
    @autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
    end
    # Provide blank data in proper object form
    @ox = 0
    @oy = 0
    # Bitmaps used for each priority's drawing. Priorities 2-5 are combined.
    @bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
    Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
    Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
    # Generate blank sprites
    @sprites = [[], [], []]
    for i in 0..2 # For each layer
    for j in 0..$game_map.height * (32 / $strip_size) - 1
    # For each horizontal strip of $strip_size height, make a blank sprite
    @sprites[i].push(Sprite.new)
    @sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
    @sprites[i][j].x = $width / 2
    @sprites[i][j].y = -64
    @sprites[i][j].z = -5 + (i * 10)
    end
    end
    @disposed = false
    draw
    end
    #-----------------------------------------------------------------------------
    def update
    # Retrieve variable values for slant drawing; these values accesible by event
    @pitch = $game_map.pitch.to_f
    @plus_y = $game_map.plus_y
    for i in 0..2 # For each layer
    for j in [0, (($height / 2) - (($height * 60) /
    @pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
    (@oy + $height) / $strip_size].min.to_i
    # For each strip within the visible screen, update OX/Y
    @sprites[i][j].x = $width / 2
    @sprites[i][j].y = j * $strip_size - @oy
    unless @pitch == 0 # Apply X Zoom
    @sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
    (@pitch / ($height * 25)) + 1
    if $curve # Zoom Y values same as X, and compensate
    @sprites[i][j].zoom_y = @sprites[i][j].zoom_x
    @sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
    ((1 - @sprites[i][j].zoom_y) /
    (2 * ((@pitch / 100) /
    ($height / ($strip_size * 2)))) + 0.5)
    end
    end
    @sprites[i][j].ox = @ox + $width / 2
    # Add plus_y value; used in airship script
    @sprites[i][j].y += @plus_y
    end
    end
    end
    #-----------------------------------------------------------------------------
    def dispose
    # Dispose all sprites
    for i in 0..2
    for j in @sprites[i]
    j.bitmap.dispose
    j.dispose
    end
    end
    for i in @bitmaps
    i.dispose
    end
    @tileset.dispose
    for i in 0..6
    @autotiles[i].dispose
    end
    @disposed = true
    end
    #-----------------------------------------------------------------------------
    def disposed?
    return @disposed
    end
    #-----------------------------------------------------------------------------
    def draw
    # Draw each individual position by XY value
    for x in 0...@map_data.xsize
    for y in 0...@map_data.ysize
    draw_position(x, y)
    end
    end
    for i in 0..2 # For each priority
    for j in 0..@sprites[i].size - 1
    # For each horizontal strip, transfer the bitmap appropriately
    @sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
    Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
    end
    end
    end
    #-----------------------------------------------------------------------------
    def draw_position(x, y)
    for layer in 0..2
    pos = @map_data[x, y, layer]
    @priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
    if pos >= 384 # If it is a tile
    # src_rect = 32x32 Rect on the tileset for source bitmap
    src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
    # Transfer source bitmap on the tileset to the current map tile
    @bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
    elsif pos >= 48 and pos < 384 # If it is an autotile
    id = pos / 48 - 1 # Which autotile is used (0-6)
    # plus_x is in development for animated autotiles
    plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
    for corner in 0..3
    h = 4 * (pos % 48) + corner # Used to access INDEX
    # src_rect = 16x16 Rect on the autotile for source bitmap
    src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
    # Transfer source bitmap on the autotile to the current 16x16 tile
    @bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
    @autotiles[id], src_rect)
    end
    end
    end
    end
    end
    #================================================= ==============================

    class Game_Map
    attr_accessor itch
    attr_accessor lus_y
    #-----------------------------------------------------------------------------
    alias setup_or :setup
    def setup(map_id)
    setup_or(map_id)
    @pitch = $data_map[$game_map.map_id].pitch
    @plus_y = 0
    end
    #-----------------------------------------------------------------------------
    def name
    return $data_map[@map_id].name
    end
    end
    #================================================= ==============================

    class Sprite_Character < RPG::Sprite
    attr_accessor :character
    #-----------------------------------------------------------------------------
    def initialize(character = nil)
    super()
    @character = character
    update
    end
    #-----------------------------------------------------------------------------
    alias update_or :update
    def update
    update_or
    # Update pitch value, and update zoom values to match
    @pitch = $data_map[$game_map.map_id].pitch.to_f
    self.zoom_x =
    self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
    (@pitch / ($height * 25)) + 1
    # Set sprite coordinates. X value is multiplied by zoom value from the center
    self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
    self.y = @character.screen_y
    # Add Y value for zoom compensation while in curve mode
    if $curve and @pitch != 0
    self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
    (2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
    end
    # Add plus_y value; used in airship script
    self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
    self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
    if $data_map[$game_map.map_id].overworld? and
    @character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
    self.zoom_x *= $ov_zoom # the map is marked with [OV] and event
    self.zoom_y *= $ov_zoom # is a Game_Player
    end
    end
    end
    #================================================= ==============================

    class Spriteset_Map
    def initialize
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 2000
    @viewport3.z = 5000
    # Make tilemap
    @tilemap = Draw_Tilemap.new
    # Make panorama plane
    @panorama = Plane.new
    @panorama.z = -2000
    # Make fog plane
    @fog = Plane.new
    @fog.z = 3000
    # Make character sprites
    @character_sprites = []
    for i in $game_map.events.keys.sort
    sprite = Sprite_Character.new($game_map.events[i])
    @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new($game _player))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 1..50
    @picture_sprites.push(Sprite_Picture.new(@viewport 2,
    $game_screen.pictures[i]))
    end
    # Make timer sprite
    @timer_sprite = Sprite_Timer.new
    # Frame update
    update
    end
    #-----------------------------------------------------------------------------
    def dispose
    # Dispose of tilemap
    @tilemap.dispose
    # Dispose of panorama plane
    @panorama.dispose
    # Dispose of fog plane
    @fog.dispose
    # Dispose of character sprites
    for sprite in @character_sprites
    sprite.dispose
    end
    # Dispose of weather
    @weather.dispose
    # Dispose of picture sprites
    for sprite in @picture_sprites
    sprite.dispose
    end
    # Dispose of timer sprite
    @timer_sprite.dispose
    # Dispose of viewports
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    end
    end

  9. #79
    Бывалый Аватар для Inkognitoo
    Информация о пользователе
    Регистрация
    30.09.2008
    Адрес
    Пермь.
    Сообщений
    988
    Записей в дневнике
    4
    Репутация: 16 Добавить или отнять репутацию

    По умолчанию

    Гм.. А можно демо?

  10. #80

    По умолчанию

    С удовольствием бы выложил демо но у меня не получилось.Поэтому и обращаюсь сюда.Может у кого то получится

Страница 8 из 147 ПерваяПервая ... 6789101858108 ... ПоследняяПоследняя

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 5 (пользователей: 0 , гостей: 5)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Помощь с скриптами (RGSS)