安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题








It doesn't seem that they know of a way to avoid this warning when changing the gold_pickup script. I agree that it is very annoying :( If I find a fix that resolves the issue on my end I will update the mod. Thank you very much for reporting the issue and taking time to try to find a solution!
It did work on my computer,with no other mod , both in Chinese and English。
Just avoid
ModLuaFileAppend("data/scripts/items/gold_pickup.lua" ,...)
and it wont crash
and I tried another two ways to solve ,it might help you
The first is still based on "ModTextFileSetContent" and "ModTextFileGetContent"
Just insert the contents of dofile under the vanilla dofile
and the contents of your method into the vanilla method
For Example
--start
function doinsert(str1, str2, pos)
return str1:sub(1,pos)..str2..str1:sub(pos+1)
end
local content=ModTextFileGetContent("data/scripts/items/gold_pickup.lua")
local doinsert=function(findpos_str,insertcontent)
local insertion_point = (string.find(content,findpos_str) and
string.find(content,findpos_str)-1)--insert before it
if insertion_point then
content doinsert(content,insertcontent,insertion_point)
else Print("no Position of "..findpos_str)
end
end
doinsert("local.pos_x, pos_y",PutYourMethodWithNoHandlerHere)
doinsert("function.item_pickup",PutYourDofileHere)
--end
But this way is cumbersome and not convenient to debug.
The other way is to create a loop to detect changes in money
local comp= EntityGetFirstComponent(player_entity,"VariableStorageComponent",YourCompTag)
lastcheck_money = tonumber(ComponentGetValueInt(comp, "value_string"))
edit_component(player_entity, "WalletComponent", function(comp, vars)
now_money = ComponentGetValueInt(comp, "money")
end)
xp_Gain= math.max(now_money-lastcheck_money,0)
AddPlayerXP(xp_Gain)
if (PlayerShouldLevelUp()) then
PerformLevelUp()
end
you don't need to do it every fram,
I myself tried do it every 30 frams and I didn't feel any laggings.
but this makes you gain xp when pick Gold powder and
reduce the number of XP acquired when using project modifier --Gold to Strength
In,the end。。Thanks for your reply!I love your mod very much。