3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

楼主: chenjywz
打印 上一主题 下一主题

[推荐] 海岛大亨4资源上限修改方法

  [复制链接]

9

主题

496

帖子

513

积分

高级玩家

Rank: 4

贡献度
6
金元
4893
积分
513
精华
0
注册时间
2011-11-27
跳转到指定楼层
主题
发表于 2012-4-23 22:35 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 chenjywz 于 2012-4-26 12:04 编辑

是论坛转帖的去除人口上限的帖子启发了我,经过对lua的反编译以及和Swixel的交流,最终发现在他的去除人口上限代码中的NoLimitsMod(0)的最后加入
g_Classes.LargeGoldMarker.Amount = 20000000,就可以在挑战中将单个金矿的数目修改为20,000,000,我相信足够了,而且经过测试,矿井的一次采集大概在200左右,这样不会导致卡车司机不足。同理可以加LargeIronMarker,LargeBauxiteMarker。
全部的代码如下,我这里的人口上限是5000,而且一次不会有那么多人移民进来。

local GameEntityCount = 200000
local MaxPopulation = 5000

-- Original mod code
function NoLimitsMod()
    -- Sets the entity count
    config.MaxGameObjectExCount = GameEntityCount
    config.MaxGameObjectCount = GameEntityCount

    -- Remove the road construction limitations
    road_construction.ReachedLimit =  function(x)
        return false
    end

    -- Sets the population
    MigrationMaxCitizens = MaxPopulation

    ImmigrationRandomize = function(y)
        return MulDivRound(y, MaxPopulation - CitizenCount, 60)
    end


        g_Classes.LargeGoldMarker.Amount = 80000000
        g_Classes.LargeBauxiteMarker.Amount = 80000000
        g_Classes.SmallGoldMarker.Amount = 8000000
        g_Classes.LargeIronMarker.Amount = 20000000


end



-- Only fire once
local FiredOnce = false

-- UA Set Mode
OnMsg.UASetMode = function(actions,mode)

    -- Fire until fired once
    if not FiredOnce then
        -- If we boot, trip it ...
        if(mode == "Boot") then
            FiredOnce = true

            -- Run the thread to bypass it
            CreateRealTimeThread(function()

                -- Do mod loading code here.
                NoLimitsMod()

                -- Reconfigure/force the settings every map load.
                OnMsg.MapPermanentObjectsLoaded = function()
                    NoLimitsMod()
                end
            end)
        end
    end
end

-- Legacy load (what the original mod used)
OnMsg.ClassesPreprocess = function()
    NoLimitsMod()
end
nolimits.lua (1.53 KB, 下载次数: 215456)

回复

使用道具 举报

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

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2026-3-29 00:32 , Processed in 0.027954 second(s), 18 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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