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

Project1

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

[已经解决] 如何显示任务完成

[复制链接]

Lv2.观梦者

梦石
0
星屑
339
在线时间
29 小时
注册时间
2019-9-7
帖子
11
跳转到指定楼层
1
发表于 2019-9-30 20:53:07 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
就像魔兽世界一样,我和NPC对话,给我任务,完成后给任务的NPC头上会有感叹号

Lv3.寻梦者

梦石
0
星屑
4828
在线时间
1355 小时
注册时间
2015-7-25
帖子
544

开拓者

2
发表于 2019-9-30 23:32:51 | 只看该作者
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ NPC头顶上显示图片(动态版) by 魔法丶小肉包
  4. #------------------------------------------------------------------------------
  5. # 说明:在指定NPC头上显示图片(自定义图片)
  6. #
  7. # 使用方法:
  8. # 事件-脚本 show_npc_icon 在本事件头上显示一次
  9. # 事件-脚本 show_npc_icon(2) 在2号事件头上显示一次
  10. # 如需一直显示,事件设定并行处理
  11. #
  12. # 素材名:SHOW 素材规格:256*32 分为8列,每一小格32*32(详细请参考心情图标的素材)
  13. #------------------------------------------------------------------------------
  14. # 更新日志:
  15. # 2019.9.30 公开发布
  16. #==============================================================================
  17. class Sprite_Character < Sprite_Base
  18.   attr_accessor :character
  19.   def initialize(viewport, character = nil)
  20.     super(viewport)
  21.     @character = character
  22.     @balloon_duration = 0
  23.     @show_duration = 0
  24.     update
  25.   end
  26.   def dispose
  27.     end_animation
  28.     end_balloon
  29.     end_show
  30.     super
  31.   end
  32.   def update
  33.     super
  34.     update_bitmap
  35.     update_src_rect
  36.     update_position
  37.     update_other
  38.     update_balloon
  39.     update_show
  40.     setup_new_effect
  41.   end
  42.   def setup_new_effect
  43.     if !animation? && @character.animation_id > 0
  44.       animation = $data_animations[@character.animation_id]
  45.       start_animation(animation)
  46.     end
  47.     if !@balloon_sprite && @character.balloon_id > 0
  48.       @balloon_id = @character.balloon_id
  49.       start_balloon
  50.     end
  51.     if !@show_sprite && @character.show_id > 0
  52.       @show_id = @character.show_id
  53.       start_show
  54.     end
  55.   end
  56.   def start_show
  57.     dispose_show
  58.     @show_duration = 8 * show_speed + show_wait
  59.     @show_sprite = ::Sprite.new(viewport)
  60.     @show_sprite.bitmap = Cache.system("SHOW")
  61.     @show_sprite.ox = 16
  62.     @show_sprite.oy = 32
  63.     update_show
  64.   end
  65.   def dispose_show
  66.     if @show_sprite
  67.       @show_sprite.dispose
  68.       @show_sprite = nil
  69.     end
  70.   end
  71.   def update_show
  72.     if @show_duration > 0
  73.       @show_duration -= 1
  74.       if @show_duration > 0
  75.         @show_sprite.x = x
  76.         @show_sprite.y = y - height
  77.         @show_sprite.z = z + 200
  78.         sx = show_frame_index * 32
  79.         sy = (@show_id - 1) * 32
  80.         @show_sprite.src_rect.set(sx, sy, 32, 32)
  81.       else
  82.         end_show
  83.       end
  84.     end
  85.   end
  86.   def end_show
  87.     dispose_show
  88.     @character.show_id = 0
  89.   end
  90.   def show_speed
  91.     return 8
  92.   end
  93.   def show_wait
  94.     return 12
  95.   end
  96.   def show_frame_index
  97.     return 7 - [(@show_duration - show_wait) / show_speed, 0].max
  98.   end
  99. end
  100. class Game_CharacterBase
  101.    attr_accessor :show_id
  102.    alias minit_public_members init_public_members
  103.    def init_public_members
  104.      minit_public_members
  105.      @show_id = 0
  106.    end
  107. end
  108. class Game_Interpreter
  109.   def show_npc_icon(id = 0)
  110.     return unless get_character(id)
  111.     get_character(id).show_id = 1
  112.   end
  113. end

点评

麻烦了  发表于 2019-10-1 12:26
emmmm,我没说清楚是我的错,想请教的是开关开启后会报错,看了简介后不知道怎么单独拿惊讶心情图,能给个嘛  发表于 2019-10-1 12:25
记得把图片素材准备好,放在Graphics/System文件夹里  发表于 2019-10-1 12:16
在任务完成后根据上面写的使用方法去设置即可  发表于 2019-10-1 12:10
emmmm,萌新不知道怎么用,能教教吗  发表于 2019-10-1 07:31

评分

参与人数 1星屑 +40 收起 理由
VIPArcher + 40 认可答案

查看全部评分

目前的坑 幽灵契约外传:歌莉娅
回归持续更新中~ 进度 v0.22/v1.00
笨肉包开始学像素画啦!努力训练中XD
啊~今天也是填mo坑yu的一天呢!
这是属于笨肉包一个人的旅行~(再见了...蚊子湯,七重酱,笨肉包永远想你们!TwT

看!是肉包!
只能看!不能吃!
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4828
在线时间
1355 小时
注册时间
2015-7-25
帖子
544

开拓者

3
发表于 2019-10-1 12:36:44 | 只看该作者

点评

会了会了,感谢dalao!  发表于 2019-10-1 15:25
你可以在任务完成后打开一个开关,然后创建一个新事件,出现条件这个开关开启时,并行处理,事件脚本show_npc_icon(NPC事件ID)  发表于 2019-10-1 14:14
能详细点吗  发表于 2019-10-1 13:28
最后一个问题,请问怎么操作?  发表于 2019-10-1 13:27
你用独立开关另起一页并行处理这个脚本  发表于 2019-10-1 12:52
目前的坑 幽灵契约外传:歌莉娅
回归持续更新中~ 进度 v0.22/v1.00
笨肉包开始学像素画啦!努力训练中XD
啊~今天也是填mo坑yu的一天呢!
这是属于笨肉包一个人的旅行~(再见了...蚊子湯,七重酱,笨肉包永远想你们!TwT

看!是肉包!
只能看!不能吃!
回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 05:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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