Using the Call of Pripyat SDK
A tutorial brought to you by Beacon, creator of CoP: Redux.
Welcome once more to a tutorial on the joys of modding for S.T.A.L.K.E.R. Call of Pripyat!
Today I'll be talking about something brand new, the CoP Software Development Kit.
The generous guys on the STALKER Dev Team at GSC Game World have graciously given us a wonderful Christmas/New Years present - the SDK for Call of Pripyat!
1: What is it?
Simply put, the SDK or Software Development Kit, is the set of tools that the developers of STALKER used to make the game.
It contains the following modules:
- Actor Editor
- Dialogue Editor
- Level Editor
- Particle Editor
- Post-process Editor
- Shader Editor
Each of these is used to modify different parts of the base game, and for this tutorial we'll be focusing on the Level Editor.
2: Download and Setup.
First thing you'll want to do is download the SDK installer, but the official link from GSC is terribly slow so you'll want to use this much quicker link.
Once downloaded, install it to the default directory (should be C:\Program Files\X-Ray CoP SDK or suchlike).
Next, if you already know what level it is you're looking to edit within the Level Editor, find its folder within the 'resources' folder in your CoP directory (resources/unpacked/levels/) and copy it into your SDK Root/editors/gamedata/levels/ folder, then copy the two files from within that level's terrain folder into the SDK Root/editors/gamedata/textures/terrain folder.
Without doing this, A: you won't have a level to import to the editor, and B: you'll be missing the ground textures of your level!
3: Setting up the level converter.
The next thing we need to do is convert the level you want to edit from the game format to the level editor format - to do this we need a tool developed by some great Stalker modders, to whom we are eternally grateful!
1: Download the converter tools then extract fsconverter_cop.ltx, converter.ini and converter.exe to your SDK Root/editors folder.
2: Rename fsconverter_cop.ltx to fsconverter.ltx, then open it in a notepad application (Notepad++!).
3: Find the line beginning with $sdk_root$ and replace c:\program files\X-Ray CoP SDK\editors\ with the correct directory for your PC - mine for instance is C:\Program Files (x86)\X-Ray CoP SDK\editors\
4: Edit converter.ini again with a notepad application, then scroll almost to the bottom of the file and find the line that begins with ; 3870+ - firstly edit the line two below it, beginning with $game_data$ and replace E:\Games\COP\gamedata\ with a link to your CoP SDK's gamedata folder - mine is C:\Program Files (x86)\X-Ray CoP SDK\editors\gamedata\.
Finally, do the same thing with the $game_levels$ line, but add '\levels' to the end, e.g C:\Program Files (x86)\X-Ray CoP SDK\editors\gamedata\levels\
4: Using the level converter.
Now we can go about the process of actually converting levels for use in the Level Editor!
Go to your start menu and type 'cmd'.
This should open up a black command prompt box, into which you need to type 'cd ~SDK Directory leading to the editors folder~
This takes you into the 'editors' folder of the SDK Root, meaning we can now launch the converter.
Type the following into the command prompt box:
converter -level cop:pripyat -mode le -with_lods
Let's run through this command for an idea of what it does;
- 'Converter' tells the PC what to run, in this case the 'converter.exe' in your SDK/editors folder.
- '-level cop:pripyat' tells the converter application to convert the Pripyat level using the settings in the CoP part of the converter.ini.
- '-mode le' tells it to convert it for use in the Level Editor.
- '-with_lods' tells it to also convert the lods, enabling you to later recompile the level.
Simple enough, right?!
To convert other levels, simply replace 'cop:pripyat' with 'cop:levelname' where 'levelname' is obviously, the name of the level you want to convert!
Having inserted this command, the program should begin running and start converting your level - this will take a bit of time, especially the converting of lods.
Once finished, your level will be ready for use in the SDK Root/editors/rawdata/levels folder!
5: The Level Editor.
Now we get to the more interesting part - actually editing a level.
Navigate to your SDK Root/editors folder and proceed to launch '!LevelEditor.cmd' - launching the LE through any other method will lead to problems, so make sure to use this .cmd!
The Level Editor will start up, and eventually you'll get your first look at the editor's workspace.
Controlling the Camera:
Movement is done via the use of the Shift key and your mouse buttons:
- Shift-LMB combined with mouse movement will move the view forward, backward, left, right etc.
- Shift-RMB combined with mouse movement will move the view up and down vertically.
- Shift-LMB+RMB combined with mouse movement will change the view as if you were in an FPS, allowing you to look around.
Look to the top-right, click the 'file' button, and hit 'load' - then select the level you've converted, and the LE will load it into the workspace.
This is the Edit Mode tab, over on the middle-right of the screen.
Here you can choose what parts of the map you would like to see, and edit.
The eye icons to the left of each selection show what you can see of the map - when these are shown, you can see that part, and when they're not, you can't!
To the right of the eye icons are little checkboxes - to be able to actually edit the part you want, it has to be selected - this is done by selecting it's checkbox (as you can see, 'Object' is currently selected.
So, let me run down the most important/interesting parts of this box:
- Object - this basically represents the majority of the level - the terrain, most buildings etc are all very large models that combine together, and this allows you to select them. It is also used to add/modify smaller objects to/in the level such as vehicles.
- Spawn Element - this is everything from items in the level to smart-terrains. Things that are spawned into the game come under this, and it allows you to add/edit small items on the level, anomalies, smart covers etc.
- Way Points - pretty self-explanatory, these are the waypoints in the level that tell NPCs or artifacts where to move.
- AI Map - this is a huge surface covering the entire level that tells NPCs where they are able to move - it makes sense when you look at it, telling them which way they can go to get around obstacles, up stairs, etc.
This is the editing toolbar in the top-left of the screen. It's very important!
From left to right:
- Undo - Also available with the hotkey 'Ctrl-Z'
- Redo - Also available with the hotkey 'Ctrl-Y'
- Select - You need to select objects, spawn elements etc. before you can move/edit them, so use this to click on things and select them!
- Add - You use this after selecting an object in the bottom right, then clicking in the level somewhere to add it.
- Move - Simple enough, allows you to move things around (as long as they're selected in the Edit Mode box!).
- Rotate - Again, simple. As above, but for rotation.
- Scale - And again! This lets you scale up/down objects.
- Lock to X - Locks the object to the X-Axis, allowing movement/rotation only on that axis.
- Lock to Y - As above, but for the Y-Axis.
- Lock to Z - As above, but for the Z-Axis.
- Lock to Z/X - This seems to allow you to drag things along, a sort of 'lock to terrain' button.
And there, we go, that's the basics of setting up and using the SDK to open a converted level from Call of Pripyat!
I hope this has been helpful, and may you go out and create some awesome stuff with its help!
'Till next time, keep safe brothers!
Creator of Call of Pripyat: Redux