|
以tmxkn1 大大的Omnicrop价格作弊MOD为例:
小弟使用CitiesXLPakUnpak_v1.3.将offlineomnicorpprices.data 这个文件解出来后,修改了一下
TradingHouse:SetOfflineOmnicorp("water", 100, 70)
TradingHouse:SetOfflineOmnicorp("electricity", 70, 50)
保存之后,使用cxlPackager.exe将其替换mod_tmxkn1_trade_price.patch源文件,保存放入paks文件夹。可进入游戏后,所有交易价格都按照默认的35,90了。这个是哪里出错了呢?
offlineomnicorpprices.data 内容如下:
-
- TradingHouse.OfflinePrices = TradingHouse.OfflinePrices or {}
- -- these are the default prices that are used when there is not a specific price specified for this ressource
- TradingHouse.DefaultOmniBuyUnitPrice = 35
- TradingHouse.DefaultOmniBuySellPrice = 90
- function TradingHouse:SetOfflineOmnicorp(_Name, _UnitSellPrice, _UnitBuyPrice)
- local ID = TradingLogic:GetTokenID(_Name)
- if (ID == -1) then
- LOG_ERROR("Trying to set Unknown token : "..(_Name or "nil"))
- return
- end
- if (math.floor(_UnitSellPrice) ~= _UnitSellPrice) then
- LOG_ERROR("Trying to set a non integer sell price for token : "..(_Name or "nil"))
- return
- end
-
- TradingHouse.OfflinePrices[_Name] = TradingHouse.OfflinePrices[_Name] or {}
- TradingHouse.OfflinePrices[_Name].SellPrice = _UnitSellPrice
- TradingHouse.OfflinePrices[_Name].BuyPrice = _UnitBuyPrice
-
- end
- --TradingHouse:SetOfflineOmnicorp(_Name, _UnitSellPrice, _UnitBuyPrice)
- -- these are specific prices per token type : the first should be greater than the second
- -- the first is how much it costs to buy the token from Omnicorp
- -- the second is how much you can get
- TradingHouse:SetOfflineOmnicorp("worker1", 70, 25)
- TradingHouse:SetOfflineOmnicorp("worker2", 90, 30)
- TradingHouse:SetOfflineOmnicorp("worker3", 115, 40)
- TradingHouse:SetOfflineOmnicorp("worker4", 145, 45)
- TradingHouse:SetOfflineOmnicorp("water", 100, 70)
- TradingHouse:SetOfflineOmnicorp("fuel", 50, 30)
- TradingHouse:SetOfflineOmnicorp("office", 10, 5)
- TradingHouse:SetOfflineOmnicorp("manufacturing", 30, 10)
- TradingHouse:SetOfflineOmnicorp("high tech", 40, 40)
- TradingHouse:SetOfflineOmnicorp("food industry", 30, 20)
- TradingHouse:SetOfflineOmnicorp("holidays", 25, 30)
- TradingHouse:SetOfflineOmnicorp("heavy industry", 20, 5)
- TradingHouse:SetOfflineOmnicorp("waste", 80, 50)
- TradingHouse:SetOfflineOmnicorp("electricity", 70, 50)
- -- TradingHouse:SetOfflineOmnicorp("electricity", 30, 20)
- -- TradingHouse:SetOfflineOmnicorp("fuel", 30, 1)
复制代码
[ 本帖最后由 111245 于 2011-7-12 23:58 编辑 ] |
|