Garry's Mod

Garry's Mod

262 ratings
Global Persistence
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Roleplay
File Size
Posted
Updated
7.233 KB
Jul 2, 2016 @ 8:56am
Dec 26, 2020 @ 9:42am
4 Change Notes ( view )

Subscribe to download
Global Persistence

Description
Global Persistence
This makes the Sandbox persistence system (right click -> persist) work in other gamemodes so you can easily save custom maps using built-in gmod functions.

To use it simply load up a map in Sandbox, make some props persistent and then go to your gamemode of choice.

Features
  • Super simple saving system
  • Prevent map cleanups deleting your saved props
  • Prevent the game from saving changes to your props after each round
  • Use some entities in other gamemodes (eg balloons in TTT)

How to use
  1. Open your map in sandbox
  2. Set the sbox_persist cvar to a value (eg "myserver")
  3. Spawn some props
  4. Right click on each prop and choose "Make Persistent"
  5. (optional) Run sbox_persist_save in console
  6. You're done!

Limitations
  • Not every entity will work outside of Sandbox. I've ported a few things like lamps and balloons but I didn't bother with things like buttons that wouldn't work anyway.
  • This will not automatically make sandbox addons work in TTT. I did a brief test and wiremod seemed to work, but each addon needs to be changed to work properly.

Convars
  • sbox_persist - Chooses what file to save/load to.
  • sbox_persist_cleanup - If set to 1, all your persisted props will respawn after map cleanups
  • sbox_persist_autosave - By default Sandbox saves the state of everything every time the server changes level. If you set this to 0, that behaviour is disabled and you will need to run sbox_persist_save each time you want to update your persisted props.

Useful Links
Github[github.com]
Popular Discussions View All (3)
4
Apr 2, 2023 @ 5:27am
Server restarts wipes everything clean.
Jeddalo
3
Mar 24, 2019 @ 12:21pm
Restart and map change
chesiren
0
Oct 11, 2023 @ 10:01pm
File where the persistence is saved?
[RD] Arieson
19 Comments
>KB> >KEKSQUAD Jun 24, 2024 @ 8:34pm 
[Global Persistence] gamemodes/sandbox/gamemode/persistence.lua:46: attempt to concatenate local 'name' (a nil value)
1. oldLoad - gamemodes/sandbox/gamemode/persistence.lua:46
2. unknown - lua/autorun/server/globalpersist.lua:85
Timer Failed! [sbox_persist_load_timer][@lua/autorun/server/globalpersist.lua (line 89)]

Happens when calling PersistenceLoad via Lua
>KB> >KEKSQUAD Feb 29, 2024 @ 3:47pm 
Couldn't include file 'sandbox/entities/entities/gmod_winch_controller.lua' - File not found or is empty (@lua/autorun/globalpersist.lua (line 33))
1. setupEntity - lua/autorun/globalpersist.lua:33
2. fn - lua/autorun/globalpersist.lua:68
3. unknown - lua/ulib/shared/hook.lua:109
SeRoZa-TaRtEk Mar 7, 2021 @ 5:55am 
Класс
Lexi  [author] Dec 26, 2020 @ 9:44am 
Hi all, while trying to fix a weird bug causing double spawns I ended up rewriting the entire tool.

It now supports saving way more things, including NPCs, ragdolls and lamps! (Vehicles are currently bugged and will work next gmod update)

There's more info in the updated description, and as ever if you run into any bugs please tell me so I can fix them!
Lexi  [author] Sep 23, 2020 @ 10:43am 
Hi, sorry for the delay in getting back to you. Can you try making a single prop persist without using permaprops, and also try without permaprops entirely.

Other than that, I'm assuming your problem is that the platforms just don't show up?
Can you confirm
- Which platforms you mean (I assume mine but need to check)
- What gamemode you want to spawn them in
- If you have any other addons installed that might be related?
- If the platforms spawn correctly when you go back to sandbox
Nebbs Sep 16, 2020 @ 11:34am 
I have sbox_persist set to "1" in my server.cfg file. I don't use Global Persistence for anything else, as I just use PermaProps for props.
Lexi  [author] Sep 16, 2020 @ 11:20am 
You have sbox_persist set to something yes? Is your problem that they don't spawn when other props do, or something else?
Nebbs Sep 15, 2020 @ 8:22pm 
i'm having problems with getting platforms to persist through server restarts. any tips?
Lexi  [author] Jun 26, 2020 @ 1:53pm 
It's still there for me, but you need to have set sbox_persist to something for it to show up. Unless Falco removed it from DarkRP or something?
HDMineFace Jun 22, 2020 @ 6:10pm 
For some reason, right clicking to make persistant has been removed from the game, installing this to hope it fixes it/re-adds it