Noita
Advanced Map
Melodeiro 10 Apr, 2024 @ 4:25pm
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
Last edited by Melodeiro; 10 Apr, 2024 @ 4:27pm
< >
Showing 1-1 of 1 comments
ljiyin  [developer] 11 Apr, 2024 @ 3:11am 
Thank you so much! I will check this out.
< >
Showing 1-1 of 1 comments
Per page: 1530 50