[Guide] How to convert a custom map to a single player savegame

1
I post this guide on request so you can give it a try if you have the required tools at hand.

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.

Create New World spm_13.jpg Create New World Viewed 13082 times 191.05 KiB

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:

Export Database spm_1.JPG Export Database Viewed 13082 times 114.94 KiB

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.

Remove Definers spm_3.jpg Remove Definers Viewed 13082 times 85.81 KiB
Definers Removed spm_4.jpg Definers Removed Viewed 13082 times 99.08 KiB

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

Local LiF Database spm_7.jpg Local LiF Database Viewed 13082 times 62.74 KiB

Open the existing lif_ database, then select and drop (delete) all the tables and functions in it.

Empty Database spm_14.jpg Empty Database Viewed 13082 times 245.29 KiB

Now that it is empty, import (run) your exported database file from the dedicated server.

Import Database spm_11.jpg Import Database Viewed 13082 times 80.29 KiB

When done, enter the user management in HeidiSQL.
Select the ::1 entry of 'root' and change the ::1 to "allow access from anywhere"

Edit User spm_15.jpg Edit User Viewed 13082 times 106.03 KiB

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.

Done spm_16.jpg Done Viewed 13082 times 117.46 KiB


Feel free to message me download links of savegames if you want them to be added to FeudalTools

Re: [Guide] How to convert a custom map to a single player savegame

2
Great tutorial, however do you know how to fix the heraldic_charges and heraldies tables after exporting the database from heidisql? The collation changes and it needs to be utf8_general_ci for Heraldies to work properly, otherwise guilds cant change their designs. I tried to connect to the LiFMariaDBPipe and change them but you can only connect when the Single Player game is loaded, and I am unable to save the changes to the tables while the server is running. Any help would be greatly appreciated!
cron