高级玩家

- 贡献度
- 6
- 金元
- 4668
- 积分
- 491
- 精华
- 0
- 注册时间
- 2011-11-27
|
本帖最后由 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
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|