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

Project1

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

[已经解决] 求个锁定飞艇的脚本。。。

[复制链接]

Lv2.观梦者

梦石
0
星屑
582
在线时间
310 小时
注册时间
2016-2-29
帖子
210
跳转到指定楼层
1
发表于 2017-4-6 08:18:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
当人物乘上飞艇时,除非某开关打开,否则就永远下不来。
(因为我是通过事件脚本来控制人物移动的,某些转换场景的时候总是自动下乘,并找不到飞艇了...)

Lv3.寻梦者

梦石
0
星屑
4813
在线时间
1353 小时
注册时间
2015-7-25
帖子
542

开拓者

2
发表于 2017-4-6 11:57:24 | 只看该作者
如果是飞艇的话,1号开关打开才可以降落
RUBY 代码复制
  1. class Game_Vehicle < Game_Character
  2.   def land_ok?(x, y, d)
  3.     if @type == :airship
  4.       return false unless $game_map.airship_land_ok?(x, y)
  5.       return false unless $game_map.events_xy(x, y).empty?
  6.       return false unless $game_switches[1]
  7.     else
  8.       x2 = $game_map.round_x_with_direction(x, d)
  9.       y2 = $game_map.round_y_with_direction(y, d)
  10.       return false unless $game_map.valid?(x2, y2)
  11.       return false unless $game_map.passable?(x2, y2, reverse_dir(d))
  12.       return false if collide_with_characters?(x2, y2)
  13.     end
  14.     return true
  15.   end
  16. end

评分

参与人数 2星屑 +15 梦石 +1 收起 理由
RaidenInfinity + 1 认可答案
是猪别乱叫 + 15 认可答案

查看全部评分

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

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
64
在线时间
19 小时
注册时间
2010-6-29
帖子
3
3
发表于 2024-4-15 23:19:15 | 只看该作者
我也弄了个飞艇呼叫器。

  1. class Game_Interpreter
  2.   def 放下载具(type = '小舟')
  3.     x = $game_map.round_x_with_direction($game_player.x, $game_player.direction)
  4.     y = $game_map.round_y_with_direction($game_player.y, $game_player.direction)
  5.     if type == '小舟' && $game_map.boat_passable?(x, y)
  6.       vehicle = $game_map.vehicles[0]
  7.       vehicle.set_location($game_map.map_id, x, y) if vehicle
  8.       true
  9.     elsif type == '大船' && $game_map.ship_passable?(x, y)
  10.       vehicle = $game_map.vehicles[1]
  11.       vehicle.set_location($game_map.map_id, x, y) if vehicle
  12.       true
  13.       elsif type == '飞艇' && $game_map.airship_land_ok?(x, y)
  14.       vehicle = $game_map.vehicles[2]
  15.       vehicle.set_location($game_map.map_id, x, y) if vehicle
  16.       true
  17.     else false end
  18.   end
  19. end
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-30 02:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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