设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2450|回复: 8
打印 上一主题 下一主题

[已经解决] 关于导入图片作为地图的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
141 小时
注册时间
2011-12-21
帖子
51
跳转到指定楼层
1
发表于 2012-9-21 12:45:02 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 用疯狂拯救世界 于 2012-9-22 11:02 编辑

我想问一个关于把图片导入成地图的问题。

问题具体描述:星君以前发过一个关于地图绘制的教程http://rpg.blue/thread-213872-1-5.html

教程里面最后用到了fix脚本可以把事件里面“显示图片”显示出来的图片铺到你想要的图层,把图片铺到人物的下面就可以作为地图使用了。这种方法画地图的话会PS的同学们就大有施展本领的空间了。

然后我就想到了另外一个问题,像树那样树冠会遮挡站在后面的人物这样的效果,要做这种效果的话把树和地面画在同一张图片就是做不到的,必须把树画到另一张图片上然后把那张图片铺到人物的上方雾图的下方,也就是说需要有一前一后两张图片把人物夹在中间的图层(不知道我这样说能把我的想法说清楚了没有)。

如果还是用上面教程里面的那个fix脚本的话问题就来了,脚本里面用一个变量控制图片显示的图层,所以在事件里设置显示出来的多张图片都会显示在同一图层,不能实现上面我说到的效果,我的问题就是有没有别的方法能使两张图片分别铺到不同的图层上面。


补充:如果是用远景图改造成为铺在下面的那张图的话想用远景图就纠结了(远景图的作用还是很强大的),如果利用雾图改造的话也会牺牲掉雾图的功能,所以我觉得改造这两个都不好使。我更希望发教程的大神星君能出来发表一下自己的看法!{:2_286:}

P了一张图来说明,希望大家更容易理解我的想法,然后帮助我解决这个问题啦!



[

Lv4.逐梦者

送快递的水表员

梦石
10
星屑
4792
在线时间
3303 小时
注册时间
2012-6-27
帖子
7160

开拓者贵宾

2
发表于 2012-9-21 12:51:11 | 只看该作者
表示看晕了……
不过大体意思明白了……
呃……适用于没有你所说的这种情况的地图?……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
2459 小时
注册时间
2011-12-18
帖子
1484
3
发表于 2012-9-21 13:12:28 | 只看该作者
LZ是想要星君GK中那种地图效果是吗?
这是一个深不见底的坑,这是一个广袤无边的坑,我才刚刚放上了一抔泥土……

《六道·陈国篇》开坑了……↓点我
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
141 小时
注册时间
2011-12-21
帖子
51
4
 楼主| 发表于 2012-9-22 11:06:31 | 只看该作者
Password 发表于 2012-9-21 12:51
表示看晕了……
不过大体意思明白了……
呃……适用于没有你所说的这种情况的地图?…… ...

我补充了一张图来说明想法,请大神再看看!


‘‘──用疯狂拯救世界于2012-9-22 11:07补充以下内容:

那个……弱弱地问,GK是什么意思?
’’
[
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
2459 小时
注册时间
2011-12-18
帖子
1484
5
发表于 2012-9-22 11:41:07 | 只看该作者
本帖最后由 a364774426 于 2012-9-23 10:12 编辑

说起来,也就是那样的效果了。给你两个脚本。
脚本一:
  1. #==============================================================================
  2. # ** Spriteset_Map
  3. #------------------------------------------------------------------------------
  4. #  This class brings together map screen sprites, tilemaps, etc. It's used
  5. # within the Scene_Map class.
  6. #==============================================================================

  7. class Spriteset_Map
  8.   #--------------------------------------------------------------------------
  9.   # * Object Initialization
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     #GROUND OVERLAY#
  13.     @GroundON = FileTest.exist?("Overlays/" + "ground" + $game_map.map_id.to_s + ".png")
  14.     create_viewports
  15.     create_tilemap
  16.     create_parallax
  17.     create_characters
  18.     create_shadow
  19.     create_weather
  20.     create_pictures
  21.     create_timer
  22.     update
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # * Create Viewport
  26.   #--------------------------------------------------------------------------
  27.   def create_viewports
  28.     @viewport1 = Viewport.new(0, 0, 800, 480)
  29.     @viewport2 = Viewport.new(0, 0, 800, 480)
  30.     @viewport3 = Viewport.new(0, 0, 800, 480)
  31.     @viewport2.z = 50
  32.     @viewport3.z = 100
  33.     @viewport7 = Viewport.new(0, 0, 800, 480)
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # * Create Tilemap
  37.   #--------------------------------------------------------------------------
  38.   def create_tilemap
  39.     @tilemap = Tilemap.new(@viewport1)
  40.     @tilemap.bitmaps[0] = Cache.system("TileA1")
  41.     @tilemap.bitmaps[1] = Cache.system("TileA2")
  42.     @tilemap.bitmaps[2] = Cache.system("TileA3")
  43.     @tilemap.bitmaps[3] = Cache.system("TileA4")
  44.     @tilemap.bitmaps[4] = Cache.system("TileA5")
  45.     @tilemap.bitmaps[5] = Cache.system("TileB")
  46.     @tilemap.bitmaps[6] = Cache.system("TileC")
  47.     @tilemap.bitmaps[7] = Cache.system("TileD")
  48.     @tilemap.bitmaps[8] = Cache.system("TileE")
  49.     @tilemap.map_data = $game_map.data
  50.     @tilemap.passages = $game_map.passages
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # * Create Parallax
  54.   #--------------------------------------------------------------------------
  55.   def create_parallax
  56.     if @GroundON
  57.       @ground = Plane.new(@viewport1)
  58.       @ground.z = 255
  59.       @ground.bitmap = Cache.overlay("ground" + $game_map.map_id.to_s)
  60.     end
  61.     #end HANZO
  62.     @parallax = Plane.new(@viewport1)
  63.     @parallax.z = -100
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # * Create Character Sprite
  67.   #--------------------------------------------------------------------------
  68.   def create_characters
  69.     @character_sprites = []
  70.     for i in $game_map.events.keys.sort
  71.       sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
  72.       @character_sprites.push(sprite)
  73.     end
  74.     for vehicle in $game_map.vehicles
  75.       sprite = Sprite_Character.new(@viewport1, vehicle)
  76.       @character_sprites.push(sprite)
  77.     end
  78.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # * Create Airship Shadow Sprite
  82.   #--------------------------------------------------------------------------
  83.   def create_shadow
  84.     @shadow_sprite = Sprite.new(@viewport1)
  85.     @shadow_sprite.bitmap = Cache.system("Shadow")
  86.     @shadow_sprite.ox = @shadow_sprite.bitmap.width / 2
  87.     @shadow_sprite.oy = @shadow_sprite.bitmap.height
  88.     @shadow_sprite.z = 180
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # * Create Weather
  92.   #--------------------------------------------------------------------------
  93.   def create_weather
  94.     @weather = Spriteset_Weather.new(@viewport2)
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # * Create Picture Sprite
  98.   #--------------------------------------------------------------------------
  99.   def create_pictures
  100.     @picture_sprites = []
  101.     for i in 1..20
  102.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  103.         $game_map.screen.pictures[i]))
  104.     end
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # * Create Timer Sprite
  108.   #--------------------------------------------------------------------------
  109.   def create_timer
  110.     @timer_sprite = Sprite_Timer.new(@viewport2)
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # * Dispose
  114.   #--------------------------------------------------------------------------
  115.   def dispose
  116.     dispose_tilemap
  117.     dispose_parallax
  118.     dispose_characters
  119.     dispose_shadow
  120.     dispose_weather
  121.     dispose_pictures
  122.     dispose_timer
  123.     dispose_viewports
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # * Dispose of Tilemap
  127.   #--------------------------------------------------------------------------
  128.   def dispose_tilemap
  129.     @tilemap.dispose
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # * Dispose of Parallax
  133.   #--------------------------------------------------------------------------
  134.   def dispose_parallax
  135.     if @ground != nil
  136.      @ground.dispose
  137.    end
  138.     if @par != nil
  139.       @par.dispose
  140.     end
  141.     @parallax.dispose
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # * Dispose of Character Sprite
  145.   #--------------------------------------------------------------------------
  146.   def dispose_characters
  147.     for sprite in @character_sprites
  148.       sprite.dispose
  149.     end
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # * Dispose of Airship Shadow Sprite
  153.   #--------------------------------------------------------------------------
  154.   def dispose_shadow
  155.     @shadow_sprite.dispose
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # * Dispose of Weather
  159.   #--------------------------------------------------------------------------
  160.   def dispose_weather
  161.     @weather.dispose
  162.   end
  163.   #--------------------------------------------------------------------------
  164.   # * Dispose of Picture Sprite
  165.   #--------------------------------------------------------------------------
  166.   def dispose_pictures
  167.     for sprite in @picture_sprites
  168.       sprite.dispose
  169.     end
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # * Dispose of Timer Sprite
  173.   #--------------------------------------------------------------------------
  174.   def dispose_timer
  175.     @timer_sprite.dispose
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # * Dispose of Viewport
  179.   #--------------------------------------------------------------------------
  180.   def dispose_viewports
  181.     @viewport1.dispose
  182.     @viewport2.dispose
  183.     @viewport3.dispose
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # * Frame Update
  187.   #--------------------------------------------------------------------------
  188.   def update
  189.     update_tilemap
  190.     update_parallax
  191.     update_characters
  192.     update_shadow
  193.     update_weather
  194.     update_pictures
  195.     update_timer
  196.     update_viewports
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # * Update Tilemap
  200.   #--------------------------------------------------------------------------
  201.   def update_tilemap
  202.     @tilemap.ox = $game_map.display_x / 8
  203.     @tilemap.oy = $game_map.display_y / 8
  204.     @tilemap.update
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # * Update Parallax
  208.   #--------------------------------------------------------------------------
  209.   def update_parallax
  210.     #HANZO Ground Overlay
  211.     if @ground != nil
  212.         @ground.tone = $game_map.screen.tone
  213.         if @ground.ox != -$game_map.display_x / 256 or @ground.oy != -$game_map.display_y / 256 or @ground.ox == 0 or @ground.oy == 0
  214.           @ground.ox = $game_map.display_x / 8
  215.           @ground.oy = $game_map.display_y / 8
  216.         end #./
  217.       end  #./
  218.     if @parallax_name != $game_map.parallax_name
  219.       @parallax_name = $game_map.parallax_name
  220.       if @parallax.bitmap != nil
  221.         @parallax.bitmap.dispose
  222.         @parallax.bitmap = nil
  223.       end
  224.       if @parallax_name != ""
  225.         @parallax.bitmap = Cache.parallax(@parallax_name)
  226.       end
  227.       Graphics.frame_reset
  228.     end
  229.     @parallax.ox = $game_map.calc_parallax_x(@parallax.bitmap)
  230.     @parallax.oy = $game_map.calc_parallax_y(@parallax.bitmap)
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # * Update Character Sprite
  234.   #--------------------------------------------------------------------------
  235.   def update_characters
  236.     for sprite in @character_sprites
  237.       sprite.update
  238.     end
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # * Update Airship Shadow Sprite
  242.   #--------------------------------------------------------------------------
  243.   def update_shadow
  244.     airship = $game_map.airship
  245.     @shadow_sprite.x = airship.screen_x
  246.     @shadow_sprite.y = airship.screen_y + airship.altitude
  247.     @shadow_sprite.opacity = airship.altitude * 8
  248.     @shadow_sprite.update
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # * Update Weather
  252.   #--------------------------------------------------------------------------
  253.   def update_weather
  254.     @weather.type = $game_map.screen.weather_type
  255.     @weather.max = $game_map.screen.weather_max
  256.     @weather.ox = $game_map.display_x / 8
  257.     @weather.oy = $game_map.display_y / 8
  258.     @weather.update
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # *Update Picture Sprite
  262.   #--------------------------------------------------------------------------
  263.   def update_pictures
  264.     for sprite in @picture_sprites
  265.       sprite.update
  266.     end
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # * Update Timer Sprite
  270.   #--------------------------------------------------------------------------
  271.   def update_timer
  272.     @timer_sprite.update
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # * Update Viewport
  276.   #--------------------------------------------------------------------------
  277.   def update_viewports
  278.     @viewport1.tone = $game_map.screen.tone
  279.     @viewport1.ox = $game_map.screen.shake
  280.     @viewport2.color = $game_map.screen.flash_color
  281.     @viewport3.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
  282.     @viewport1.update
  283.     @viewport2.update
  284.     @viewport3.update
  285.   end
  286. end
复制代码
脚本二:
  1. ####################################################################
  2. # AutoLight v3.7

  3. # By: SojaBird
  4. # Site: [url]http://www.nestcast.blogspot.com[/url]
  5. # Discription:  AutoLight is based on selfmade pictures wich represent the lights
  6. #               and shadows of every map. AutoLight also has a spot-mode wich
  7. #               causes to show a spot over the players position so that only
  8. #               close serounding area is enlighted.
  9. ####################################################################

  10. =begin
  11. #####
  12. -------------------------
  13. How to call script?
  14. -------------------------

  15. 1)
  16.   First of all, when you're going to changes something of AutoLight by calling
  17.   the script, you have to get rid of the old pictures. To do this call the next
  18.   script first;
  19.     $AutoLight.dispose
  20.   
  21.   Now you can change any value from the setup below by calling the script;
  22.     SojaBird_AL::X
  23.   X is the option you want to changes.
  24.   
  25.   After you've done made all the changes you wanted, call the script to draw the
  26.   pictures again;
  27.     $AutoLight.paint
  28.   
  29.   ~EXAMPLE 1~
  30.     So I want to changes the name of my pictures I'm using for the lights from
  31.     "Light" to "Light2". Also I want to get rid of the shadows. My call script
  32.     event should look like this;
  33.       $AutoLight.dispose
  34.       SojaBird_AL::LightMap = "Light2"
  35.       SojaBird_AL::UseShadow = false
  36.       $AutoLight.paint
  37.   ~END 1~
  38.   
  39.   
  40. 2)
  41.   A little harder is it, when you want to add a certain amount. What you must do
  42.   is call the script;
  43.     @temp = SojaBird_AL::X
  44.     SojaBird_AL::X = @temp + Y
  45.   X is the option you want to changes.
  46.   Y is the amount you want to add.
  47.   
  48.   The same script is used for subtract, multiply, divide and all other
  49.   mathematical calculations.
  50.   (!Tip: Insted of '@temp', you can use whatever text as long as it has '@'
  51.   infront of it.)
  52.   
  53.   ~EXAMPLE 2~
  54.     This time I want to push up the opacity of my lights with, say like 5
  55.     everytime the script is called. I also want the shadows to decrease with 3.
  56.     My call script event should look like this;
  57.       $AutoLight.dispose
  58.       @temp = SojaBird_AL::LightOpacity
  59.       SojaBird_AL::LightOpacity = @temp + 5
  60.       @temp = SojaBird_AL::ShadowOpacity
  61.       SojaBird_AL::ShadowOpacity = @temp - 3
  62.       $AutoLight.paint
  63.   ~END 2~
  64.   
  65.   
  66. 3)
  67.   To use variables as a value for sertain options from AutoLight, you'll have to
  68.   use the next script;
  69.     SojaBird_AL::X = $game_variables[Z]
  70.   X is the option you want to changes.
  71.   Z is the variable number.
  72.   
  73.   ~EXAMPLE 3~
  74.     I want to make a variable lightsource so that the player can change the
  75.     values to his/her desire. To realize this, the opacity of the lights need to
  76.     be set by a variable. I'll use 1. The call script event should look like this;
  77.       $AutoLight.dispose
  78.       SojaBird_AL::LightOpacity = $game_variables[1]
  79.       $AutoLight.paint
  80.   ~END 3~
  81.   
  82.   
  83. 4)
  84.   Now if I want to add a variable to a sertain fixed amount, I have to use points
  85.   2 and 3 together. The script that must be used is this;
  86.     @temp = SojaBird_AL::X
  87.     SojaBird_AL::X = @temp + $game_variables[Z]
  88.   X is the option you want to changes.
  89.   Z is the variable number.
  90.   
  91.   The same script is used for subtract, multiply, divide and all other
  92.   mathematical calculations.
  93.   (!Tip: Insted of '@temp', you can use whatever text as long as it has '@'
  94.   infront of it.)
  95.   
  96.   ~EXAMPLE 4~
  97.     The flicker of my spot needs to be adjustable by the player. Though, I don't
  98.     want the player to be able to turn it of by set the value of the flicker to 1
  99.     or less. To ensure this, I'll set the flicker in the setup to 5 so that it
  100.     standard flickers 5 pixels. Now the player can add extra flicker to the spot
  101.     by useing setting the variable number 2. My call script event looks like this;
  102.       $AutoLight.dispose
  103.       @temp = SojaBird_AL::SpotFlicker
  104.       SojaBird_AL::SpotFlicker = @temp + $game_variables[2]
  105.       $AutoLight.paint
  106.   ~END 4~

  107.   
  108. 5)
  109.   >>> MORE TO COME SOON <<<
  110.   
  111. #####
  112. =end

  113. ####################################################################
  114. # Start Setup
  115. ####################################################################
  116. module SojaBird_AL


  117.   Mode = 1 # The mode that autolight uses (Light/Shadow=1, Spot=2, 3=Both, 0=Nothing).
  118.   PictureFormat = "png" # The fileformat of the pictures. Eg. "jpg" or "png" ("...").
  119.   
  120. ### WHEN MODE = 1 or 3 ###
  121.   LightSwitch = 1 # Number of the switch to show/hide the lightpicture.
  122.   ShadowSwitch = 1 # Number of the switch to show/hide the shadowpicture.
  123.   ParSwitch = 1
  124.   GroundSwitch = 1
  125.   
  126.   LightOpacity = 115 # Opacity of the lightpictures (0-255).
  127.   ShadowOpacity = 145 # Opacity of the shadowpictures (0-255).
  128.   ParOpacity = 255
  129.   GroundOpacity = 255
  130.   
  131.   UseLight = true # Wheter or not to use a lightmaps (true/false).
  132.   UseShadow = true # Wheter or not tu se shadowmaps (true/false).
  133.   UsePar = true
  134.   UseGround = true
  135.   
  136.   LightMap = "Light" # The name of the files with the lights ("...").
  137.   ShadowMap = "Shadow" # The name of the files with the shadows ("...").
  138.   ParMap = "Par"
  139.   GroundMap = "Ground"
  140.   
  141.   LightBlend = 1 # Blending of the lightpicture (0=Normal, 1=More, 2=Less).
  142.   ShadowBlend = 2 #Blending of the shadowpicture (0=Normal, 1=More, 2=Less).
  143.   ParBlend = 0
  144.   GroundBlend = 0
  145.   
  146.   LightFlicker = 1 # Amount of flicker the lights have (<2=No flicker, >1=Flicker).
  147.   ShadowFlicker = 0 # Amount of flicker the shadows have (<2=No flicker, >1=Flicker).
  148.   
  149. # The light- and shadowmaps need to have the map ID at the end of the by you
  150. # choosen name!


  151. ### WHEN MODE = 2 or 3 ###
  152.   SpotSwitch = 1 # Number of the swtich to show/hide the spotpicture.
  153.   
  154.   SpotOpacity = 255 # Opacity of the spotpicture (value=0-255).
  155.   
  156.   SpotMap = "Spot" # Name of the file with the spot ("...").
  157.   
  158.   SpotBlend = 2 # Blending of the spotpicture (0=Normal, 1=More, 2=Less).

  159.   SpotFlicker = 2 # Amount of flicker the spot has (<2=No flicker, >1=Flicker).
  160.   
  161. # The spotpicture should have the size of 1088*832!


  162. end
  163. ####################################################################
  164. # End Setup
  165. ####################################################################

  166. ##############################
  167. if SojaBird_AL::Mode != 0
  168. class Scene_Map < Scene_Base
  169.   alias al_start start
  170. ##############################
  171.   def start
  172.     al_start
  173.     $AutoLight = AutoLight.new
  174.   end
  175. ###############
  176.   def terminate
  177.     super
  178.     if $scene.is_a?(Scene_Battle)
  179.       @spriteset.dispose_characters
  180.     end
  181.     snapshot_for_background
  182.     @spriteset.dispose
  183.     @message_window.dispose
  184.     $AutoLight.dispose
  185.     if $scene.is_a?(Scene_Battle)
  186.       perform_battle_transition
  187.     end
  188.   end
  189. ###############
  190.   def update
  191.     super
  192.     $game_map.interpreter.update
  193.     $game_map.update
  194.     $game_player.update
  195.     $game_system.update
  196.     @spriteset.update
  197.     @message_window.update
  198.     $AutoLight.update
  199.     unless $game_message.visible
  200.       update_transfer_player
  201.       update_encounter
  202.       update_call_menu
  203.       update_call_debug
  204.       update_scene_change
  205.     end
  206.   end
  207. ###############
  208.   def update_transfer_player
  209.         var_ID = 21
  210.    
  211.    
  212.     case $game_variables[var_ID]
  213.     when 1 # Normaln transfer
  214.       normal_transfer
  215.     when 2 # Fadeless transfer
  216.       fadeless_transfer
  217.     when 3 # White screen transfer
  218.       white_screen_transfer
  219.     end

  220.     return unless $game_player.transfer?
  221.     fade = (Graphics.brightness > 0)
  222.     fadeout(30) if fade
  223.     @spriteset.dispose
  224.     $game_player.perform_transfer
  225.     $game_map.autoplay
  226.     $game_map.update
  227.     Graphics.wait(15)
  228.     @spriteset = Spriteset_Map.new
  229.     $AutoLight.dispose
  230.     $AutoLight = AutoLight.new
  231.     fadein(30) if fade
  232.     Input.update
  233.   end
  234. ##############################
  235. end
  236. ##############################
  237. ############################################################
  238. ##############################
  239. class AutoLight
  240. include SojaBird_AL
  241. ##############################
  242.   def initialize
  243.     file_check
  244.     paint
  245.   end
  246.   
  247.   def file_check
  248.     @LightON = FileTest.exist?("Overlays/" + LightMap + $game_map.map_id.to_s + "." + PictureFormat)
  249.     @ShadowON = FileTest.exist?("Overlays/" + ShadowMap + $game_map.map_id.to_s + "." + PictureFormat)
  250.     @SpotON = FileTest.exist?("Overlays/" + SpotMap + "." + PictureFormat)
  251.     @ParON = FileTest.exist?("Overlays/" + ParMap + $game_map.map_id.to_s + ".png")
  252.   end
  253.   
  254.   def paint
  255.     case Mode
  256.     when 1, 3
  257.     if @LightON
  258.         if UseLight == true
  259.           @light_viewport = Viewport.new(0, 0, 800, 480)
  260.           @light_viewport.z = 9
  261.           @light = Sprite.new(@light_viewport)
  262.           @light.bitmap = Cache.overlay(LightMap + $game_map.map_id.to_s)
  263.           @light.z = 10
  264.           @light.opacity = LightOpacity
  265.           @light.blend_type = LightBlend
  266.           @light.visible = $game_switches[LightSwitch]
  267.         end
  268.       end
  269.       if @ShadowON
  270.         if UseShadow == true
  271.           @shadow_viewport = Viewport.new(0, 0, 800, 480)
  272.           @shadow_viewport.z = 10
  273.           @shadow = Sprite.new(@shadow_viewport)
  274.           @shadow.bitmap = Cache.overlay(ShadowMap + $game_map.map_id.to_s)
  275.           @shadow.z = 9
  276.           @shadow.opacity = ShadowOpacity
  277.           @shadow.blend_type = ShadowBlend
  278.           @shadow.visible = $game_switches[ShadowSwitch]
  279.         end
  280.       end
  281.     if @ParON
  282.         if UsePar == true
  283.           @par_viewport = Viewport.new(0, 0, 800, 480)
  284.           @par_viewport.z = 8
  285.           @par = Plane.new(@par_viewport)
  286.           @par.z = 8
  287.           @par.bitmap = Cache.overlay(ParMap + $game_map.map_id.to_s)
  288.           @par.tone = $game_map.screen.tone
  289.           @par.opacity = ParOpacity
  290.           @par.blend_type = ParBlend
  291.           @par.visible = $game_switches[ParSwitch]
  292.         end
  293.       end
  294.     when 2, 3
  295.       if @SpotON
  296.         @spot_viewport = Viewport.new(0, 0, 800, 480)
  297.         @spot = Sprite.new(@spot_viewport)
  298.         @spot.bitmap = Cache.picture(SpotMap)
  299.         @spot.z = 9
  300.         @spot.opacity = SpotOpacity
  301.         @spot.blend_type = SpotBlend
  302.         @spot.visible = $game_switches[SpotSwitch]
  303.       end
  304.     end
  305.     update
  306.   end
  307. ###############
  308.   def update
  309.     case Mode
  310.     when 2, 3
  311.       if @spot != nil
  312.         @spot.visible = $game_switches[SpotSwitch]
  313.         @spot.x = ($game_player.real_x / 8) - ($game_map.display_x / 8) - 800 + 16 + rand(SpotFlicker)
  314.         @spot.y = ($game_player.real_y / 8) - ($game_map.display_y / 8) - 480 + 16 + rand(SpotFlicker)
  315.       end #./
  316.     when 1, 3
  317.       if @light != nil
  318.         @light.visible = $game_switches[LightSwitch]
  319.       end #./
  320.       if @shadow != nil
  321.         @shadow.visible = $game_switches[ShadowSwitch]
  322.       end #./
  323.       if @par != nil
  324.         @par.visible = $game_switches[ParSwitch]
  325.       end #./
  326.       if @ground != nil
  327.         @ground.visible = $game_switches[GroundSwitch]
  328.       end #./
  329.       if @light != nil
  330.         @light.tone = $game_map.screen.tone
  331.         if @light.x != $game_map.display_x / 256 or @light.y != $game_map.display_y / 256 or @light.x == 0 or @light.y == 0
  332.           @light.ox = $game_map.display_x / 8 + rand(LightFlicker)
  333.           @light.oy = $game_map.display_y / 8 + rand(LightFlicker)
  334.         end #./
  335.       end #./
  336.       if @shadow != nil
  337.         @shadow.tone = $game_map.screen.tone
  338.         if @shadow.x != $game_map.display_x / 256 or @shadow.y != $game_map.display_y / 256 or @shadow.x == 0 or @shadow.y == 0
  339.           @shadow.ox = $game_map.display_x / 8 + rand(ShadowFlicker)
  340.           @shadow.oy = $game_map.display_y / 8 + rand(ShadowFlicker)
  341.         end #./
  342.       end #./
  343.       if @par != nil
  344.         @par.tone = $game_map.screen.tone
  345.         if @par.ox != $game_map.display_x / 256 or @par.oy != $game_map.display_y / 256 or @par.ox == 0 or @par.oy == 0
  346.           @par.ox = $game_map.display_x / 8
  347.           @par.oy = $game_map.display_y / 8
  348.         end #./
  349.       end #./
  350.     end #case end
  351.   end #def end
  352. ###############
  353.   def dispose
  354.     case Mode
  355.     when 1, 3
  356.       if @light != nil
  357.         @light_viewport.dispose
  358.         @light.dispose
  359.       end
  360.       if @shadow != nil
  361.         @shadow_viewport.dispose
  362.         @shadow.dispose
  363.       end
  364.       if @par != nil
  365.         @par_viewport.dispose
  366.         @par.dispose
  367.       end
  368.     when 2, 3
  369.       if @spot != nil
  370.         @spot_viewport.dispose
  371.         @spot.dispose
  372.       end
  373.     end
  374.   end
  375. ##############################
  376. end
  377. end
  378. ##############################
复制代码
使用方法:在工程文件夹中新建一个名为“Overlays”的文件夹。其中装的是LZ你需要的两种图片。其一是优先度在角色上方的,例如:
我将此图片命名为par25,意思是这张图片会在ID为25的地图中以优先度在角色上方出现。
其二是:图片略,我目前还不需要,所以没有做。命名格式为groundXX,作为优先度在角色下方的图片。其中XX与之前的25同义。
PS:想要做出华丽效果的地图,那么心血无疑是要花费很多的。LZ自己考虑得失哈。对了,par类型图片要产生效果需要打开一号开关。
效果游戏开始前一号开关就打开的话,按下面图片添加一句代码: 。前提是你没有使用美化标题类的脚本。
���

点评

这个方法太帅气了。  发表于 2012-9-22 11:59
这是一个深不见底的坑,这是一个广袤无边的坑,我才刚刚放上了一抔泥土……

《六道·陈国篇》开坑了……↓点我
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
141 小时
注册时间
2011-12-21
帖子
51
6
 楼主| 发表于 2012-9-22 12:09:09 | 只看该作者
a364774426 发表于 2012-9-22 11:41
说起来,也就是那样的效果了。给你两个脚本。
脚本一:脚本二:
######################################## ...

论坛上之前有个地图大赛擂台赛,看了之后觉得前几名的都画得很不错,后来又上了国外的网站看了他们的作品,发现同是用VX、VA画出来的地图,我们跟他们还是有一定的距离,而且我还发现论坛里那个地图擂台赛前几名里面有一个地图作品跟国外某个地图相似度非常高,所用的素材也是那个网站上提供的,觉得很可悲。
外国论坛上的地图画得好,我觉得部分原因是他们有很好的美工,地图元素比我们论坛的库存丰富得多,而且质量高,都是共享出来的,我们现在用的非原装地图素材都是从他们那里抠回来的。
玩家在游戏中的大部分时间都是在地图上行走,所以为了提高地图的质量,我觉得还是很有必要花多点功夫的。
[
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
2459 小时
注册时间
2011-12-18
帖子
1484
7
发表于 2012-9-22 12:23:07 | 只看该作者
用疯狂拯救世界 发表于 2012-9-22 12:09
论坛上之前有个地图大赛擂台赛,看了之后觉得前几名的都画得很不错,后来又上了国外的网站看了他们的作品 ...

如果是总体质量上来说,我们的游戏的确不如国外的游戏。
做游戏不是为了哗众取宠,不是为了三分钟热度。
因为喜爱,然后坚持地做下去,并且不断改善。做到这一点,那么我们游戏的质量也会提高。
至于素材的问题,我们有人能够制作不逊色于VS或STREAMPNUK的图块,为什么没有,
不然就不会有各种画面都很好的网游出现了。
我认为原因是“不值得为这类的游戏投入这样的精力”
至于阁下最后一句,有漂亮的地图,那么就会给玩游戏提供了一个心情愉悦的大好基础。
哈哈,我看好你哦。
这是一个深不见底的坑,这是一个广袤无边的坑,我才刚刚放上了一抔泥土……

《六道·陈国篇》开坑了……↓点我
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
141 小时
注册时间
2011-12-21
帖子
51
8
 楼主| 发表于 2012-9-22 23:49:47 | 只看该作者
a364774426 发表于 2012-9-22 12:23
如果是总体质量上来说,我们的游戏的确不如国外的游戏。
做游戏不是为了哗众取宠,不是为了三分钟热度。
...

最后一句受鼓舞了
[
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
141 小时
注册时间
2011-12-21
帖子
51
9
 楼主| 发表于 2012-9-23 00:04:54 | 只看该作者
a364774426 发表于 2012-9-22 12:23
如果是总体质量上来说,我们的游戏的确不如国外的游戏。
做游戏不是为了哗众取宠,不是为了三分钟热度。
...

第二个脚本没有“复制代码”啊,直接复制得到的代码没有回车全在一行了,请大神再帮帮忙吧!

点评

已改  发表于 2012-9-23 10:13
[
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-3 15:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表