设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 94|回复: 0

[转载发布] Automatic Boat Call

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 前天 11:27 | 显示全部楼层 |阅读模式
    I updated your code for Ace if you don't mind so others can use it. It did make a few changes being a professional programmer. So here you go so you can post the update (please take all the credit given that it is your idea and original work). Good job by the way for VX.



                    Code:        
    module CallBoatConfig  # The item that must be in inventory for the boat to be called ITEM_ID = 147 # If this is set to "true", a map name must include this text: # # <boat> # # in order for the boat to be called automatically. USE_BOAT_REQ = true # If this is set to "true", an animation will play # when the player gets on or off the boat. USE_ANIMATION = true # The animation displayed when the player gets on the # boat if USE_ANIMATION is set to "true". ON_ANIMATION_ID = 75 # The animation displayed when the player gets off of the # boat if USE_ANIMATION is set to "true". OFF_ANIMATION_ID = 75 # If this is set to "true", the boat will # disappear when the player gets off of it. REMOVE_VEHICLE = true end  class Game_Vehicle attr_accessor :direction end  class Game_Map  alias :eds_pre_call_setup :setup def setup(map_id) eds_pre_call_setup(map_id) @info = load_data("Data/MapInfos.rvdata2") end  def can_use_boat? return true unless CallBoatConfig::USE_BOAT_REQ return @info[@map_id].name.downcase.include?("<boat>") end  end  class Game_Player < Game_Character include CallBoatConfig  def get_directional_pos(d) x, y = 0, 0;  case(d)          when 8 #up          y, x = @y - 1, @x;          when 2 #down          y, x = @y + 1, @x;          when 6 #right          x, y = @x + 1, @y;          y = @y          when 4 #left          x, y = @x - 1, @y; end return x, y; end def should_call_boat?(d)  x, y = get_directional_pos(d);  if ($game_map.can_use_boat? &&          $game_party.items.include?($data_items[ITEM_ID]) &&          $game_map.boat_passable?(x, y) &&          !@vehicle_getting_on &&          !in_boat?)          auto_call_boat(x, y);          return true; end  return false; end  def auto_call_boat(x, y) $game_map.boat.direction = $game_player.direction; $game_map.boat.set_location($game_map.map_id, x, y); if(USE_ANIMATION)          $game_map.boat.animation_id = ON_ANIMATION_ID end get_on_vehicle end #-------------------------------------------------------------------------- # * Move Up #-------------------------------------------------------------------------- alias _move_straight move_straight def move_straight(d, turn_ok = true)          _move_straight(d, turn_ok) unless should_call_boat?(d); end #-------------------------------------------------------------------------- # * Move Right #-------------------------------------------------------------------------- alias _move_diagonal move_diagonal def move_diagonal(d, turn_ok = true) _move_diagonal(d, turn_ok) unless should_call_boat?(d); end  #-------------------------------------------------------------------------- # * Get Off Vehicle #-------------------------------------------------------------------------- alias _get_off_vehicle get_off_vehicle def get_off_vehicle in_boat = (@vehicle_type == 0); _get_off_vehicle(); if REMOVE_VEHICLE          $game_map.boat.set_location(-1, -1, -1)          if USE_ANIMATION          $game_map.boat.animation_id = 75;          end end end  end




    本贴来自国际rpgmaker官方论坛作者:RCS_2012处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/automatic-boat-call.606/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 02:09 , Processed in 0.119231 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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