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

Project1

 找回密码
 注册会员
搜索
查看: 625348841|回复: 21

[RMVA发布] VX移植到VA上的灯光脚本。

[复制链接]

Lv1.梦旅人

梦石
0
星屑
140
在线时间
345 小时
注册时间
2009-5-15
帖子
111
发表于 2012-12-14 11:31:52 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 dujian15 于 2012-12-14 11:35 编辑

脚本初学者,目前在研究脚本移植。

献上灯光脚本一个,这个脚本的功能是。

在地图中定义一个事件,在事件中填加相应的注释,这个事件便可以发光。
可以通过开关关闭光源。

但目前还存在几个问题,最好请大神重新修正发布。

1.光源对焦不准,需要在游戏中自行调整。
2.代码为LIGHT的光源还有bug

如果需要使用这个光源脚本,需要在picture文下夹下建议一个LE.png的图片,图片即是光晕的造型。

奉上两张效果图

工程限于网速原因,回家再上传。


up1.jpg up2.jpg

  1. #==============================================================================
  2. # ■ 灯光脚本 for VA 版本1.0.0
  3. #     12.14.2012
  4. #------------------------------------------------------------------------------
  5. #  脚本修改: dujian15
  6. #  脚本制作: Kylock (For XP 版本 by Near Fantastica)
  7. #==============================================================================


  8. # ■ 灯光脚本 for VX 版本1.1.1
  9. #     5.21.2008
  10. #------------------------------------------------------------------------------
  11. #  脚本制作: Kylock (For XP 版本 by Near Fantastica)
  12. #==============================================================================
  13. #   如果您想要启用脚本,请在需要灯光效果的事件添加一个注释.
  14. #   打开开关将禁用灯光效果,启用效果前会检查开关,如果已经添加注释但是开关开启,那么将会停止效果.
  15. #   译者的话:因为发现脚本有一些问题,所以是有改动过的,如果改的不对,请M我QQ或者留言.谢谢
  16. #
  17. #==============================================================================
  18. # ● 更新日志
  19. #------------------------------------------------------------------------------
  20. # 1.0 - 建立最初版本
  21. # 1.1 - 添加了新的效果: LIGHT2, TORCH, TORCH2
  22. #      - 更改了混合模式(使其看起来更好)
  23. #      - 对FIRE效果增加了红色
  24. # 1.1.1 -非官方更新
  25. #         -解决了效果FIRE 与 TORCH 效果当开关打开时没有消失的问题
  26. #         -简便了开关判断
  27. #==============================================================================
  28. # ● 支持的效果(您可以添加的注释)
  29. #------------------------------------------------------------------------------
  30. #   GROUND - 中等稳定的白光.
  31. #   FIRE   - 伴有轻微的闪烁的红色.
  32. #   LIGHT  - 小型稳定的白光.
  33. #   LIGHT2 -大型稳定的白光.
  34. #   TORCH  - 伴有强烈闪烁的大型稳定的红光.
  35. #   TORCH2 - 伴有中等烁的大型稳定的红光.
  36. #==============================================================================

  37.   $lsig = 1           #开关号


  38. class Spriteset_Map
  39.   alias les_spriteset_map_initalize initialize
  40.   alias les_spriteset_map_dispose dispose
  41.   alias les_spriteset_map_update update
  42.   def initialize
  43.     @light_effects = []
  44.     setup_lights
  45.     les_spriteset_map_initalize
  46.     update
  47.   end
  48.   def dispose
  49.     les_spriteset_map_dispose
  50.     for effect in @light_effects
  51.       effect.light.dispose
  52.     end
  53.     @light_effects = []
  54.   end
  55.   def update
  56.     les_spriteset_map_update
  57.     update_light_effects
  58.   end
  59.   def setup_lights
  60.     for event in $game_map.events.values
  61.       next if event.list == nil
  62.       for i in 0...event.list.size
  63.         if event.list[i].code == 108 and event.list[i].parameters == ["GROUND"]
  64.           type = "GROUND"
  65.           light_effects = Light_Effect.new(event,type)
  66.           light_effects.light.zoom_x = 2
  67.           light_effects.light.zoom_y = 2
  68.           light_effects.light.opacity = 100
  69.           @light_effects.push(light_effects)
  70.         end
  71.         if event.list[i].code == 108 and event.list[i].parameters == ["FIRE"]
  72.           type = "FIRE"
  73.           light_effects = Light_Effect.new(event,type)
  74.           light_effects.light.zoom_x = 300 / 100.0
  75.           light_effects.light.zoom_y = 300 / 100.0
  76.           light_effects.light.opacity = 100
  77.           @light_effects.push(light_effects)
  78.         end
  79.         if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT"]
  80.           type = "LIGHT"
  81.           light_effects = Light_Effect.new(event,type)
  82.           light_effects.light.zoom_x = 1
  83.           light_effects.light.zoom_y = 1
  84.           light_effects.light.opacity = 150
  85.           @light_effects.push(light_effects)
  86.         end
  87.         if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT2"]
  88.           type = "LIGHT2"
  89.           light_effects = Light_Effect.new(event,type)
  90.           light_effects.light.zoom_x = 6
  91.           light_effects.light.zoom_y = 6
  92.           light_effects.light.opacity = 150
  93.           @light_effects.push(light_effects)
  94.         end
  95.         if event.list[i].code == 108 and event.list[i].parameters == ["TORCH"]
  96.           type = "TORCH"
  97.           light_effects = Light_Effect.new(event,type)
  98.           light_effects.light.zoom_x = 6
  99.           light_effects.light.zoom_y = 6
  100.           light_effects.light.opacity = 150
  101.           @light_effects.push(light_effects)
  102.         end
  103.         if event.list[i].code == 108 and event.list[i].parameters == ["TORCH2"]
  104.           type = "TORCH2"
  105.           light_effects = Light_Effect.new(event,type)
  106.           light_effects.light.zoom_x = 6
  107.           light_effects.light.zoom_y = 6
  108.           light_effects.light.opacity = 150
  109.           @light_effects.push(light_effects)
  110.         end
  111.       end
  112.     end
  113.     for effect in @light_effects
  114.       case effect.type
  115.       when "GROUND"
  116.         effect.light.x = (effect.event.screen_x * 8 - 400 - $game_map.display_x) / 8 - 8
  117.         effect.light.y = (effect.event.screen_y * 8 - 400 - $game_map.display_y) / 8 - 36
  118.         effect.light.blend_type = 1
  119.       when "FIRE"
  120.         effect.light.x = (effect.event.screen_x * 8 - 600 - $game_map.display_x) / 8 + rand(6) - 3 - 16
  121.         effect.light.y = (effect.event.screen_y * 8 - 600 - $game_map.display_y) / 8 + rand(6) - 3 - 48
  122.         effect.light.tone = Tone.new(255,-100,-255,   0)
  123.         effect.light.blend_type = 1
  124.       when "LIGHT"
  125.         effect.light.x = (effect.event.screen_x * 8 - 400 - $game_map.display_x) / 8
  126.         effect.light.y = (effect.event.screen_y * 8 - 400 - $game_map.display_y) / 8
  127.         effect.light.blend_type = 1
  128.       when "LIGHT2"
  129.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20
  130.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8
  131.         effect.light.blend_type = 1
  132.       when "TORCH"
  133.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20
  134.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8
  135.         effect.light.tone = Tone.new(255,-100,-255,   0)
  136.         effect.light.blend_type = 1
  137.       when "TORCH2"
  138.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20
  139.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8
  140.         effect.light.tone = Tone.new(255,-100,-255,   0)
  141.         effect.light.blend_type = 1
  142.       end
  143.     end
  144.   end
  145.   def update_light_effects
  146.     if $game_switches[$lsig]
  147.       for effect in @light_effects
  148.         effect.light.visible = false
  149.       end
  150.     else
  151.       for effect in @light_effects

  152.         effect.light.visible = true
  153.       end
  154.     end
  155.     for effect in @light_effects
  156.       case effect.type
  157.       when "GROUND"
  158.         effect.light.x = (effect.event.screen_x * 8 - 400 - $game_map.display_x) / 8 - 8
  159.         effect.light.y = (effect.event.screen_y * 8 - 400 - $game_map.display_y) / 8 - 36
  160.       when "FIRE"
  161.         effect.light.x = (effect.event.screen_x * 8 - 600 - $game_map.display_x) / 8 + rand(6) - 3 - 16
  162.         effect.light.y = (effect.event.screen_y * 8 - 600 - $game_map.display_y) / 8 + rand(6) - 3 - 48
  163.         effect.light.opacity = rand(10) + 90
  164.       when "LIGHT"
  165.         effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
  166.         effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
  167.       when "LIGHT2"
  168.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20
  169.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8
  170.       when "TORCH"
  171.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
  172.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8 + rand(20) - 10
  173.         effect.light.opacity = rand(30) + 70
  174.       when "TORCH2"
  175.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20
  176.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8
  177.         effect.light.opacity = rand(10) + 90
  178.       end
  179.     end
  180.   end
  181. end

  182. class Light_Effect
  183.   attr_accessor :light
  184.   attr_accessor :event
  185.   attr_accessor :type
  186.   def initialize(event, type)
  187.     [url=home.php?mod=space&uid=22469]@light[/url] = Sprite.new
  188.     @light.bitmap = Cache.picture("le.png")
  189.     @light.visible = true
  190.     @light.z = 1000
  191.     @event = event
  192.     @type = type
  193.   end
  194. end
复制代码

评分

参与人数 4星屑 +105 收起 理由
库拉托斯 + 1 塞糖
alann + 12 我很赞同
feizhaodan + 80 鼓励
Mic_洛洛 + 12 塞糖

查看全部评分

敌人自动排列系统    1/1
技能类型着色   1/1
物品着色     0/1
仿网游强化系统    0/1

Lv3.寻梦者

梦石
0
星屑
1251
在线时间
423 小时
注册时间
2011-6-30
帖子
497
发表于 2012-12-14 11:43:53 | 显示全部楼层
想要VX原版的,可以一并发上来吗?

点评

自己去查  发表于 2012-12-14 12:49
点这里给我发邮件
有事欢迎给我发邮件哟~~
不出意外的话都会回复的哟~~~
邮箱:[email protected]
个人主页:curatorjin.github.io
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
2
星屑
5550
在线时间
2566 小时
注册时间
2012-2-9
帖子
990

开拓者

发表于 2012-12-14 13:07:13 | 显示全部楼层
楼主强大~~~~~
但是,我可以说一下,其实,这个功能的脚本已经有了么有了么……{:2_264:}
哇哇,即va真,烛光脚本,还是个繁体的帖子。
回复 支持 反对

使用道具 举报

Lv2.观梦者

故九江太守

梦石
0
星屑
366
在线时间
2127 小时
注册时间
2012-12-5
帖子
4440
发表于 2012-12-14 13:13:27 | 显示全部楼层
有没有xp的
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
140
在线时间
345 小时
注册时间
2009-5-15
帖子
111
 楼主| 发表于 2012-12-14 14:07:36 | 显示全部楼层
你最珍贵 发表于 2012-12-14 13:13
有没有xp的

原作者的信息我已经在代码里给出了,呵呵,善用搜索,世界会很美好。

点评

搜不到呢。。  发表于 2012-12-14 18:26
敌人自动排列系统    1/1
技能类型着色   1/1
物品着色     0/1
仿网游强化系统    0/1
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
140
在线时间
345 小时
注册时间
2009-5-15
帖子
111
 楼主| 发表于 2012-12-14 14:07:51 | 显示全部楼层
0newing 发表于 2012-12-14 11:43
想要VX原版的,可以一并发上来吗?

原作者的信息我已经在代码里给出了,呵呵,善用搜索,世界会很美好。
敌人自动排列系统    1/1
技能类型着色   1/1
物品着色     0/1
仿网游强化系统    0/1
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
123 小时
注册时间
2012-6-5
帖子
109
发表于 2012-12-14 14:54:24 | 显示全部楼层
有XP的吗?谢谢!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
94
在线时间
191 小时
注册时间
2011-10-12
帖子
320
发表于 2012-12-15 13:27:04 | 显示全部楼层
加了这个脚本 一进入游戏就错误报告....

点评

报错是论坛代码处理造成的,第 195行改成 @light = Sprite.new 就正常了。  发表于 2012-12-21 14:39
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
68
在线时间
931 小时
注册时间
2009-5-25
帖子
430

开拓者

发表于 2012-12-21 10:28:08 | 显示全部楼层
哎呀呀,终于有人移植这个了……
之前的烛光系统都只是跟着主角走的亮光
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1600
在线时间
46 小时
注册时间
2010-6-22
帖子
2
发表于 2012-12-27 16:20:33 | 显示全部楼层
完全没效果耶.... 也有光晕图 也有在事件设注释  怎就是没效果?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-18 12:52

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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