The Next Coming - SDL Tools for The Fourth Coming
TnC tools are not using directly the T4c game's datas. Several reasons for this :
- Original datas's are encrypted, decryption "on the fly" is slow.
- As I said in the TODO section, Map files cannot be used directly (there's no link between the sprite ID written on the map file, and the sprite name specified on the sprite's packages)
- The Sound pack file cannot be used directly with the SDL sound library.
First Step : Reencoding the datas
You will need an original copy of the game (distributed freely on the net, try google). The game version does not really matter.
A simple application is provided to reencode all the game's datas : "convertisseur" (see "Download Section" to get it).
You need to convert your data this way : "convertisseur original_path new_path".
Example : convertisseur "C:\games\T4c\Game Files" "C:\TnC\data\"
Note : The destination path must be a valid directory (create it manually).
For your information, the reencoder will :
- Decrypt the sprites files (Every .vsf file will be decrypted and written as a .dec file)
- Decrypt the sound file (T4CGameFile.VSB) and rewrite every sound and music as a stand-alone .wav file.
- Decrypt the maps files (*.map files).
- Reencode the decrypted maps files (to .rmap files) using the "id_list.txt" index file. This file creates a link between the sprite's ID from the map file to the sprite's name (this file is very incomplete).
Second Step : Compiling sources
Initially, the programs have been written with Dev-Cpp under windows.
Open one of the projects "MAPInterface.dev" (demo application, using the MAPInterface class) or "test_NPCManager.dev" (demo application displaying several NPC).
The projects should compile without errors.
To compile the MAPInterface demo application, type : make -f Makefile_map
To compile the NPCManager demo application, type : make -f Makefile_npc
Third Step : Running...
The demo applications will need to access the game's data (strange uh ?). You can change the path to the data on the two main files "test_vsfinterface.cpp" and "test_mapinterface.cpp".
Edit the "PATH_*" variables.
By default, the path to the sprites directory is : "../data/sprites/" and the path to the maps directory is "../data/maps/".
MAPInterface demo :
Run it this way : MAPInterface x_loc y_loc zone.
NPCManager demo :
"x_loc" and "y_loc" are the location on the map (between 0 and 3072).
"zone" should be 0 (worldmap), 1 (dungeonmap), 2 (cavernmap) or 3 (underworld)
Example : to visit Lighthaven (loc 2880, 1083) which is on the map "worldmap" (zone 0), type : MAPInterface 2880 1083 0
- Keypad : Move on the map
- F12 : Screenshot
- Escape : quit
There is no argument needed for this demo.
- 0 (keypad) : Idle animation (well... this is not really an animation.. :p)
- 1 (keypad) : walk animation
- 2 (keypad) : attack animation
- 3 (keypad) : death animation
- Arrows : rotation
- Escape : quit