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

Project1

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

关于开关的设置

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
4 小时
注册时间
2008-9-8
帖子
53
跳转到指定楼层
1
发表于 2008-9-29 05:46:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
比如原创区的烛光脚本把 我想加上一句,只有某个开关(比如0005号开关)脚本才能触发,应该怎么写呢?
版务信息:本贴由楼主自主结贴~

Lv2.观梦者

天仙

梦石
0
星屑
640
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

2
发表于 2008-9-29 06:36:01 | 只看该作者
那个烛光系统?
如果是我那个
应该本来就有设置这个功能
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

  31.   $lsig = 1           #开关号


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

  146.         effect.light.visible = true
  147.       end
  148.     end
  149.     for effect in @light_effects
  150.       case effect.type
  151.       when "GROUND"
  152.         effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
  153.         effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
  154.       when "FIRE"
  155.         effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
  156.         effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
  157.         effect.light.opacity = rand(10) + 90
  158.       when "LIGHT"
  159.         effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
  160.         effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
  161.       when "LIGHT2"
  162.         effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
  163.         effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
  164.       when "TORCH"
  165.         effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
  166.         effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 + rand(20) - 10
  167.         effect.light.opacity = rand(30) + 70
  168.       when "TORCH2"
  169.         effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
  170.         effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
  171.         effect.light.opacity = rand(10) + 90
  172.       end
  173.     end
  174.   end
  175. end

  176. class Light_Effect
  177.   attr_accessor :light
  178.   attr_accessor :event
  179.   attr_accessor :type
  180.   def initialize(event, type)
  181.     @light = Sprite.new
  182.     @light.bitmap = Cache.picture("le.png")
  183.     @light.visible = true
  184.     @light.z = 1000
  185.     @event = event
  186.     @type = type
  187.   end
  188. end
复制代码



我把  $lsig = 1           #开关号 改成其他的但是实际使用时还是1开关管用,不知道为什么?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

小柯的徒弟

梦石
0
星屑
1500
在线时间
1157 小时
注册时间
2008-5-24
帖子
3085

贵宾

4
发表于 2008-9-29 08:32:50 | 只看该作者
把143行的if $game_switches[1]
1改掉……那个$lsig其实根本没用到……
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
4 小时
注册时间
2008-9-8
帖子
53
5
 楼主| 发表于 2008-9-29 09:51:08 | 只看该作者
谢谢,是这样的另外下面2行的false和true似乎也反了,效果是开关开了没灯光效果,关闭开关反而有效果!!嘿嘿 确认答案!再次感谢!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-23 02:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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