赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 6012 |
最后登录 | 2016-7-28 |
在线时间 | 147 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 147 小时
- 注册时间
- 2013-12-2
- 帖子
- 132
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
按照这个脚本给的方法
get_allthing(99,1,true)
give_allthing(99,2)
按理说这里应该是保存现有背包的数据到背包1里面,然后清空,再加载第二背包的数据,可是执行之后会提示 $game_party.gain_item(i,itempack2)出错,可是也看不出哪里有错,第一背包是可以用的,按理说其余的背包用同样的脚本也应该没问题的才对 ……瞎了
- =begin
- ===============================================================================
- 多个背包函数脚本……(请原谅我的语文水平)
- 作者:512195574
- 调用方法:
- get_allthing(c,j,d)
- give_allthing(c,j)
- c:数参,取得物品上限,如果全部取得的话取数据库里的最大值就好了
- j:数参,背包名称,因为是第一版所以只做了三个,适用范围1~3
- d:布尔参,是否清空,true时可以在取得物品数据的同时清空取得的物品
- ===============================================================================
- =end
- def get_allthing(c,j,d)
- if j == 1
- @itempack1 = []
- @weaponpack1 = []
- @armorpack1 = []
- for i in 0..c
- @itempack1[i]=$game_party.item_number(i)
- @weaponpack1[i]=$game_party.weapon_number(i)
- @armorpack1[i]=$game_party.armor_number(i)
- end
- end
- if j == 2
- itempack2 = []
- weaponpack2 = []
- armorpack2 = []
- for i in 1..c
- itempack2[i]=$game_party.item_number(i)
- weaponpack2[i]=$game_party.weapon_number(i)
- armorpack2[i]=$game_party.armor_number(i)
- end
- end
- if j == 3
- itempack3 = []
- weaponpack3 = []
- armorpack3 = []
- for i in 0..c
- itempack3[i]=$game_party.item_number(i)
- weaponpack3[i]=$game_party.weapon_number(i)
- armorpack3[i]=$game_party.armor_number(i)
- end
- end
- if d == true
- for i in 0..c
- $game_party.gain_item(i,-99)
- $game_party.gain_weapon(i,-99)
- $game_party.gain_armor(i,-99)
- end
- end
- end
- def give_allthing(c,j)
- if j == 1
- for i in 0..c
- $game_party.gain_item(i,@itempack1[i])
- $game_party.gain_weapon(i,@weaponpack1[i])
- $game_party.gain_armor(i,@armorpack1[i])
- end
- end
- if j == 2
- for i in 0..c
- $game_party.gain_item(i,itempack2[i])
- $game_party.gain_weapon(i,weaponpack2[i])
- $game_party.gain_armor(i,armorpack2[i])
- end
- end
- if j == 3
- for i in 0..c
- $game_party.gain_item(i,itempack3[i])
- $game_party.gain_weapon(i,weaponpack3[i])
- $game_party.gain_armor(i,armorpack3[i])
- end
- end
- end
复制代码 脚本原帖:http://rpg.blue/forum.php?mod=viewthread&tid=314788 |
|