全地图升级工具

为实验分支制作。将升级工具尺寸设为 1×1 并点击任意位置,在资源充足时,游戏会尝试升级地图上的所有目标。文中还提供了手动将改动移植到其他版本的 Lua 操作步骤。

0浏览
0下载点击
0点赞
0收藏

关于这个 Mod

本模组面向实验分支制作。如何进入实验分支,请查看官方公告。

将升级工具尺寸切换为 1×1,然后点击任意位置。只要拥有所需资源,游戏就会尝试升级地图上的所有目标。

如何移植到其他版本

如果需要适配其他游戏版本,可以自行将改动移植到 Lua 文件中,步骤如下:

  1. 将最新的 \Riftbreaker\packs\XX_win_data.zip 解压到单独目录,查找 \lua\misc\tool.lua 和 \lua\misc\upgrade_tool.lua。如果找不到所需文件,就继续检查前一个版本的压缩包,直到找到为止。
  2. 将这两个 Lua 文件复制到另一个目录,并在该目录中保留 \lua\misc\... 的文件夹结构。
  3. 用文本编辑器打开 \lua\misc\tool.lua,搜索 function tool:OnWorkExecute(),复制整个函数,并粘贴到 \lua\misc\upgrade_tool.lua 的最后一行 return upgrade_tool 之前。
  4. 编辑复制过去的函数。以下示例以实验分支文件为准:
function upgrade_tool:OnWorkExecute()

    self:RescaleChild()

    local selectorComponent = EntityService:GetComponent(self.selector, "BuildingSelectorComponent")

    local previousSelection = self.selectedEntities

    self.selectedEntities = self:FindEntitiesToSelect(reflection_helper(selectorComponent))

    if (self.RemovedFromSelection) then
        for ent in Iter(previousSelection) do
            if (IndexOf(self.selectedEntities, ent) == nil) then
                self:RemovedFromSelection(ent)
            end
        end
    end

    if (self.AddedToSelection) then
        if self.currentScale == 1 and self.activated then
            for ent in Iter(FindService:FindEntitiesByType("building")) do
                self:OnActivateEntity(ent)
            end
        else
            for ent in Iter(self.selectedEntities) do
                if (IndexOf(previousSelection, ent) == nil) then
                    self:AddedToSelection(ent)
                    if (self.activated) then
                        self:OnActivateEntity(ent)
                    end
                end
            end
        end
    end

    if (self.OnUpdate) then
        self:OnUpdate()
    end
end

如果你没有游玩实验分支,需要移除 self.currentScale == 1 and。

  1. 删除 tool.lua,然后将 /lua/ 目录压缩打包,即可完成模组制作。

作者:Aephiex

版本:1.0

来源与文件

  • 原作者:Aephiex
  • 原项目:Full Map Upgrade Tool
  • 文件:FullMapUpgradeToolForExperimentalBranch(ID:589)

前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。

<!-- aoe-mods-source:nexusmods:theriftbreaker:173 -->