Skip to content

Fixed 2 issues with savemap#548

Open
NovaAstral wants to merge 1 commit into
wiremod:masterfrom
NovaAstral:master
Open

Fixed 2 issues with savemap#548
NovaAstral wants to merge 1 commit into
wiremod:masterfrom
NovaAstral:master

Conversation

@NovaAstral

@NovaAstral NovaAstral commented Jul 19, 2026

Copy link
Copy Markdown
  • Fixed an issue in Savemap caused by PR Fixed/improved map save #521 where it didn't load from the same file path as it saved to, causing confusion about the function not working at all, This also caused it to load the same file on every map
  • Fixed an issue in Savemap where it pasted too early on dedicated servers, causing some entities to not spawn at all, now it will only start spawning 5 seconds after the first player joins the server (5 seconds in my testing is enough time to allow all entities to spawn properly, some don't at only 1 second)

- Fixed an issue in Savemap where it didn't load from the same file path as it saved to
- Fixed an issue in Savemap where it pasted too early on dedicated servers, causing some entities to not spawn at all
print("[AdvDupe2Notify]\tMap save pasted.")
end
hook.Add("InitPostEntity", "AdvDupe2_PasteMap", PasteMap)
hook.Add("InitPostEntity", "AdvDupe2_PasteMap", timer.Simple(5,PasteMap))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the timer for? This is a lua error btw. Should be function() timer.Simple(5, PasteMap) end

@NovaAstral NovaAstral Jul 20, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't error for me, timer is to delay the paste because on dedicated servers, trying to paste as soon as the server starts causes many things to not spawn at all

The reason its specifically "5 seconds after the first player joins" is because by default, the server pauses when noone is online, so all timers pause and only start running once a player starts joining the server, and 5 seconds should be enough time for things to be sufficiently unpaused, as it seems 1 second in my testing wasn't enough time for a few things to spawn properly

end

if(not file.Exists("advdupe2/"..filename..".txt", "DATA"))then
if(not file.Exists("advdupe2/maps/"..mapname.."/"..filename..".txt", "DATA"))then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should honestly just be "advdupe2/maps/"..mapname..".txt" and have the cvar deleted.

@NovaAstral NovaAstral Jul 20, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Methinks some people might want to have multiple different saves for a single map

I think the ideal solution would be to implement some kind of save select system like the normal advdupe2 menu so you dont have to futz around with concommands, but that's out of my depth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants