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

Project1

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

[已经解决] XAS编写tool的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
245
在线时间
33 小时
注册时间
2019-1-11
帖子
5
跳转到指定楼层
1
发表于 2019-10-24 13:30:15 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我下载的版本是3.91.按照XASabs上的教程,我先在数据库写了一个skill,weapon.然后在脚本库SKILL里22行处把2者对应起来.
运行游戏后装备武器使用技能时出现了如下错误...不知道是不是tool工具在脚本库其他地方需要写另外的东西...
我尝试把武器和tool2(自带)关联起来,结果没有问题..  求解答~


Image 1.png (5.09 KB, 下载次数: 7)

Image 1.png

Lv1.梦旅人

梦石
0
星屑
245
在线时间
33 小时
注册时间
2019-1-11
帖子
5
2
 楼主| 发表于 2019-10-24 13:41:14 | 只看该作者
..另外我把脚本库weapon里面的tool2复制了一下换个编号再复制对应的skill会出现相同的错误
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
14048
在线时间
2070 小时
注册时间
2016-9-20
帖子
844
3
发表于 2019-10-24 13:41:57 | 只看该作者
你是想把XAS系統放到自己遊戏?   你如果是新手不会用,直接用XAS的范例不就行了嗎
内容仅供参考,
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
245
在线时间
33 小时
注册时间
2019-1-11
帖子
5
4
 楼主| 发表于 2019-10-24 13:44:30 | 只看该作者
  1. #==============================================================================
  2. # ** Game_Character (part 1)
  3. #------------------------------------------------------------------------------
  4. #  This class deals with characters. It's used as a superclass for the
  5. #  Game_Player and Game_Event classes.
  6. #==============================================================================

  7. class Game_Character
  8.   #--------------------------------------------------------------------------
  9.   # * Public Instance Variables
  10.   #--------------------------------------------------------------------------
  11.   attr_reader   :id                       # ID
  12.   attr_reader   :x                        # map x-coordinate (logical)
  13.   attr_reader   :y                        # map y-coordinate (logical)
  14.   attr_reader   :real_x                   # map x-coordinate (real * 128)
  15.   attr_reader   :real_y                   # map y-coordinate (real * 128)
  16.   attr_reader   :tile_id                  # tile ID (invalid if 0)
  17.   attr_reader   :character_name           # character file name
  18.   attr_reader   :character_hue            # character hue
  19.   attr_reader   :opacity                  # opacity level
  20.   attr_reader   :blend_type               # blending method
  21.   attr_reader   :direction                # direction
  22.   attr_reader   :pattern                  # pattern
  23.   attr_reader   :move_route_forcing       # forced move route flag
  24.   attr_reader   :through                  # through
  25.   attr_accessor :animation_id             # animation ID
  26.   attr_accessor :transparent              # transparent flag
  27.   #--------------------------------------------------------------------------
  28.   # * Object Initialization
  29.   #--------------------------------------------------------------------------
  30.   def initialize
  31.     @id = 0
  32.     @x = 0
  33.     @y = 0
  34.     @real_x = 0
  35.     @real_y = 0
  36.     @tile_id = 0
  37.     @character_name = ""
  38.     @character_hue = 0
  39.     @opacity = 255
  40.     @blend_type = 0
  41.     @direction = 2
  42.     @pattern = 0
  43.     @move_route_forcing = false
  44.     @through = false
  45.     @animation_id = 0
  46.     @transparent = false
  47.     @original_direction = 2
  48.     @original_pattern = 0
  49.     @move_type = 0
  50.     @move_speed = 4
  51.     @move_frequency = 6
  52.     @move_route = nil
  53.     @move_route_index = 0
  54.     @original_move_route = nil
  55.     @original_move_route_index = 0
  56.     @walk_anime = true
  57.     @step_anime = false
  58.     @direction_fix = false
  59.     @always_on_top = false
  60.     @anime_count = 0
  61.     @stop_count = 0
  62.     @jump_count = 0
  63.     @jump_peak = 0
  64.     @wait_count = 0
  65.     @locked = false
  66.     @prelock_direction = 0
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # * Determine if Moving
  70.   #--------------------------------------------------------------------------
  71.   def moving?
  72.     # If logical coordinates differ from real coordinates,
  73.     # movement is occurring.
  74.     return (@real_x != @x * 128 or @real_y != @y * 128)
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # * Determine if Jumping
  78.   #--------------------------------------------------------------------------
  79.   def jumping?
  80.     # A jump is occurring if jump count is larger than 0
  81.     return @jump_count > 0
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # * Straighten Position
  85.   #--------------------------------------------------------------------------
  86.   def straighten
  87.     # If moving animation or stop animation is ON
  88.     if @walk_anime or @step_anime
  89.       # Set pattern to 0
  90.       @pattern = 0
  91.     end
  92.     # Clear animation count
  93.     @anime_count = 0
  94.     # Clear prelock direction
  95.     @prelock_direction = 0
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # * Force Move Route
  99.   #     move_route : new move route
  100.   #--------------------------------------------------------------------------
  101.   def force_move_route(move_route)
  102.     # Save original move route
  103.     if @original_move_route == nil
  104.       @original_move_route = @move_route
  105.       @original_move_route_index = @move_route_index
  106.     end
  107.     # Change move route
  108.     @move_route = move_route
  109.     @move_route_index = 0
  110.     # Set forced move route flag
  111.     @move_route_forcing = true
  112.     # Clear prelock direction
  113.     @prelock_direction = 0
  114.     # Clear wait count
  115.     @wait_count = 0
  116.     # Move cutsom
  117.     move_type_custom
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # * Determine if Passable
  121.   #     x : x-coordinate
  122.   #     y : y-coordinate
  123.   #     d : direction (0,2,4,6,8)
  124.   #         * 0 = Determines if all directions are impassable (for jumping)
  125.   #--------------------------------------------------------------------------
  126.   def passable?(x, y, d)
  127.     # Get new coordinates
  128.     new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
  129.     new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
  130.     # If coordinates are outside of map
  131.     unless $game_map.valid?(new_x, new_y)
  132.       # impassable
  133.       return false
  134.     end
  135.     # If through is ON
  136.     if @through
  137.       # passable
  138.       return true
  139.     end
  140.     # If unable to leave first move tile in designated direction
  141.     unless $game_map.passable?(x, y, d, self)
  142.       # impassable
  143.       return false
  144.     end
  145.     # If unable to enter move tile in designated direction
  146.     unless $game_map.passable?(new_x, new_y, 10 - d)
  147.       # impassable
  148.       return false
  149.     end
  150.     # Loop all events
  151.     for event in $game_map.events.values
  152.       # If event coordinates are consistent with move destination
  153.       if event.x == new_x and event.y == new_y
  154.         # If through is OFF
  155.         unless event.through
  156.            # If self is event
  157.           if self != $game_player
  158.             # impassable
  159.             return false
  160.           end
  161.           # With self as the player and partner graphic as character
  162.           if event.character_name != ""
  163.             # impassable
  164.             return false
  165.           end
  166.         end
  167.       end
  168.     end
  169.     # If player coordinates are consistent with move destination
  170.     if $game_player.x == new_x and $game_player.y == new_y
  171.       # If through is OFF
  172.       unless $game_player.through
  173.         # If your own graphic is the character
  174.         if @character_name != ""
  175.           # impassable
  176.           return false
  177.         end
  178.       end
  179.     end
  180.     # passable
  181.     return true
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # * Lock
  185.   #--------------------------------------------------------------------------
  186.   def lock
  187.     # If already locked
  188.     if @locked
  189.       # End method
  190.       return
  191.     end
  192.     # Save prelock direction
  193.     @prelock_direction = @direction
  194.     # Turn toward player
  195.     turn_toward_player
  196.     # Set locked flag
  197.     @locked = true
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # * Determine if Locked
  201.   #--------------------------------------------------------------------------
  202.   def lock?
  203.     return @locked
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # * Unlock
  207.   #--------------------------------------------------------------------------
  208.   def unlock
  209.     # If not locked
  210.     unless @locked
  211.       # End method
  212.       return
  213.     end
  214.     # Clear locked flag
  215.     @locked = false
  216.     # If direction is not fixed
  217.     unless @direction_fix
  218.       # If prelock direction is saved
  219.       if @prelock_direction != 0
  220.         # Restore prelock direction
  221.         @direction = @prelock_direction
  222.       end
  223.     end
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # * Move to Designated Position
  227.   #     x : x-coordinate
  228.   #     y : y-coordinate
  229.   #--------------------------------------------------------------------------
  230.   def moveto(x, y)
  231.     @x = x % $game_map.width
  232.     @y = y % $game_map.height
  233.     @real_x = @x * 128
  234.     @real_y = @y * 128
  235.     @prelock_direction = 0
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # * Get Screen X-Coordinates
  239.   #--------------------------------------------------------------------------
  240.   def screen_x
  241.     # Get screen coordinates from real coordinates and map display position
  242.     return (@real_x - $game_map.display_x + 3) / 4 + 16
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # * Get Screen Y-Coordinates
  246.   #--------------------------------------------------------------------------
  247.   def screen_y
  248.     # Get screen coordinates from real coordinates and map display position
  249.     y = (@real_y - $game_map.display_y + 3) / 4 + 32
  250.     # Make y-coordinate smaller via jump count
  251.     if @jump_count >= @jump_peak
  252.       n = @jump_count - @jump_peak
  253.     else
  254.       n = @jump_peak - @jump_count
  255.     end
  256.     return y - (@jump_peak * @jump_peak - n * n) / 2
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # * Get Screen Z-Coordinates
  260.   #     height : character height
  261.   #--------------------------------------------------------------------------
  262.   def screen_z(height = 0)
  263.     # If display flag on closest surface is ON
  264.     if @always_on_top
  265.       # 999, unconditional
  266.       return 999
  267.     end
  268.     # Get screen coordinates from real coordinates and map display position
  269.     z = (@real_y - $game_map.display_y + 3) / 4 + 32
  270.     # If tile
  271.     if @tile_id > 0
  272.       # Add tile priority * 32
  273.       return z + $game_map.priorities[@tile_id] * 32
  274.     # If character
  275.     else
  276.       # If height exceeds 32, then add 31
  277.       return z + ((height > 32 ) ? 31 : 0)
  278.     end
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # * Get Thicket Depth
  282.   #--------------------------------------------------------------------------
  283.   def bush_depth
  284.     # If tile, or if display flag on the closest surface is ON
  285.     if @tile_id > 0 or @always_on_top
  286.       return 0
  287.     end
  288.     # If element tile other than jumping, then 12; anything else = 0
  289.     if @jump_count == 0 and $game_map.bush?(@x, @y)
  290.       return 12
  291.     else
  292.       return 0
  293.     end
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # * Get Terrain Tag
  297.   #--------------------------------------------------------------------------
  298.   def terrain_tag
  299.     return $game_map.terrain_tag(@x, @y)
  300.   end
  301. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
245
在线时间
33 小时
注册时间
2019-1-11
帖子
5
5
 楼主| 发表于 2019-10-24 14:41:46 | 只看该作者
ppspssss 发表于 2019-10-24 13:41
你是想把XAS系統放到自己遊戏?   你如果是新手不会用,直接用XAS的范例不就行了嗎 ...

我打算直接在范例上做.但是总要自己写一些tool啊emm

点评

如果没教程就直接放弃,去學其他,XAS教程太少了,  发表于 2019-10-24 14:53
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
11274
在线时间
21677 小时
注册时间
2010-10-24
帖子
308
6
发表于 2019-10-24 17:04:09 | 只看该作者
要在XAS里新建一个TOOL,首先在数据库里按照其他TOOL的特技新建特技,然后在脚本编辑器里按照其他TOOL的脚本新建一个脚本,之后在TOOL仓库地图(默认是一号地图)里按照其他TOOL事件新建一个事件,这三者缺一不可,且ID互相一致

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
245
在线时间
33 小时
注册时间
2019-1-11
帖子
5
7
 楼主| 发表于 2019-10-24 20:52:36 | 只看该作者
imsy 发表于 2019-10-24 17:04
要在XAS里新建一个TOOL,首先在数据库里按照其他TOOL的特技新建特技,然后在脚本编辑器里按照其他TOOL的脚 ...

原来要在1号地图里面放事件...解决了
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-26 05:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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