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
1) Get a refinery with "Can smelt Scrap" on both Install and Permanent Install
2) Install it
3) Scrap smelting works
4) Permanently install it
5) Scrap smelting doesn't work anymore
In fact, here is the error in the code:
The tooltip (refinery.lua line 322) says "can smelt scrap" even if canScrapBonus is false, but on line 912, 1025 and 1137 you override canScrap with canScrapBonus. So the tooltip says it can smelt scrap but the bonus was defined as false and got overridden.
EDIT: Another issue is that on line 75, you are reading "canScrap" instead of "canScrapBonus"
In fact, you are doing a fundamental mistake by not re-seeding the random function on line 208. To avoid breaking things, I recommend adding this to line 208:
math.randomseed(seed)
math.random()
and replace the canScrap assignment with this:
-- CAN SCRAP
local canScrap = false
if math.random() < 0.5 then
canScrap = true
end
local canScrapBonus = false
if canScrap or math.random() < 0.5 then
canScrapBonus = true
end
Then return both canScrap and canScrapBonus from the same call.
This will re-seed the random and rolls a blank on it to reset the state to what it would be. Right now random will have an offset of 1 if the mod is installed temporarily, or 2 if it's installed permanently, which messes with canScrap. At the same time you need to also generate canScrapBonus in the same method instead of a second roll
EDIT: The textures folder seems to be in the wrong folder, it should be under data, not in the root folder. i.e. textures are under 2040989882\textures\icons but getIcon references them to be at 2040989882\data\textures\icons