Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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。