Project1

标题: 光影脚本用法! [打印本页]

作者: 冲啊小笼包    时间: 2014-7-22 17:39
标题: 光影脚本用法!
RT,光影脚本文件有了,用法也知道。
但是烛光会跟着角色动诶。求解,怎么样固定啊!
作者: 冲啊小笼包    时间: 2014-7-22 19:26
@喵呜喵5
https://rpg.blue/forum.php?mod=v ... 6005&highlight=灯光
作者: taroxd    时间: 2014-7-22 19:34
冲啊小笼包 发表于 2014-7-22 19:26
@喵呜喵5
https://rpg.blue/forum.php?mod=viewthread&tid=256005&highlight=灯光

请问,灯光跟随事件移动有什么问题吗?还是你只是想要画面上显示一个光效,类似于“显示图片”的效果?

如果是后者,你可以试试看 https://rpg.blue/thread-367901-1-1.html
添加 fix 的设置就可以了
作者: 冲啊小笼包    时间: 2014-7-22 20:00
taroxd 发表于 2014-7-22 19:34
请问,灯光跟随事件移动有什么问题吗?还是你只是想要画面上显示一个光效,类似于“显示图片”的效果?

...

不是。我设置了某个事件发光,但是主角移动,事件没动,但是光影却跟着主角走了=.=烛光那是。

我就是想做个烛光.显示图片的话貌似主角只要走到移动屏幕的地方也会跟着主角走了吧?
作者: taroxd    时间: 2014-7-22 20:09
本帖最后由 taroxd 于 2014-7-22 20:12 编辑
冲啊小笼包 发表于 2014-7-22 20:00
不是。我设置了某个事件发光,但是主角移动,事件没动,但是光影却跟着主角走了=.=烛光那是。

我就是想 ...


第162行开始是设置图片的位置

RUBY 代码复制
  1. for effect in @light_effects
  2.       case effect.type
  3.       when "GROUND"
  4.         effect.light.x = (effect.event.screen_x * 8 - 400 - $game_map.display_x) / 8 - 8
  5.         effect.light.y = (effect.event.screen_y * 8 - 400 - $game_map.display_y) / 8 - 36
  6.       when "FIRE"
  7.         effect.light.x = (effect.event.screen_x * 8 - 600 - $game_map.display_x) / 8 + rand(6) - 3 - 16
  8.         effect.light.y = (effect.event.screen_y * 8 - 600 - $game_map.display_y) / 8 + rand(6) - 3 - 48
  9.         effect.light.opacity = rand(10) + 90
  10.       when "LIGHT"
  11.         effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
  12.         effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
  13.       when "LIGHT2"
  14.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20
  15.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8
  16.       when "TORCH"
  17.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
  18.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8 + rand(20) - 10
  19.         effect.light.opacity = rand(30) + 70
  20.       when "TORCH2"
  21.         effect.light.x = (effect.event.screen_x * 8 - 1200 - $game_map.display_x) / 8 - 20
  22.         effect.light.y = (effect.event.screen_y * 8 - 1200 - $game_map.display_y) / 8
  23.         effect.light.opacity = rand(10) + 90
  24.       end
  25.     end


说实话,我没有范例以及素材什么的,因此不知道为什么会产生这样的状况。

你看一下你是使用哪一种类型的灯光?你可以自己改改坐标的算法试试看。

effect.event.screen_x 代表当前事件在画面上的x坐标。
$game_map.display_x 代表地图卷动的x值。x * 32 即为地图卷动的横坐标。

也许在计算的时候,不考虑 $game_map.display_x 就可以了?因为要让光影只和事件在画面上的位置有关嘛。总之你改改看吧。
作者: 冲啊小笼包    时间: 2014-7-22 20:22
taroxd 发表于 2014-7-22 20:09
第162行开始是设置图片的位置

    for effect in @light_effects

我研究看看,谢谢了
作者: 冲啊小笼包    时间: 2014-7-22 20:28


虽然位置不准确,不过可以调整。不怕。但是就是会这样
@taroxd
作者: taroxd    时间: 2014-7-22 20:32
冲啊小笼包 发表于 2014-7-22 20:28
虽然位置不准确,不过可以调整。不怕。但是就是会这样
@taroxd


不只要调x,还要调y

所有属性都与 x 对应
作者: tseyik    时间: 2014-7-22 20:47
本帖最后由 tseyik 于 2014-7-22 20:52 编辑

Character Effects
這個?

http://galvs-scripts.com/categor ... al-effects/#post-30
這個影子頗真實,會因光源改方向、也可多方向
作者: VIPArcher    时间: 2014-7-23 00:46
本帖最后由 VIPArcher 于 2014-7-23 00:50 编辑

我给你一个需要DLL的版本吧,效果很好,但是效率不保证。
效果图示

需要tktk_bitmap.dll以及工程内Pictures内的所有图片,(你也可以自己新建图片光效)

脚本范例工厂.zip

1.61 MB, 下载次数: 152






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