Dream Jing Posted September 2, 2025 Share Posted September 2, 2025 Hello everyone, big shots. I wrote a skill tree mod for Wanda, but now I have encountered some issues: my skill tree data can only be saved in the archive, and if I switch to the archive, I need to add new points. (This issue also occurs when updating mods). I tried to use TimSim in modmain, but it didn't work. Later, I checked the forum and found that it may have been due to some bad guys maliciously using mods to transmit viruses recently, and the official has modified the relevant API. I need to ask all the experts how I can save the skill tree data with my account in this situation (like the official way, no matter which world I am in, there is no need to add new points). Or the minimum requirement is that it can be saved locally to the client. Every time I load a save of my mod during gameplay, I first read the skill tree data to ensure that players do not need to re light their skills. Here is my code. As a beginner, I would greatly appreciate it if you could tell me where I need to add which code to implement this feature. Thank you all. ProjectO.zip Link to comment https://forums.kleientertainment.com/forums/topic/167791-how-can-the-mod-skill-tree-be-associated-with-accounts-or-stored-locally-on-the-client-side-like-the-official/ Share on other sites More sharing options...
FerniFrenito Posted September 2, 2025 Share Posted September 2, 2025 5 hours ago, Dream Jing said: Hello everyone, big shots. I wrote a skill tree mod for Wanda, but now I have encountered some issues: my skill tree data can only be saved in the archive, and if I switch to the archive, I need to add new points. (This issue also occurs when updating mods). I tried to use TimSim in modmain, but it didn't work. Later, I checked the forum and found that it may have been due to some bad guys maliciously using mods to transmit viruses recently, and the official has modified the relevant API. I need to ask all the experts how I can save the skill tree data with my account in this situation (like the official way, no matter which world I am in, there is no need to add new points). Or the minimum requirement is that it can be saved locally to the client. Every time I load a save of my mod during gameplay, I first read the skill tree data to ensure that players do not need to re light their skills. Here is my code. As a beginner, I would greatly appreciate it if you could tell me where I need to add which code to implement this feature. Thank you all. ProjectO.zip 2.22 MB · 0 downloads To verify i understand the problem. You want to save data but no in a single world, you want something like this: if you, for example, reach level 10 or something, you can change to a different world and, in that world, you spawn with the level 10 you reached in the other world, correct? So, you want a user progress, not character progress. Link to comment https://forums.kleientertainment.com/forums/topic/167791-how-can-the-mod-skill-tree-be-associated-with-accounts-or-stored-locally-on-the-client-side-like-the-official/#findComment-1833782 Share on other sites More sharing options...
Dream Jing Posted September 3, 2025 Author Share Posted September 3, 2025 9 hours ago, FerniFrenito said: To verify i understand the problem. You want to save data but no in a single world, you want something like this: if you, for example, reach level 10 or something, you can change to a different world and, in that world, you spawn with the level 10 you reached in the other world, correct? So, you want a user progress, not character progress. 为了证明我理解这个问题。你想保存数据,但不是在一个单一的世界,你想要这样的东西:如果你,例如,达到10级或什么,你可以改变到一个不同的世界,在那个世界里,你产卵与10级,你在其他世界达到,正确的?所以,你想要的是用户的进步,而不是角色的进步。 Yes. But to be precise, it is the same as the official character skill tree. Because the mod I created is Wanda's skill tree mod. I found that it cannot be saved to other worlds, and every time a new world is created, the skill tree needs to be re lit. Link to comment https://forums.kleientertainment.com/forums/topic/167791-how-can-the-mod-skill-tree-be-associated-with-accounts-or-stored-locally-on-the-client-side-like-the-official/#findComment-1833911 Share on other sites More sharing options...
FerniFrenito Posted September 3, 2025 Share Posted September 3, 2025 15 minutes ago, Dream Jing said: Yes. But to be precise, it is the same as the official character skill tree. Because the mod I created is Wanda's skill tree mod. I found that it cannot be saved to other worlds, and every time a new world is created, the skill tree needs to be re lit. Yeah, there is probably exists a way to do that. Give me a few hours or until tomorrow to find a solution, ok? Link to comment https://forums.kleientertainment.com/forums/topic/167791-how-can-the-mod-skill-tree-be-associated-with-accounts-or-stored-locally-on-the-client-side-like-the-official/#findComment-1833914 Share on other sites More sharing options...
FerniFrenito Posted September 3, 2025 Share Posted September 3, 2025 (edited) I found a solution: Since you are in a server, the things executed do it in the server "computer". In that computer doesn't exist your String saved with TheSim:SetPersistentString(...) BUT your string exist in your computer, "your sim". So, you only need to execute TheSim:GetPersistentString(...) in the client side. Now, how do you can do that? with RPC calls: (The text follows here because hello everynyan is so big) Make the RCP: local function ReciveTheStringFromTheClientAndSaveItInServer(player, data) print("I'm not your computer and the data is: "..data) print("Now i save the data in a computer far far away") TheSim:SetPersistentString("archiveServet.txt", data) -- That's TheSim of the server end AddModRPCHandler("DebugToolsTest", "ResponseToTheServer", printInTheServer) -- DebugToolsTest is the name of my mod, is complex explain what is a namespace. Just make sure it's unlikely anyone else will use the same name. That's why the Klei developer recommends using it as the name of your mod. local function SearchTheStringSavedInClientAndSendIt(player) TheSim:GetPersistentString("archive.txt", function(ls, str) -- That's TheSim of the client print("I'm your computer and the data saved in me is: "..str) print("Sending to a computer far far away...") SendModRPCToServer(GetModRPC("DebugToolsTest", "ResponseToTheServer"), str) end) end AddClientModRPCHandler("DebugToolsTest", "Test", SearchTheStringSavedInClientAndSendIt) -- Warning: for some reason AddClientModRPCHandler() not support anonymous functions Warning: I don't know if all of that is necessary because i don't know if the code is executed in the server or in the client, bear me please, I learned client-server communication with RPC 30 minutes ago. Well, the basic logic is: The server sends a request to the client to execute SearchTheStringSavedInClientAndSendIt() which get the saved string in your computer, next the client send a response to the server with the string and the server handle it executing ReciveTheStringFromTheClientAndSaveItInServer() which get the string and save it in the computer of server, so the next time you join the server, if you execute TheSim:GetPersistent bla bla bla you can get the string without having to call the client back to get it. Obviously, if there are changes to that string in the client, you'll have to call the client again. Warning 2: i don't know why that works even though a error that i underline with blue. Now, if you want to save any progress "globaly" (define "globaly" as that progress can load in any server) you need to save the progress in the client, not in the server, you need communicate with the client (your computer) and save the progress there. I illustrate what is (I think) happening with this diagram (Assuming the code works like a API): And that's all. I hope it has been helpful. (Sorry for my bad english, i not speak english well and it's 1 a.m.) Edited September 3, 2025 by FerniFrenito Link to comment https://forums.kleientertainment.com/forums/topic/167791-how-can-the-mod-skill-tree-be-associated-with-accounts-or-stored-locally-on-the-client-side-like-the-official/#findComment-1833919 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now