Turok Games > Turok 2 Seeds of Evil Modding/Mapping

Scripting Guide

(1/7) > >>

BehemothProgrammer:
This page will help get you up and running with a decent integrated development environment for AngelScript to be used with Turok 2. The IDE will not be able to check for errors or debug but it comes with coloring and code completion and that last one is important. If you are thinking about working with T2 scripts no matter your skill level, I highly recommend following the instructions below to downloading CodeLite. The following instructions and Turok 2 API scripts were written by BehemothProgrammer.

The original plain script api text file is still located here: https://pastebin.com/kFhBNYqS
I recommend following the instructions below.

Note: All Turok 2 Scripts are currently based on version 1.5.6 of the game.

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.zip

* Download Latest update of the Turok2API.zip file: https://turoksanctum.com/download/turok-2-api/ (Includes Help File)
* Mirror Turok2API.zip file: https://www.dropbox.com/s/oyff8tb6z9klsgm/Turok2API.zip?dl=0 (Includes Help File)
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

* Unzip the Turok2API.zip file you downloaded in step 2.
* 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 Turok2API_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.
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!


Jay Doomed:
Dude! really this is going to save me a bit of time and digging. Thanks a lot which reminds me I still really need to dig in your Wolfenstein Turok kpf files. Madman work. Behemoth Madman 8)

Gazer:
I don't know if this is a question or a thought, do you know where to find lighting variables for the editor? They seem random in studio and some don't have any effect.

Duke64:
Having it written out like that is pretty awesome. Nice job, subject pinned for users to find easy.

BehemothProgrammer:

--- Quote from: Gazer on March 29, 2017, 04:13:19 PM ---I don't know if this is a question or a thought, do you know where to find lighting variables for the editor? They seem random in studio and some don't have any effect.

--- End quote ---
In the properties window panel(F4) under the kexLightComponent Tab. But like most of the things in the editor (at least for now) things don't work or are missing.

Navigation

[0] Message Index

[#] Next page

Go to full version