What you need:
- LiF:YO Client
- HeidiSQL on your local game computer
- LiF:YO Dedicated Server
- Know how to properly set up a custom map on the dedicated server
- Know how to operate the dedicated server with multiple world IDs
Prepare the client
At first, create a new world in your LiF game. Note the worlds number that's assigned by default.
If this is your first world ever created in single player mode, it will be World 1. In this example it is World 15 for me.
Load up the game so that you're in the character creation screen. Then exit the game.
Prepare the server
Now you take your dedicated server and setup the custom map that you want to convert. Use the exact same World ID for that server - 15 in my case. So in the server config directory, I created a world_15.xml and assigned <ID>15</ID>. The server executable will be launched with the -worldid 15 command-line argument.
Follow all instructions from FeudalTools to properly setup the custom map so that you would be able to join and play on the server. Then shut it down.
Export the database to a SQL file, i.e. using HeidiSQL. Right click the lif_ database and export:
Transfer files to client computer
Copy the /data/terrains/cached folder from the dedicated server into your clients /server/data/terrains folder
Copy the /data/navMeshes/cached folder from the dedicated server into your clients/data/navMeshes folder
Also copy the exported database SQL file to your computer
Now we need to cleanse the SQL file from DEFINER statements. So open it up in a text editor. I'm using Notepad++ here but you ca use the default windows notepad/editor. Use the search function to find the first DEFINER= statement. Since you might be using different usernames in for your dedicated server, you'll maybe find something different than "root"@"localhost" in that statement.
Anyways, copy the full definer=...@... and use the replace function of the text editor to replace all occurrences of this with an empty space, so they get vanished from the file (see screenshots). Then save it.
Inject database to savegame
Now back into the LiF game client, load up the new world once again until you're in the character selection screen. Tab out of the game and open HeidiSQL on your computer. Connect to the local database using these connection information:
Type: MySQL (Named Pipe)
Socket Name: LiFMariaDBPipe
User: root
Password: LiFroot
Open the existing lif_ database, then select and drop (delete) all the tables and functions in it.
Now that it is empty, import (run) your exported database file from the dedicated server.
When done, enter the user management in HeidiSQL.
Select the ::1 entry of 'root' and change the ::1 to "allow access from anywhere"
Once that's done, shut down both HeidiSQL and the Game.
That's all. Now restart the game and see if your world works.
If you want to package it for others, you need to zip the cached terrains, cached navMesh, world XML and world database from /server/config/ folder for your World's ID. See the contents of the existing downloadable savegames for reference.
It's not limited to new maps. You can use this method to convert any existing server to a single player savegame.
Feel free to message me download links of savegames if you want them to be added to FeudalTools