Jump to content
The Indie Stone Forums
Sign in to follow this  
undvoice

global variable that would not be deleted after rebooting the server

Recommended Posts

Friends, hello everyone, my name is Kirill, I am developing mods in Russia for project zomboid, I had a question, I can not figure out how I could create a global variable that would not be deleted after rebooting the server. You can prompt or throw off the instructions.

Share this post


Link to post
Share on other sites

You could either use ModData (depending an the things you want to persist) or IMHO easier write a file, for example in Zomboid/Lua or your mod-folder.

Share this post


Link to post
Share on other sites
6 hours ago, Dr_Cox1911 said:

You could either use ModData (depending an the things you want to persist) or IMHO easier write a file, for example in Zomboid/Lua or your mod-folder.

 

Thank you for responding. After three days of reading the developer scripts, I realized that ModData would help me, but unfortunately I didn’t quite figure out how to work with them, is there an instruction somewhere or something like that? I figured out how to record a file, but it doesn’t really fit me, because the file is created on the client, and my mod is designed for multiplayer.

Share this post


Link to post
Share on other sites

Never really used ModData myself.

 

As for your file problem: You can write files on the server, you just have to execute your write command in a function that is executed by the server.

I only read on my mods on the server side, but you would just have to switch the read to a write.

 

You can either look at my mod CoxisShop or CoxisReloadSync for this. CoxisShop uses my other mod CoxisUtil now to read the file.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...