|
原贴 by yogafish
前段时间,在simtropolis上看到一个好东东——BSC Menu Management Lot Mod
那么,这个到底是个什么好东东呢?
请听我细细翻来(翻译的翻字~~) :
你的plugins目录下是不是有着上百M的,甚至上G的插件,那么你一定会深深体会到在模拟城市4中滚动那些琳琅满目却又无穷无尽的菜单的痛苦。广大的Modder们已经尝试各种办法在模拟城市4的菜单中添加新菜单或创建子菜单,可是这已经被证实是一个Mission Impossible了。不过,从现在起BSC小组为广大SC4的插件发烧友们带来的一线光明。
你可以利用BSC的这套MML(Menu Management Lot)将众多套件在菜单中“合并”(shrink)为一个Construction Lot ,当你需要是使用某套插件时,只需将该Construction Lot 放置(plop)在城市中,在游戏中等待几天,就能在菜单中展开(unhide)整套插件。而当你铲除(bulldoze)这个construction Lot,重新进入城市,你会发觉整套插件又被隐藏了。
不幸的是,这项技术还存在一些缺陷。
1、由于是采用的基于menu icon feature的办法,所以,你必须等上几天(甚至要一个月)才能见到套件图标的出现。
2、一旦展开图标后,操作跟过去仍然是一样的,你得一个一个去点套件中图标,这个MML并不能带来实质性的改变。
3、一旦放置了construction lot展开了菜单,想再隐藏,你只有删除该lot,退出并重进你的城市才行。
4、最后,因为使用了奖励脚本(reward script),因此,必须把construction lot在occuptgroup中添加一个landmark组,因此,在landmark菜单中难以避免的也会有construction lot的身影。
以下是本套MML包含的20套流行套件:
BSC Forest Tracks
BSC Park Set (with various additions)
Cobb's Harbor Village [icons moved to the Water Transit menu]
Marrast Embankment Set
morifari Embankment Set (including embankment station)
oppie's Canal Set (with various additions) [icons moved to the Water Transit menu]
PEG CDK-Industrial
PEG CDK-OWW and Seaport Village
PEG CDK-REC and Pier set
PEG RTK3
PEG Pond Kit II Deluxe Version
PEG Stream Kit II Deluxe Version
PEG Trail Parks
PEG Seasonal Trail Parks
SFBT Construction Lots
SFBT Highway Bridge Construction Lots
simrolle's S-Bahn Set (including stations)
SimGoober's Canal Set (with various additions) [icons moved to the Water Transit menu]
SimGoober's Narrow Canals [icons moved to the Water Transit menu]
SimGoober's Irrigation Canals
simtropolis上的下载地址:
http://www.simtropolis.com/stex/details.cfm?id=15677&v=1
经过本人研究表明,MML对于重排菜单(Redivider Menu)没有影响,也就是说对天都城资料片依然试用。
其实,很好理解,MML是对LOT的Lot Resource Key的对应值,也就是LOT里唯一的那个instance值起作用的。
深入研究:
OK~那么MML的工作原理是啥呢?
打开MML中任何一套插件,在examplar里面可以看到,除了construction lot的两组examplar,剩下的全是原套件中的各LOT的examplar。
我和原套件中的各LOT比较了一下,发现MML中examplar就多了一个conditional building,值为true。这个项是奖励建筑的必要项。
那么MML到底是如何工作的呢,关键就在LUA文件上。LUA文件正是那个reward script。
以下是PEG_TrialPark系列的MML中的script,供各位参考:
--#-package:014C0B97# -- package signature
-----------------------------------------------------------
--- ************* globals (do not edit) ************** ---
-----------------------------------------------------------
if (arr_length == nil) then
arr_length = function(table) -- looks clean
local i = 0
while (table[i+1] ~= nil) do
i=i+1
end
return i
end
end
if (BSCMML == nil) then BSCMML = end
function BSCMML.NewMMLStructure()
local table =
table.parent = "" -- hex id of parent.
table.children = -- array of children (hex id)
table.once = false -- indicates if the parent has already been built during this game
table.tigger = false -- indicated this tree has been triggered
return table
end
function BSCMML.Trigger(MML)
MML.trigger = true
return "trigger succesfull"
end
function BSCMML.LogMML(MML)
for i = 1,arr_length(MML.children) do
a = create_reward_cityplanning(MML.children)
function a.condition()
if ((game.reward_instance_count(tonumber(MML.parent,16)) > 0) or MML.trigger)
then
MML.once = true
return reward_state.AVAILABLE
else
if (MML.once)
then return "The lots will be hidden again after restarting the game."
else return reward_state.HIDDEN
end
end
end
end
end
---------------------------------------------------------
--- ************* PEG Trail Park lots ************** ---
---------------------------------------------------------
PEG_TRAIL_PARK = BSCMML.NewMMLStructure()
PEG_TRAIL_PARK.parent = "B14C0B97" -- construction lot
PEG_TRAIL_PARK.children =
"4E8E1C43", -- 1x1
"CE8E1FBD", -- 3x1
"EE8E68E8", -- el-extender
"EE8E5047", -- ped tunnel
"AE8E339B", -- t intersection
"CE8E3E2F", -- corner
"4E8E96EF", -- plaza
"2E8F7634", -- parking
"8E8F78DE", -- snack bar
"2E8F7F21", -- playground
"2FD25842", -- large fountain
BSCMML.LogMML(PEG_TRAIL_PARK) |
|