Skip to content

CustomGame Encrypt

wezzzyrek1 edited this page Sep 18, 2026 · 1 revision

Encrypting files

A live client reads the custom map and monster files only packed. The same IGC File Encrypt tool that packs Lua UI scripts does it, in two of its modes, picked at the bottom of its window. A third mode, Map number, packs nothing at all - it writes a world number into terrain files and uses no key.

What You edit The client reads Mode Key
map registration Data\Local\CustomMap.xml CustomMap.xdc Standard none
monster registration Data\Local\CustomMonster.xml CustomMonster.xdc Standard none
map and monster scripts .lua under Data\Custom\Scripts\Game\ .gsc Custom maps LuaGameScriptKey
a world's terrain (optional) EncTerrain<n>.att / .map / .obj .xtt / .xap / .xbj Custom maps LuaGameScriptKey

Keep the plain files

The tool only encrypts. Keep your .xml, .lua and terrain files as the working source, and treat what the tool writes as build output.

A client without dev mode deletes every plain .lua it finds under Data\Custom\Scripts\, Game\ included - keep your sources somewhere the client never looks.

The key

Scripts and terrain are packed with a 32-character key, the same as LuaGameScriptKey in the [Lua] section of the GameServer's Data\Plugins\PluginSettings.ini - the server hands it to the client with the plugin packet. A script packed with another key does not load. Terrain packed with another key cannot be read, and the client stops with a file not found error when it opens the world.

The tool keeps the key in its own config.ini, next to the exe:

[Config]
LuaGameScriptKey=<your 32-character key>
ToolDefaultMode=CustomMaps

The LuaGameScriptKey field in the window shows it and writes it back when you change it.

The config files - Standard mode

Pick Standard and drop CustomMap.xml and CustomMonster.xml on the window: they become CustomMap.xdc and CustomMonster.xdc beside them, packed without a key. They cannot take one - the client reads them at start-up, before the server has sent it anything. For the same reason dev mode does not reach them: the client reads only the .xdc, so pack them again after every change.

Scripts and terrain - Custom maps mode

  1. Pick Custom maps at the bottom of the window.
  2. Check the LuaGameScriptKey field matches your server's.
  3. Drag your files - or a whole folder - onto the window, or use Choose file. A folder is walked for .lua scripts and terrain files, and you get one summary at the end.

A .lua is compiled and packed as .gsc. EncTerrain161.att becomes EncTerrain161.xtt, .map becomes .xap and .obj becomes .xbj, next to the originals.

Ship the packed files without the plain ones. Packing the terrain is optional: without the keyed files the client reads the plain ones as always. In dev mode a plain .lua beside a .gsc, and a plain terrain file beside its keyed one, win - so a dev client runs from your working files.

The world number - Map number mode

A terrain file carries the number of the world it was made for, and the client refuses one whose number does not match its name, so a copied world has to be renumbered once:

The tool in Map number mode

  1. Pick Map number at the bottom of the window. The key field goes away with it - this mode has nothing to pack.
  2. Leave the field empty to take the number from each file name - EncTerrain161.att becomes map 161 - or type one to force it. It is the world's own number, the one its folder carries, and it runs 1 to 200.
  3. Drag the world's .att, .map and .obj onto the window, or a whole world folder.

A renumbered file is written under the name that number gives it, the way a world folder names its files: EncTerrain139.att written as map 15 comes back as EncTerrain15.att, and the original stays beside it as EncTerrain139.att.bak. A file that already carries the number, under the name that matches it, is reported and left alone.

No key is involved - the number lives in the client's own terrain header, not behind your script key - and the whole job happens inside CptModule: the tool itself never holds a decoded terrain file, and it refuses one whose header is not the shape its extension promises.

Renumber before packing: the mode takes plain .att, .map and .obj, not the keyed .xtt, .xap and .xbj. Both forms a terrain file ships in are handled - the container an .att or .map usually arrives in, and the plain form - and what comes back is always the plain form, which the client reads just the same.

Which files to encrypt

  • every script in Data\Custom\Scripts\Game\ - the shared Enums, Helpers, Registry, Weather and SkillEffects, and those in Maps\ and Monsters\
  • the terrain files of each custom world, Data\World<n>\EncTerrain<n>.att, .map and .obj, if you want them packed
  • Data\Local\CustomMap.xml and CustomMonster.xml, in the Standard mode

Dropping the whole Game\ folder packs all the scripts in one pass.

Notes

  • The older keyless .lsc - a .lua packed in the Standard mode - still loads for map and monster scripts. Do not keep an .lsc and a .gsc of the same script: the .gsc is taken, and with a wrong key the script then does not load at all.
  • An .xml is packed only in the Standard mode; the Custom maps mode reports it.
  • An empty file is reported as "file is empty" rather than a vague failure.

See Also

Clone this wiki locally