| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2017-9-3 |
| 在线时间 | 101 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 101 小时
- 注册时间
- 2017-1-9
- 回帖
- 5
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 AZERAL 于 2017-4-19 17:04 编辑
虽然小弟我勉强能看懂F1帮助文档所有的脚本啦,但唯独制作传送物品这个脚本一直看不懂(如果大家有其他脚本入门实践篇的问题的话,我也能尽力解决啦 )
虽然本人对脚本不是太懂,可我已经尽力按照手册上的方法做了,但是还是没有成功实现传送物品的效果—在包含城镇等地点的菜单中选择任意地点之后选择物品进行传送一次
所以在这里希望各位大佬们能够帮帮忙,小弟在这里先谢谢啦
这是我写的传送物品的代码,也不知道对不对:
- class Window_Teleport < Window_Command
- def initialize
- super(0, 0)
- hide
- deactivate
- end
- end
- def window_width
- return 240
- end
- def window_height
- Graphics.height
- end
- TELEPORT_PLACES =
- [
- [2, "草地2", 2, 7, 7],
- [3, "草地3", 3, 7, 7],
- [4, "草地4", 4, 7, 7],
- ]
- def make_command_list
- TELEPORT_PLACES.each do |place|
- if $game_switches[place[0]]
- add_command(place[1], :teleport, true, place)
- end
- end
- end
- class Scene_ItemBase
- alias xxx001_start start
- def start
- xxx001_start
- @teleport_window = Window_Teleport.new
- @teleport_window.set_handler(:teleport, method(:on_teleport))
- @teleport_window.set_handler(:cancel, method(:on_teleport_cancel))
- end
- alias xxx001_determine_item determine_item
- def determine_item
- if item.note.include?("<TELEPORT>")
- show_sub_window(@teleport_window)
- end
- else
- xxx001_determine_item
- end
- end
- def on_teleport
- place = @teleport_window.current_ext
- $game_player.reserve_transfer(place[2], place[3], place[4])
- SceneManager.goto(Scene_Map)
- end
- def on_teleport_cancel
- hide_sub_window(@teleport_window)
- end
复制代码
下面是工程失败的截图以及我做的传送物品和技能的范例: |
-
失败的结果
-
-
1.zip
1.43 MB, 下载次数: 103
试验范例
|