Project1

标题: vx的战斗背景脚本一般都是一张一张设定的。有没有简单的方 [打印本页]

作者: quanhome    时间: 2011-4-5 16:57
标题: vx的战斗背景脚本一般都是一张一张设定的。有没有简单的方
我找了好几个 vx的战斗背景脚本一般都是一张一张设定的。有没有简单的方。 比如  让所有地图 都指定为同一个文件的战斗背景怎么写啊??感谢了。。。

参考地址。。   
http://rpg.blue/forum.php?mod=vi ... 7%E8%83%8C%E6%99%AFdsu_plus_rewardpost_czw
作者: 烁灵    时间: 2011-4-5 17:19
本帖最后由 烁灵 于 2011-4-5 17:19 编辑

我想关键还是背景文件的确定吧
  1. unless fixed

  2. if EXBTL_BACKGR_MAP.has_key?($game_map.map_id)

  3.     source = EXBTL_BACKGR_MAP[$game_map.map_id]

  4.    fixed = true

  5. end
复制代码
加个else好了
  1. unless fixed

  2. if EXBTL_BACKGR_MAP.has_key?($game_map.map_id)

  3.     source = EXBTL_BACKGR_MAP[$game_map.map_id]

  4.    fixed = true
  5. esle
  6.     source = 你的文件名############
  7.     fixed = true

  8. end
复制代码
就可以给没有设置背景的地图全部使用同一张了
作者: Rion幻音    时间: 2011-4-5 17:23
可以使用这个脚本:
  1. ##################################################
  2. # MOG_BATTLEBACK_XP V1.0                                    #
  3. ##################################################
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. ##################################################
  7. # Permite utilizar as imagens de Battleback no lugar da
  8. # imagem distorcida do mapa.
  9. # No entanto é possível ativar a versão VX utilizando as
  10. # switches no momento que desejar.
  11. ##################################################
  12. # Dentro da pasta GRAPHICS crie uma outra pasta com
  13. # o nome de BATTLEBACKS, por fim coloque as imagens
  14. # do battleback dentro pasta.
  15. # Para selecionar a imagem do Battleback use o seguinte
  16. # código em um evento qualquer usando o comando
  17. # SCRIPT.
  18. #
  19. # $game_system.bb = "FILE_NAME"
  20. #
  21. # No lugar do FILE_NAME coloque o nome do arquivo que
  22. # corresponde o nome do Battleback.
  23. # Se deseja que o battleback seja o mapa de fundo,
  24. # coloque um nome de arquivo inexistente.
  25. #
  26. ##################################################
  27. #############
  28. #   CONFIG    #
  29. #############
  30. module MOG_VX02
  31. #Definição da switch que ativa o efeito Wave.  
  32. BB_WAVE_SWITCH = 2
  33. #Definição da switch que ativa a versão VX.
  34. BB_VXEDITION_SWITCH = 3
  35. end
  36. #-------------------------------------------------
  37. $mogscript = {} if $mogscript == nil
  38. $mogscript["battleback_xp"] = true
  39. #-------------------------------------------------
  40. ###############
  41. # Game_System #
  42. ###############
  43. class Game_System
  44. attr_accessor :bb
  45. alias mog_vx02_initialize initialize
  46. def initialize
  47. mog_vx02_initialize
  48. @bb = ""
  49. end
  50. end
  51. ###############
  52. # Module Cache #
  53. ###############
  54. module Cache  
  55.   def self.battleback(filename)
  56.     load_bitmap("Graphics/battlebacks/", filename)
  57.   end
  58. end
  59. #################
  60. # Spriteset_Battle #
  61. #################
  62. class Spriteset_Battle
  63. include MOG_VX02
  64.   def create_battleback
  65.     @battleback_sprite = Sprite.new(@viewport1)
  66.     source = Cache.battleback($game_system.bb.to_s) rescue empty
  67.     if  $game_switches[BB_WAVE_SWITCH] == true
  68.     bitmap = Bitmap.new(640, 480)
  69.     else
  70.     bitmap = Bitmap.new(640, 480)
  71.     end
  72.     bitmap.stretch_blt(bitmap.rect, source, source.rect)
  73.     bitmap.radial_blur(90, 12) if  $game_switches[BB_VXEDITION_SWITCH] == true
  74.     @battleback_sprite.bitmap = bitmap
  75.     wave_on if  $game_switches[BB_WAVE_SWITCH] == true
  76. end
  77. def wave_on
  78.     @battleback_sprite.ox = 320
  79.     @battleback_sprite.oy = 240
  80.     @battleback_sprite.x = 272
  81.     @battleback_sprite.y = 176  
  82.     @battleback_sprite.wave_amp = 8
  83.     @battleback_sprite.wave_length = 240
  84.     @battleback_sprite.wave_speed = 120     
  85. end
  86. def empty
  87.    @battleback_sprite.bitmap =  $game_temp.background_bitmap
  88. end
  89. def create_battlefloor
  90.     if  $game_switches[BB_VXEDITION_SWITCH] == true
  91.     @battlefloor_sprite = Sprite.new(@viewport1)
  92.     @battlefloor_sprite.bitmap = Cache.system("BattleFloor")
  93.     @battlefloor_sprite.x = 0
  94.     @battlefloor_sprite.y = 192
  95.     @battlefloor_sprite.z = 1
  96.     @battlefloor_sprite.opacity = 128
  97.     else
  98.     @battlefloor_sprite = Sprite.new(@viewport1)
  99.     end
  100.   end
  101. end
复制代码
先新建个文件夹在Graphic名为Battlebacks,把战斗背景放进去~
再使用一个脚本语句:
  1. $game_system.bb = "战斗背景名称"
复制代码
就行了~~
作者: quanhome    时间: 2011-4-5 17:29
    source = "(Graphic/System/bb001.jpg)"

这样格式对吗?
作者: 烁灵    时间: 2011-4-5 17:31
回复 quanhome 的帖子

只要bb001.jpg就好了喵~
作者: dartlu    时间: 2011-4-9 09:37
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1