Turok 2 API
Author: Behemoth Programmer
Turok Forums Thread: https://www.turokforums.com/index.php?topic=339.0
Turok Sanctum Download: https://turoksanctum.com/download/turok-2-api/
AngelScript IDE with coloring and auto completion to help you with your Turok 2 mods!
1. Download CodeLite 9.0
- Download CodeLite 9.0: https://sourceforge.net/projects/codelite/files/Releases/codelite-9.0/
- You cannot use any newer version (at 10.0 as of now) as the auto complete will not work correctly.
2. Download Turok2API_Scripts
- Download Latest update of the Turok2API_Scripts: https://turoksanctum.com/download/turok-2-api/ (Includes Help File)
- or download all in one file at https://pastebin.com/raw/uNeagYHG (save contents as Turok2API_Scripts.cpp)
3. Install and launch CodeLite 9.0
- Launch CodeLite. If it asks to download a compiler just skip it as we don’t need one. (mine was set to Visual C++ 11 by default)
4. Configure CodeLite 9.0:
- Settings→Code Completion→Display and Behavior: Activate “Keep function signature un-formated”, “Display type info tooltips”, “Display function calltip”.
- Settings→Code Completion→Colouring: Enable colour local variables.
- (optional) Settings→Code Completion→Colouring: Enable colour workspace tags, also enable enumerator and macro but leave the rest with default setting.
- (optional) Settings→Code Completion: Configure the rest to your liking. For example, auto-show & case sensitive enabled.
5. Create CodeLite 9.0 Workspace and Project
- Create a new workspace. Do this by going to File->New->New Workspace menu and select a C++ Workspace. Name is as you like and set the workspace path as you like.
- Create a new project in the workspace. Do this by right-clicking on the workspace in the list to the left and choose the “Create New Project” option. Select others → Non-code project. Name as you like and leave rest as default. Leave the compiler and debugger options alone and press Finish.
6. Add the Turok 2 Script API
- If you downloaded the zip package of the Turok2API_Scripts in step 2 then unzip.
- Add the unzipped folder to the project. Do this by right-clicking on the project in the list to the left and choose the “Import Files From Directory” option.
- Browse to the Turok2EX_Scripts folder and select the folder to import. You should also add the *.txt extension to the “file extension to import” text field then press OK.
- If in Step 2 you downloaded the single Turok2API_Scripts.cpp file then right click and select “New Virtual Folder” name it “Turok2API_Scripts” and hit OK. Right click on the folder you just created and select “Add an Existing File…” and navigate to the Turok2API_Scripts.cpp you downloaded.
7. Add in your mods scripts and defs
- Just like in Step 6 you add your own mods scripts into the project by right-clicking on the project in the list to the left and choose the “Import Files From Directory” option.
- Browse to your scripts folder (located in your Steam or GOG Turok 2 folder) select the scripts and defs(if you have this folder) folder to import. You should also add the *.txt extension to the “file extension to import” text field then press OK. (Note: the only file you need to import from the defs folder is any common def scripts you have, the game comes with common.txt, you can remove the other files in that folder as they are not needed, but you might want to keep them for easy viewing later. your choice.)
8. Launching Turok 2 through CodeLite
- Once you have your scripts working with autocomplete you can configure CodeLite to launch Turok 2 by going to Plugins->External Tools->Configure external tools…
- Add a new external tool. Select a tool ID, Name it something like Turok 2. Set the Tool path to your horus_x64.exe. Leave the rest blank. (You may want to check the “Save all files before executing this tool” option)
- Go to Settings->Keyboard Shortcuts and type “external” in the search bar to bring up a list of external tool shortcuts. Select the External Tool ID you gave the Turok 2 executable and set your desired shortcut key to launch the game and test your scripts.
9. Working in Codelite 9.0 Additional Notes
- Workspace->Parse Workspace
- I find that everytime I import scripts in the project I need to select Workspace->Parse Workspace in order to update the auto complete options and fix coloring.
- So if you find your coloring is wrong or auto complete not working select the Workspace->Parse Workspace option to update them both.
- Rename your script extensions to .cpp I’ve found that .txt files do not support the auto complete so renaming them to .cpp will fix this. The only file you can’t rename in the scripts folder is the games main.txt file it must always be named that.
Congratulations you should now have a decent AngelScript IDE with coloring and auto completion to help you with your Turok 2 mods!
Tags: Auto Completion Scripts, IDE, turok 2 EX