Noita
高级地图 Advanced Map
Melodeiro 2024 年 4 月 10 日 下午 4:25
Optimisation fix proposal
Just found out that entities were leaking every mod restart which is also contributes into save file corruption and/or maybe to performance degradation. My suggestions are somthing like that as a workaround:

<Entity name="advanced_map">

function OnPlayerSpawned(player_entity) DisposeMap() --clean save file on player spawn as an option to avoid save file corruption when mod is unloaded end

function OpenMap() if GlobalsGetValue("MAP_OPEN") == "1" then return end GlobalsSetValue("MAP_OPEN", "1") local map_id = EntityGetWithName("advanced_map") if map_id == 0 then --create new entity or reuse the old one if it is present local player_id = EntityGetWithTag("player_unit")[1] local child_id = EntityLoad("mods/advanced_map/map.xml") EntityAddChild(player_id, child_id) end end function DisposeMap() GlobalsSetValue("MAP_OPEN", "0") local map = EntityGetWithName("advanced_map") EntityKill(map) end
最后由 Melodeiro 编辑于; 2024 年 4 月 10 日 下午 4:27
< >
正在显示第 1 - 1 条,共 1 条留言
ljiyin  [开发者] 2024 年 4 月 11 日 上午 3:11 
Thank you so much! I will check this out.
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50