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

Project1

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

[已经解决] 如何用 事件脚本做 每1分钟 获得一个道具

[复制链接]

Lv1.梦旅人

尽头

梦石
0
星屑
119
在线时间
278 小时
注册时间
2010-6-20
帖子
1280
1
发表于 2012-12-9 16:13:17 | 显示全部楼层
  1. # 获得的物品的ID号
  2. # 由游戏变量【20】号的值决定

  3. VarItemID       = 20


  4. # 获得的物品的时间间隔(单位秒)
  5. # 由游戏变量【21】号的值决定

  6. VarDurationTime = 21


  7. class Scene_Base
  8.   alias auto_gain_item_scene_base_update update
  9.   def update
  10.     auto_gain_item_scene_base_update
  11.     auto_gain_item
  12.   end
  13.   def auto_gain_item
  14.     duration_time = $game_variables[VarDurationTime]
  15.     @dtcounter  ||= 0
  16.     if (@dtcounter += 1) > duration_time
  17.       @dtcounter -= duration_time
  18.       item_id = $game_variables[VarItemID]
  19.       $game_party.gain_item($data_item[item_id], 1)
  20.     end
  21.   end
  22. end
复制代码
临时写了给你,复制到脚本编辑器里就行了(Scene_Base之后 Main之前)
你所说的泡点物品的ID,在游戏变量20号设置就行了
时间间隔,设置21号变量, 单位秒

点评

有两个问题,Scene_Title和Scene_Load等时数据未初始化,不能使用开关,还有就是切换场景时计时会被重置...  发表于 2012-12-9 16:48
无法运行 def initialize @pictures = Game_Pictures.new clear end  发表于 2012-12-9 16:26
未测试,有什么问题消息我吧(>﹏<)  发表于 2012-12-9 16:14
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 13:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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