Hello, fellow modders! I want to humbly present you this tool:
Now, if you haven't heard of Sublime Text 3, it's an awesome, fast and "moddable" text editor, that can be used for free for as long as you want.
This is a "package" - the name sublime uses for its user-made extensions - that aims to bolster your productivity while coding in ck2script.
CK2ide for Sublime Text 3 (Download it from the attached file).
This is a "package" - the name sublime uses for its user-made extensions - that aims to bolster your productivity while coding in ck2script.
Current version (0.2) features:
Syntax Highlighting
Plans for future versions:
Syntax Highlighting
This is the first release, focusing on syntax highlighting -tinting different parts of text in different colors to distinguish at a glance e.g. a trigger section from an effect block. Here is an example:
You just need to enter you game and mod folder paths into a config file, and afterwards, opening any supported mod file will automatically apply the appropriate syntax.
Part of the syntax functionality is that some syntatic errors will be caught on the fly and you'll notice them before having to run the Validator. So if you write "trait genius" instead of "trait = genius" you'll see a pitch black square signalling the error. However, this can't (yet...) caught other types of error like trying to do "culture = catholic".
All text files in /events, /decisions, and /common (with a few unimportant exceptions) are supported. Files in /localisation are also supported but I need to improve the coloring of those. Support for files in /map and /interface will have to wait for a future update.
These are the colors I'm using for the different parts of text. Any suggestion you have in how to improve them is welcome:
Setup instructions:Part of the syntax functionality is that some syntatic errors will be caught on the fly and you'll notice them before having to run the Validator. So if you write "trait genius" instead of "trait = genius" you'll see a pitch black square signalling the error. However, this can't (yet...) caught other types of error like trying to do "culture = catholic".
All text files in /events, /decisions, and /common (with a few unimportant exceptions) are supported. Files in /localisation are also supported but I need to improve the coloring of those. Support for files in /map and /interface will have to wait for a future update.
These are the colors I'm using for the different parts of text. Any suggestion you have in how to improve them is welcome:
- Have Sublime Text 3 already installed.
- Download the attacked .zip file.
- Open Sublime Text 3 and click on 'Preferences' > 'Browse Packages...'. A window (which we will call "Packages" from now on) will open in your explorer.
- Drop the contents of the .zip file (a single folder called "ck2IDE" in the folder/window you opened in step 3.
- You'll see that a new option was added to the topbar menu, called "ck2IDE". click on it and then on the "Settings" option. This'll open the settings file for you to edit.
- Modify only the parts between the ' ' signs. Altering the file in any other way may render it useless. (You can always use ck2IDE -> Restore Settings to return the settings file to its default state) . Between the ' ' enter the path to your ck2 installation, the path where you have your mods and the name of the font you want to use. Note that the font must be installed on your machine and, to make the most out of the syntax highlighting, it should support italics, boldface, and if possible, be monospace.
- Now you're all set. Open one of the supported files and it should color automatically.
- Files take a tiny bit more than usual to open. This is because their location needs to be tested because a different syntax have to be applied to each type of file (decision, files, artifacts, etc. all follow different rules).
- The colors for localisation are not so good, probably. Feel free to suggest a better color pattern.
- If you find any issue that is not in here, please report it in this thread!
- As of 0.2, the color scheme used by the supported ck2 files is a modified version of the default Monokai color scheme. Please tell me here or by PM if you'd like me to add support for other color schemes.
- You can click anywhere in the editing area and use the option "ckwIDE: Go to next error" to move the screen to the next detected syntax flaw.
#Fixes
-Fixed game rules and scripted triggers not being highlighted.
-Fixed some minor "false positive" errors.
-Fixed game rules and scripted triggers not being highlighted.
-Fixed some minor "false positive" errors.
#-Features
-Added "ck2IDE" tab to the topbar menu. For now it only contains options to open the ck2IDE settings file and for resetting its values.
-Added "ck2IDE: Go to next error" option to the contextual menu in the editing area.
-The highlighting when errors occur are now much less intrusive, making actually writing (as opposed to just reviewing files) a much smoother experience.
-The "Toggle comment" feature of Sublime Text 3 now works for all the supported files.
#-Fixes
-Fixes several false positives, including trigger_switch with several types of values, and several decision fields and triggers added in 2.8 to being correctly parsed.
-Badly named on_actions are now reported as errors.
-Added "ck2IDE" tab to the topbar menu. For now it only contains options to open the ck2IDE settings file and for resetting its values.
-Added "ck2IDE: Go to next error" option to the contextual menu in the editing area.
-The highlighting when errors occur are now much less intrusive, making actually writing (as opposed to just reviewing files) a much smoother experience.
-The "Toggle comment" feature of Sublime Text 3 now works for all the supported files.
#-Fixes
-Fixes several false positives, including trigger_switch with several types of values, and several decision fields and triggers added in 2.8 to being correctly parsed.
-Badly named on_actions are now reported as errors.
v0.1: First release
- Add support for the files not already covered
- Improve the localisation colouring
- Add completions, so that e.g. you type 'if', hit enter and the program writes the '= { limit = { } }' part. That should speed up your scripting by quite a bit.
- Adding more error detection
- Adding some misc tools for batch creating files etc.
- Anything you may suggest that is within my (little, but slowly growing) python abilities.
- To @zimxavier , who previously did work on this subject which have been the foundation for this.
- To @zijistark , whose syntax I also had the oportunity to study
- To the Sublime community for answering my noobish questions and the ck2 community for all the info on the wiki and the forums.
- To the devs for the game in the first place and their support to it.
Attachments
Last edited: