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

Project1

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

[已经解决] 如何在地图事件上停止脚本?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
74
在线时间
31 小时
注册时间
2010-7-31
帖子
30
跳转到指定楼层
1
发表于 2011-7-22 12:34:03 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
在脚本里已经设定了一种计算方式,能不能在事件上关闭脚本或者停止?

或者用另外一个脚本来替换原来的。要在事件上弄,好像上面有个脚本什么,我都没动过。。。
好吧,既然你们都那么厉害。。为了平衡。。我就弱些吧~~

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1702
在线时间
3038 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

2
发表于 2011-7-22 12:38:50 | 只看该作者
if $game_switches[A]
...
end
当A号开关打开以后才开始工作
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
74
在线时间
31 小时
注册时间
2010-7-31
帖子
30
3
 楼主| 发表于 2011-7-22 12:53:06 | 只看该作者
精灵使者 发表于 2011-7-22 12:38
if $game_switches[A]
...
end

好像不是这样。能不能具体点,我只是要用事件把脚本关掉或删掉
好吧,既然你们都那么厉害。。为了平衡。。我就弱些吧~~
回复

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1702
在线时间
3038 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

4
发表于 2011-7-22 13:02:27 | 只看该作者
本帖最后由 精灵使者 于 2011-7-22 13:02 编辑

把你的执行的部分写在那个条件分歧里面,A换成你需要的开关号——
只有那个开关号的开关打开的时候,才执行你的那个脚本
给我一下那个脚本是什么。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
74
在线时间
31 小时
注册时间
2010-7-31
帖子
30
5
 楼主| 发表于 2011-7-22 13:15:09 | 只看该作者
。。。。。复制上去的脚本好像都乱了。。。
好吧,既然你们都那么厉害。。为了平衡。。我就弱些吧~~
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
118 小时
注册时间
2011-7-13
帖子
182
6
发表于 2011-7-22 14:01:27 | 只看该作者
本帖最后由 南宫爱 于 2011-7-22 14:03 编辑

应该是在脚本编辑器里,把你的脚本写在if $game_switches[A]与end之间
就是:
  1. if $game_switches[A]
  2. XXX
  3. XXX
  4. XXX
  5. end
复制代码
���
然后关闭A开关,就可以达到效果
纯事件的怨念啊...
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
74
在线时间
31 小时
注册时间
2010-7-31
帖子
30
7
 楼主| 发表于 2011-7-22 14:25:25 | 只看该作者
南宫爱 发表于 2011-7-22 14:01
应该是在脚本编辑器里,把你的脚本写在if $game_switches[A]与end之间
就是:���
然后关闭A开关,就可以 ...

好像不行。。。。

点评

恩恩,找到了~  发表于 2011-7-22 14:53
= =(我看看)  发表于 2011-7-22 14:42
好吧,既然你们都那么厉害。。为了平衡。。我就弱些吧~~
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
118 小时
注册时间
2011-7-13
帖子
182
8
发表于 2011-7-22 14:56:39 | 只看该作者
本帖最后由 南宫爱 于 2011-7-22 14:57 编辑

就像是这样:(此为鼠标脚本的一段)是当按下单击(左键)的时候执行的。就把执行的内容用if $game_switches[A]...end 框起来。不能放在脚本开头,否则会出错= =,所以说,要找到执行的地方...把脚本发上来= =
  1. if Mouse.press?(Mouse::LEFT)
  2.       if $game_switches[3]
  3.       last_moving = moving?
  4.       last_direction = @direction
  5.       unless moving? or $game_system.map_interpreter.running? or
  6.              @move_route_forcing or $game_temp.message_window_showing
  7.         last_x = @x
  8.         if @last_move_x
  9.           @last_move_x = false
  10.         elsif mouse_x > screen_x + 16
  11.           move_right
  12.         elsif mouse_x < screen_x - 16
  13.           move_left
  14.         end
  15.         last_y = @y
  16.         if last_x != @x
  17.           @last_move_x = true
  18.         elsif mouse_y > screen_y
  19.           move_down
  20.         elsif mouse_y < screen_y - 32
  21.           move_up
  22.         end
  23.         if last_y != @y
  24.           @last_move_x = false
  25.         elsif not @last_move_x
  26.           case last_direction
  27.       when 2
  28.         move_down
  29.       when 4
  30.         move_left
  31.       when 6
  32.         move_right
  33.       when 8
  34.         move_up
  35.           end
  36.         end
  37.       end
  38.     end
  39.    end
复制代码
���
纯事件的怨念啊...
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
74
在线时间
31 小时
注册时间
2010-7-31
帖子
30
9
 楼主| 发表于 2011-7-23 13:57:43 | 只看该作者
南宫爱 发表于 2011-7-22 14:56
就像是这样:(此为鼠标脚本的一段)是当按下单击(左键)的时候执行的。就把执行的内容用if $game_switche ...
  1. class Window_MapVar < Window_Base
  2.   def initialize
  3.     super(0,420,160,60)
  4.     self.opacity=200
  5.     self.back_opacity=200
  6.     self.contents_opacity=255
  7.     self.contents = Bitmap.new(width - 32, height - 32)
  8.     @var_value_old = -1
  9.     @var_icon = Bitmap.new("Graphics/Icons/纳尼2")
  10.    
  11.     refresh
  12.   end
  13.   def refresh
  14.     if @var_value_old==$game_variables[1] then
  15.       return
  16.     end
  17.     self.contents.clear
  18.     cx = contents.text_size($data_system.words.gold).width
  19.     self.contents.font.color = Color.new(255,255,255)
  20.     self.contents.draw_text(24, 0, 104-cx, 28, $game_variables[1].to_s, 2)
  21.     self.contents.font.color = Color.new(255,255,0)
  22.     self.contents.draw_text(128-cx, 0, cx, 28, "无语")
  23.     self.contents.blt(0, 2, @var_icon, Rect.new(0, 0, 24, 24))
  24.   end
  25. end
复制代码
好吧,既然你们都那么厉害。。为了平衡。。我就弱些吧~~
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
118 小时
注册时间
2011-7-13
帖子
182
10
发表于 2011-7-23 15:29:13 | 只看该作者
本帖最后由 南宫爱 于 2011-7-23 15:39 编辑

这样子:(注意是def initialize下面)
  1. class Window_MapVar < Window_Base
  2.   def initialize
  3. if $game_switches[1]
  4.     super(0,420,160,60)
  5.     self.opacity=200
  6.     self.back_opacity=200
  7.     self.contents_opacity=255
  8.     self.contents = Bitmap.new(width - 32, height - 32)
  9.     @var_value_old = -1
  10.     @var_icon = Bitmap.new("Graphics/Icons/纳尼2")
  11.    
  12.     refresh
  13.   end
  14.   def refresh
  15.     if @var_value_old==$game_variables[1] then
  16.       return
  17.     end
  18.     self.contents.clear
  19.     cx = contents.text_size($data_system.words.gold).width
  20.     self.contents.font.color = Color.new(255,255,255)
  21.     self.contents.draw_text(24, 0, 104-cx, 28, $game_variables[1].to_s, 2)
  22.     self.contents.font.color = Color.new(255,255,0)
  23.     self.contents.draw_text(128-cx, 0, cx, 28, "无语")
  24.     self.contents.blt(0, 2, @var_icon, Rect.new(0, 0, 24, 24))
  25.     end
  26. end
  27. end
复制代码


南宫爱于2011-7-23 19:30补充以下内容:
18行!?怎么可能!?


南宫爱于2011-7-23 19:30补充以下内容:
18行!?怎么可能!?


南宫爱于2011-7-24 11:11补充以下内容:
不可能的说,你把错误的截图发过来

点评

不可能的说(你把错误的截图发过来)  发表于 2011-7-24 11:10
确定。。。。。就是18行的self.contents.clear 错误的  发表于 2011-7-24 11:06
你确定结尾只有3个“end”?  发表于 2011-7-23 19:38
!?  发表于 2011-7-23 19:28
为什么18行的会出错TT  发表于 2011-7-23 18:58
纯事件的怨念啊...
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-21 14:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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