Difference between revisions of "HPL3/Scripting/Scripting Guide/Setting up CodeLite"
m |
|||
Line 1: | Line 1: | ||
{{Hpl3ScriptingGuideMenuBasic}} | {{Hpl3ScriptingGuideMenuBasic}} | ||
{{shortPageTitle}} | {{shortPageTitle}} | ||
− | |||
__NOTOC__ | __NOTOC__ | ||
− | |||
==CodeLite - Introduction== | ==CodeLite - Introduction== | ||
Line 12: | Line 10: | ||
CodeLite is very much like a text editor, but much more programming-oriented than Notepad++. It is the tool used officially by Frictional Games to develop their HPL3 games. Here are some of the relevant features of CodeLite: | CodeLite is very much like a text editor, but much more programming-oriented than Notepad++. It is the tool used officially by Frictional Games to develop their HPL3 games. Here are some of the relevant features of CodeLite: | ||
− | * '''Code documentation on the fly''' | + | *'''Code documentation on the fly''' |
− | * '''Code autocompletion and smart code suggestion''' | + | *'''Code autocompletion and smart code suggestion''' |
− | * '''Fast and easy way to navitgate through large script files''' | + | *'''Fast and easy way to navitgate through large script files''' |
− | * '''The ability to run the game from CodeLite''' | + | *'''The ability to run the game from CodeLite''' |
For the scripting guide, CodeLite 12.0.0 will be used, which is the latest stable release that can work with HPL3 without any errors or bugs. | For the scripting guide, CodeLite 12.0.0 will be used, which is the latest stable release that can work with HPL3 without any errors or bugs. |
Revision as of 12:06, 7 August 2020
CodeLite - Introduction
As mentioned Scripting in HPL3 can look a lot like regular programming, but less complicated.
Because of that, we need tools that will be able to aid us when we write our code. For HPL2, Notepad++ or even Notepad were enough for that. This time around, something more powerful is needed.
CodeLite is very much like a text editor, but much more programming-oriented than Notepad++. It is the tool used officially by Frictional Games to develop their HPL3 games. Here are some of the relevant features of CodeLite:
- Code documentation on the fly
- Code autocompletion and smart code suggestion
- Fast and easy way to navitgate through large script files
- The ability to run the game from CodeLite
For the scripting guide, CodeLite 12.0.0 will be used, which is the latest stable release that can work with HPL3 without any errors or bugs.
Setting-up CodeLite
- Download CodeLite version 12.0.0.
- Launch CodeLite and configure:
Settings → Code Completion → Display and Behavior
: EnableKeep function signature un-formated
.Settings → Code Completion → ctags → Search Paths
: ClickAdd...
, navigate to the Rebirth game folder and select thescript/
folder.Settings → Code Completion → Colouring
: Enablecolour local variables
.- (optional) Settings→Code Completion→Colouring: Enable colour workspace tags, also enable enumerator but leave the rest with default setting.
- (optional) Settings→Code Completion: Configure the rest to your liking. For example, auto-show & case sensitive enabled.
- Settings→Colours and Fonts→Customize, select C++ and in Global Settings add *.hps to the File Extension list.
- Create a new workspace. Do this by going to Workspace menu and select "New Workspace…". Pick C++ Workspace. Name is as you like and set the workspace path as you like as long as it is on the same drive as SOMA.
- 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.
- Add one folder to the project. Right-click on the project folder and choose New Virtual Folder. Name it _api (you can create others later when you know more).
- Time to add files to the project.
- Right-click on _api and Add An Existing File, add the file "SOMA GAME FOLDER LOCATION/hps_api.hps" (might need to launch the game executable one time to have this file created).
- Right-click on the project in the list to the left, pick Import Files From Directory. Navigate to the SOMA GAME FOLDER and select it. In the next window, check the boxes for maps and scripts and make sure that the *.hps file extension is present in the list of extentions to import. Click OK.
That should be it, you should now have three top folders in your project and a lot of sub-folders with various script files. Hps files should be color coded and parsed for completion as you open them in the project. If they do not, you can re-tag the workspace, project or the single file to see if it helps.
Start typing something, for example Entity (depending on configuration this can be case sensitive!) and a drop down should appear showing all the functions that begin with Entity and the documentation for each selected function. You can force things to appear using these shortcuts:
- ctrl-space will bring up the completion drop down.
- ctrl-shift-space will bring up hints when inside the () of a function.
Issues & Info
- Write Class@ object and not Class @object, the later will screw up coloring.
- If you loose all coloring and can't get it back, just re-tag the workspace.
- Parameters with &in will break coloring of parameter, but will have no other side-effects.
Extra Info
Info about Settings→Colours and Fonts→Customize→Styles→Edit Lexer keyword sets, Set 0 to Set 4:
- Set 0 User configured list of keywords not already parsed. Can be edited.
- Set 1 Unknown.
- Set 2 Doxygen keywords, words here will be colored in comments using /** codeblocks when prepended with @ ie @var int myInt. Can be edited.
- Set 3 Used for the setting "Colour workspace tags", automatically created (not visibly). Can NOT be edited.
- Set 4 Used for the setting "Colour local variables", automatically created (not visibly). Can NOT be edited.