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

Project1

 找回密码
 注册会员
搜索
打印 上一主题 下一主题

某礼物系统脚本

 关闭 [复制链接]

Lv1.梦旅人

史上最强粉丝

梦石
0
星屑
50
在线时间
9 小时
注册时间
2007-8-20
帖子
5574

贵宾

21
发表于 2008-1-12 20:30:12 | 只看该作者
越前从物品图鉴入手吧~送出去的话只要物品分类下不让礼物显示在一般物品中,思路还是上面的。
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3452
在线时间
3630 小时
注册时间
2006-9-6
帖子
37402

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

22
 楼主| 发表于 2008-1-12 20:34:02 | 只看该作者
以下引用光郎于2008-1-12 12:30:12的发言:

越前从物品图鉴入手吧~送出去的话只要物品分类下不让礼物显示在一般物品中,思路还是上面的。

恩,
差不多就是一开始在物品里设置好代码然后显示。

问题是我又不会改脚本……{/hx}
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3452
在线时间
3630 小时
注册时间
2006-9-6
帖子
37402

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

23
 楼主| 发表于 2008-1-13 00:00:05 | 只看该作者
结果还是跟预料的一样……
回复 支持 反对

使用道具 举报

Lv2.观梦者

傻♂逼

梦石
0
星屑
374
在线时间
1606 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

24
发表于 2008-1-13 00:01:37 | 只看该作者
我帮你做,这个帖子接了!{/dy}
哎呀,蛋疼什么的最有爱了
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-24
帖子
106
25
发表于 2008-1-13 00:41:24 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

史上最强粉丝

梦石
0
星屑
50
在线时间
9 小时
注册时间
2007-8-20
帖子
5574

贵宾

26
发表于 2008-1-13 01:11:16 | 只看该作者
手机不能写脚本嘛…不然就直接帮忙了。
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3452
在线时间
3630 小时
注册时间
2006-9-6
帖子
37402

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

27
 楼主| 发表于 2008-1-13 01:49:16 | 只看该作者
突然有这么多人帮我真是感动啊……{/hx}
回复 支持 反对

使用道具 举报

Lv2.观梦者

傻♂逼

梦石
0
星屑
374
在线时间
1606 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

28
发表于 2008-1-13 21:50:51 | 只看该作者
做出来了,不过八成大概因该,脚本没人看的懂(窗口),太乱了(没注解)防盗
OK了
http://rpg.blue/upload_program/files/礼物_80660741.rar
注意NPC的事件那里在$scene = Scene_Pr.new
后面必须等待20针以上,否则。。。
自己试吧~~
----------------------------

$item=
[
1,2,3,4,5,6,
7,8,9,10,9,9,
9,9,9,9,9,9,
9,9,9,9,9,9,
]
设置穿口中每种图标代表的物品
哎呀,蛋疼什么的最有爱了
回复 支持 反对

使用道具 举报

Lv2.观梦者

傻♂逼

梦石
0
星屑
374
在线时间
1606 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

29
发表于 2008-1-13 21:51:22 | 只看该作者
没有就带灰色调显示。
恩,没素材
哎呀,蛋疼什么的最有爱了
回复 支持 反对

使用道具 举报

Lv2.观梦者

傻♂逼

梦石
0
星屑
374
在线时间
1606 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

30
发表于 2008-1-13 22:06:46 | 只看该作者
发现问题!!!!
用以下脚本替换“窗口”,把图标改成了物品图标
使用色调实现灰色
  1. $item=
  2. [
  3. 1,2,3,4,5,6,
  4. 7,8,9,15,9,9,
  5. 9,9,9,9,9,9,
  6. 9,9,9,9,9,9
  7. ]
  8. class Window_Pr < Window_Base
  9.   attr_accessor :index             # index
  10.   attr_accessor :hindex             # index
  11.   attr_accessor :hh             # index
  12.   def initialize #一行6个 4 行
  13.     super(160, 300, 7 * 32, 5 * 32)
  14.     self.contents = Bitmap.new(width - 32, height - 32)
  15. #    self.index = 0
  16. @index = 0
  17. @hindex = 0
  18. @hh = 0
  19.     @pic = []
  20.     x = 16
  21.     y = 1
  22.            x = 16
  23.        y = 1
  24.        @pic = nil
  25.         @pic = []
  26.             for i in 1..24
  27.      if i % 6 == 1
  28.         y += 32
  29.         x = 16
  30.       end
  31.       @pic[i-1] = Sprite.new
  32.       @pic[i-1].x = x + 160
  33.       @pic[i-1].y = y + 300 - 16
  34.       @pic[i-1].z = 9999 * i
  35.       if $game_party.item_number($item[i]) >= 1  
  36.       @pic[i-1].bitmap = RPG::Cache.icon($data_items[$item[i-1].to_i].icon_name)
  37.     #  @pic[i-1].bitmap.hue_change(0)
  38.     else
  39.       if $data_items[$item[i-1].to_i] == nil
  40.         @pic[i-1].bitmap = RPG::Cache.icon("037-Item06")
  41.         else
  42.       @pic[i-1].bitmap = RPG::Cache.icon($data_items[$item[i-1].to_i].icon_name)
  43.       end
  44.       @pic[i-1].tone.set(0, 0, 0, 255) # = RPG::Cache.icon("037-Item06")
  45.       
  46.       end
  47.       x += 32
  48. #      refresh
  49.     end

  50.      refresh
  51.   end
  52.       def refresh
  53.        self.cursor_rect.set(got_x(@hindex) - 18,got_y(@hh)-5,32, 32)
  54.     end
  55. def got_x(hindex)
  56.   x = 16
  57.   x += hindex * 32
  58.   return x
  59. end
  60. def got_y(hh)
  61. y = 1
  62. y += hh * 32
  63. return y
  64. end

  65.   def update
  66.     super
  67.     if Input.repeat?(Input::UP)
  68.       go_up
  69.     end
  70.     if Input.repeat?(Input::DOWN)
  71.       go_down
  72.     end
  73.     if Input.repeat?(Input::LEFT)
  74.       go_left
  75.     end
  76.     if Input.repeat?(Input::RIGHT)
  77.       go_right
  78.     end
  79.   end
  80.   def go_up
  81.     if @hh == 0
  82.       @hh = 3
  83.       @index += 18
  84.     else
  85.       @index -= 6
  86.       @hh -= 1
  87.     end
  88.     refresh
  89.   end

  90.   def go_down
  91.     if @hh == 3
  92.       @hh = 0
  93.       @index -= 18
  94.     else
  95.       @hh += 1
  96.       @index += 6
  97.     end
  98.     refresh
  99.   end
  100.   def go_left
  101.     if @hindex == 0
  102.       @hindex = 5
  103.       @index += 5
  104.     else
  105.       @hindex -= 1
  106.       @index -= 1
  107.     end
  108.     refresh
  109.   end
  110.   def go_right
  111.     if @hindex == 5
  112.       @hindex = 0
  113.       @index -= 5
  114.     else
  115.       @hindex += 1
  116.       @index += 1
  117.     end
  118.     refresh
  119.   end
  120.   def pic_cont
  121.     for i in 1..24
  122.       @pic[i-1].bitmap.dispose
  123.       @pic[i-1].dispose
  124.     end
  125.     @pic = []
  126.       @pic = nil
  127.   end
  128. end
复制代码
哎呀,蛋疼什么的最有爱了
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-27 12:30

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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