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

[制作教程] Basic Evented Alchemy Gathering using tile swaps

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4456

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Basic Evented Alchemy Gathering

    I was searching for a way to create a harvest/gather system for alchemy or cooking.  I wanted a system that didnt use events to create items for harvest.

    By using Terrain tags and tile layer Ids, you can place as many harvesting items you want n a map without using an event for each.

    You will need this game extension here or in demo:

    http://forums.rpgmakerweb.com/index.php?/topic/25040-ace-useful-script-call-reference/

    Spoiler#--------------------------------------------------------------------------
    #Modifications
    #--------------------------------------------------------------------------
    #Changed Line 88 in Game_Event
    #from
    # if near_the_screen? && @stop_count > stop_count_threshold
    #to
    # if @stop_count > stop_count_threshold
    #--------------------------------------------------------------------------
    # REGION MANIPULATION
    #--------------------------------------------------------------------------
    class Game_Map
    def setTileRegion(reg_x,reg_y,reg_id)

    if reg_id > 63 || reg_id < 0
    reg_id = 0
    end

    @thirdvalue = "%14b" % self.data[reg_x, reg_y, 3]

    # binary split of the two elements
    @bLEFT = @thirdvalue[0,6] # REGION ID IN BINARY
    @bRIGHT = @thirdvalue[6,8] # SHADOW ID IN BINARY

    @bLEFT = "%6b" % reg_id

    @newvalue = @bLEFT.to_s + @bRIGHT.to_s
    @newvalue = @newvalue.to_i(2)

    self.data[reg_x, reg_y, 3] = @newvalue

    end
    def getTileRegion(reg_x,reg_y)

    # gets a 14 bit long binary string from the map data array
    @thirdvalue = "%14b" % self.data[reg_x, reg_y, 3]

    # binary split of the two elements
    @bLEFT = @thirdvalue[0,6] # REGION ID IN BINARY
    @bRIGHT = @thirdvalue[6,8] # SHADOW ID IN BINARY

    # converts the binary string back to an integer and returns
    return(@bLEFT.to_i(2))

    end
    def getTileShadowID(reg_x,reg_y)

    # gets a 14 bit long binary string from the map data array
    @thirdvalue = "%14b" % self.data[reg_x, reg_y, 3]

    # returns binary split of the two elements
    @bLEFT = @thirdvalue[0,6] # REGION ID IN BINARY
    @bRIGHT = @thirdvalue[6,8] # SHADOW ID IN BINARY

    # converts the binary string back to an integer and returns
    return(@bRIGHT.to_i(2))

    end


    #--------------------------------------------------------------------------
    # MAP MANIPULATION
    #--------------------------------------------------------------------------
    def getTileIDByLayer(x,y,layer)
    return(self.data[x,y,layer])
    end

    def setTileIDByLayer(x,y,layer,tile_ID)
    self.data[x,y,layer] = tile_ID
    end


    end


    #--------------------------------------------------------------------------
    # Save Tile Manipulation
    #--------------------------------------------------------------------------
    class Game_System
    def changeTileByInternalID(map_id,x,y,layer,intID)
    initialize_pos_list(map_id, layer)
    tid = intID
    @swapped_pos_tiles[map_id][layer][y] = [] if @swapped_pos_tiles[map_id][layer][y].nil?
    @swapped_pos_tiles[map_id][layer][y][x] = tid
    $game_map.load_new_map_data
    end
    end
    #--------------------------------------------------------------------------
    # Battler Additions
    #--------------------------------------------------------------------------
    class Game_Battler < Game_BattlerBase
    def wtype_equipped?(wtype_id)
    return weapons.any? {|weapon| weapon.wtype_id == wtype_id }
    end

    def atype_equipped?(atype_id)
    return armors.any? {|armor| armor.atype_id == atype_id}
    end
    end




    No tutorial, should be fairly simple demo.

    Setup:

    1 - Parallel

    1- Common Event

    Label all tileset items to be used for harvesting with Terrain tag #

    You will need to know your tile layers by ID# for swap(using XS-Variable HUD is a great easy way to get them)

    Press Enter When over item for harvest

    Features:

    Unlimited number of harvestabe items.

    No map events required

    Uses tile swaps

    Demo:

    http://s000.tinyupload.com/?file_id=10899988343447240067

    [/url][url=https://forums.rpgmakerweb.com/attachments/gathering2-png.19965/][url=https://forums.rpgmakerweb.com/attachments/gathering3-png.19966/][/url]


    本贴来自国际rpgmaker官方论坛作者:Quailar处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/basic-evented-alchemy-gathering-using-tile-swaps.38041/

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 15:46 , Processed in 0.118795 second(s), 59 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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