查看: 2377|回复: 7

[已经解决] 请问脚本到底怎么插啊按某个键然后主角加速走那个脚本

[复制链接]
梦石
0
星屑
50
在线时间
1 小时
注册时间
2017-7-30
回帖
4
发表于 2017-7-30 17:11:43 | 显示全部楼层 |阅读模式

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

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

×
如题 插入脚本之后就总是报错……
总是说26行出typeerror undefined superclass'Game_Character'这样

点评

一般来说,可以作插件使用的脚本都是插入到Main上面。要是有相同的脚本,是用的下面的脚本,上面的会无效。  发表于 2017-7-30 17:16
梦石
0
星屑
50
在线时间
1 小时
注册时间
2017-7-30
回帖
4
 楼主| 发表于 2017-7-30 17:15:44 | 显示全部楼层
我现在就是不懂是脚本问题还是我插脚本的方式不对orz脚本是之前在论坛看到大佬写的……所以应该是我不会用脚本的原因quq
回复

使用道具 举报

梦石
0
星屑
50
在线时间
1 小时
注册时间
2017-7-30
回帖
4
 楼主| 发表于 2017-7-30 17:18:12 | 显示全部楼层
哦哦所以应该插入到main的最上面吗
回复

使用道具 举报

梦石
0
星屑
1626
在线时间
193 小时
注册时间
2016-10-22
回帖
80
发表于 2017-7-30 18:59:17 | 显示全部楼层
插在main后面,然后这是空格加速
#==============================================================================
# □ カスタマイズポイント
#==============================================================================
module XRXS_Dash
#
# 按下加速键之后的速度増加量
#
PLUSPEED = 1
#
# 行走加速的按键
#
BUTTON = Input::C
end
#==============================================================================
# ■ Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias xrxs25_update update
def update
# 例外补正
if @move_speed_arcadia == nil
@move_speed_arcadia = @move_speed
end
# 移动中、イベント実行中、移动ルート强制中、
# メッセージウィンドウ表示中、
# ダッシュボタン挿下中、のいずれでもない场合
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# 速度の変更
if Input.press?(XRXS_Dash::BUTTON)
@move_speed = @move_speed_arcadia + XRXS_Dash::PLUSPEED
else
@move_speed = @move_speed_arcadia
end
end
# 呼び戻す
xrxs25_update
end
#--------------------------------------------------------------------------
# ○ 移动タイプ : カスタム [オーバーライド]
#--------------------------------------------------------------------------
def move_type_custom
# 例外补正
if @move_speed_arcadia == nil
@move_speed_arcadia = @move_speed
end
# 标准速度に戻す
@move_speed = @move_speed_arcadia
# 呼び戻す
super
# 速度の保存
@move_speed_arcadia = @move_speed
end
end

点评

!!哇!!真的可以  发表于 2019-12-22 21:32
回复

使用道具 举报

梦石
0
星屑
19426
在线时间
3082 小时
注册时间
2013-1-11
回帖
1207
发表于 2017-7-30 20:23:09 | 显示全部楼层

好像不用那么麻烦吧。。直接把VX的方法复制过来。。Shift加速

  1. class Game_Player < Game_Character
  2.   def update_move
  3.     # 移动速度转换为地图坐标系的移动距离
  4.     distance = 2 ** @move_speed
  5.     distance *= 2 if Input.press?(Input::SHIFT)
  6.     # 理论坐标在实际坐标下方的情况下
  7.     if @y * 128 > @real_y
  8.       # 向下移动
  9.       @real_y = [@real_y + distance, @y * 128].min
  10.     end
  11.     # 理论坐标在实际坐标左方的情况下
  12.     if @x * 128 < @real_x
  13.       # 向左移动
  14.       @real_x = [@real_x - distance, @x * 128].max
  15.     end
  16.     # 理论坐标在实际坐标右方的情况下
  17.     if @x * 128 > @real_x
  18.       # 向右移动
  19.       @real_x = [@real_x + distance, @x * 128].min
  20.     end
  21.     # 理论坐标在实际坐标上方的情况下
  22.     if @y * 128 < @real_y
  23.       # 向上移动
  24.       @real_y = [@real_y - distance, @y * 128].max
  25.     end
  26.     # 移动时动画为 ON 的情况下
  27.     if @walk_anime
  28.       # 动画计数增加 1.5
  29.       @anime_count += 1.5
  30.     # 移动时动画为 OFF、停止时动画为 ON 的情况下
  31.     elsif @step_anime
  32.       # 动画计数增加 1
  33.       @anime_count += 1
  34.     end
  35.   end
  36. end
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
1 小时
注册时间
2017-7-30
回帖
4
 楼主| 发表于 2017-7-31 20:16:48 | 显示全部楼层
谢谢谢谢,已经没问题啦
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部