Author Topic: [Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)  (Read 5106 times)

0 Members and 1 Guest are viewing this topic.

Shcherbyna

  • Sergeant
  • *
    • YouTube - https://www.youtube.com/channel/UCacNK79Fo2tcT1HgMpQQc7A
    • View Profile
    • Profile
  • Faction: Bandit
[Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)
« on: December 16, 2014, 04:17:15 PM »


(click to show/hide)


Ru-board: http://rusmnb.ru/index.php?topic=19691.0
Repository: https://bitbucket.org/Shcherbyna/mb-warband-api

New in ver: 1.165.0

+ Support M&B module system v1.165
+ New plugin command: Command Palette ⇒ cb (MB Warband API: Clear Bytecode (*.pyc))
+ Plugin install via Package Control


Features:

+ Scripting speed +50
+ Operators auto complete
+ Auto set warband syntax when open module_system file
+ Syntax highlight
+ Highlighting of missed coma at the end of op-tuple
+ F1 help (en|ru):
   - en-help by Lav & sub authors http://forums.taleworlds.com/index.php/topic,213060.0.html
+ Module system builder:(set the path to the module system folder: Preferences> Package Settings> MB Warband API> Settings - User)
    - F7 - build current file
    - Ctrl+F7 - build full module system. For cleaning *.pyc-files after full_module_building (Ctrl+F7), copy del.py to module_system folder and edit build_module.bat:
Quote from: build_module.bat
...
...
@del *.pyc
python del.py
...
...

OR just edit build_module.bat (-B = don't create bytecode):
Quote from: build_module.bat
...
@echo off
python -B  process_init.py
python -B  process_global_variables.py
python -B  process_strings.py
python -B  process_skills.py
...
...


Structure operator:
   
Quote
new_script
    # "script_name"
    # Description
    # Input: none
    # Output: none

    ("name",
     [
        |
     ]),


Block operators shortcuts:

(click to show/hide)

Install:

   
    1. Download, install Sublime Text 3 http://www.sublimetext.com/3
    2.1. Auto download and install plugin via PacketControl: Preferences > PackageControl > PackageControl:Install Package > MB Warband API
          or 2.2. manual unpack plugin to SublimeText3\Data\Packages\MB Warband API\..
    3. Restart Sublime if need
    4 To change the Help Language edit Preferences > Package Settings > MB Warband API > Settings - User

Plugin Activation:

* Plugin v1.158.1+ will auto activate when module file opened. Hand activation must be in case of creating new module file.

    1. Open module_system file or create new one
    2. Switch to MB Warband API syntax:
        a) Tools > Command Pallete[Alt+~] => mb
        b) or View > Syntax > MB Warband API

Keys & Commands:

    [F1] - show module_system operator's help
    [F7] - build current module_file
    [Ctrl+F7] - build full module_system
    [Alt + ~] - show Command Palette
    Command Palette ⇒ cb (MB Warband API: Clear Bytecode (*.pyc)) - clear all *.pyc files in module_system folder

« Last Edit: February 17, 2015, 04:28:19 PM by Shcherbyna »

HyperCharge

  • Modification Area Moderator
  • *
  • I am Uthred, son of Uthred
    • Twitch.tv - Hypercharge
    • YouTube - HyperDMG2
    • View Profile
  • Faction: Neutral
  • MP nick: Çaktırma
  • WBNWWF&SVC
Re: MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #1 on: December 16, 2014, 05:23:01 PM »
 :shock:

Nice idea.Thank you Shcherbyna  :)

Ikaguia

  • Grandmaster Knight
  • *
  • Defender of the Potato cult.
    • Skype - Ikaguia
    • Steam - Ikaguia
    • Twitch.tv - Ikaguia
    • View Profile
  • Faction: Sarranid
  • MP nick: Ikaguia
  • WBWF&SNW
Re: MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #2 on: December 16, 2014, 07:58:21 PM »
I wish this was for N++, whatever, great job mate!

Sorry for my poor English, I'm Brazilian.

Reus

  • Sloppy Dabber
  • Global Moderator
  • *
  • Sloppy Developer
    • View Profile
  • Faction: Bandit
  • MP nick: Reus
  • M&BWBNWWF&SVC
Re: MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #3 on: December 16, 2014, 08:26:43 PM »
Wow, really nice! Definetly gonna be helpful.
Quote from: Jackson 💯💯💯
I'm three quarters Parabellum on my mother's side.

Shcherbyna

  • Sergeant
  • *
    • YouTube - https://www.youtube.com/channel/UCacNK79Fo2tcT1HgMpQQc7A
    • View Profile
    • Profile
  • Faction: Bandit
Re: MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #4 on: December 16, 2014, 08:40:53 PM »
I wish this was for N++, whatever, great job mate!
Before this time N++ was my favore code editor.. But when Projects consisted of more than a dozen files, and between them have to constantly switch, I switched to Sublime with his side bars, python-based plugins, multiline editing, others nice features and no regrets.

Cheers =)

Ikaguia

  • Grandmaster Knight
  • *
  • Defender of the Potato cult.
    • Skype - Ikaguia
    • Steam - Ikaguia
    • Twitch.tv - Ikaguia
    • View Profile
  • Faction: Sarranid
  • MP nick: Ikaguia
  • WBWF&SNW
Re: MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #5 on: December 17, 2014, 03:10:24 AM »
seems to be a very nice program, that sidebar is exactly the kind of thing I miss in N++, but, where are those littles + and - to show/hide the stuff? :P

edit: oO found them, this is so cool, thanks for sharing it mate
« Last Edit: December 17, 2014, 04:12:15 AM by Ikaguia »

Sorry for my poor English, I'm Brazilian.

Shcherbyna

  • Sergeant
  • *
    • YouTube - https://www.youtube.com/channel/UCacNK79Fo2tcT1HgMpQQc7A
    • View Profile
    • Profile
  • Faction: Bandit
Re: MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #6 on: December 17, 2014, 09:39:31 AM »
Yes.. Sublime3 + MB API plugin is a new level of Warband Scripting =) Is [MUST HAVE] convenience and speed.

The plugin has a simple realisation based on snippets, so do not even require knowledge of Python to edit or add new staff such as new langs, snippets, syntax colors, etc:

mb_warband_api.py - F1-help functions (show F1 window, insert selected operator)
warband_api_help_en.json - EN help data base
warband_api_help_ru.json - RU help data base
val_sub.sublime-snippet - operator snippet
mb_warband_api.JSON-tmLanguage - source of syntax colors
mb_warband_api.tmLanguage - syntax colors (compiled)


For example a new structure operator new_script which unfolds to:

    # "script_name"
    # Description
    # Input: none
    # Output: none

    ("name",
     [
        |
     ]),

is snippet:
Quote from: new_script.sublime-snippet
<snippet>
    <content>
<![CDATA[# "script_${1:name}"
# ${2:Description}
# Input: ${3:none}
# Output: ${4:none}
("${1}",
 [
    ${5}
 ]),
]]>

   </content>
    <tabTrigger>
new_script</tabTrigger>
    <scope>
source.mb_warband_api</scope>
    <description>
Script STRUCTURE</description>
</snippet>

« Last Edit: December 17, 2014, 11:58:23 AM by Shcherbyna »

BNS Marko

  • Q&A Lover
  • Moderator
  • *
    • Steam - markalone
    • Twitter - BadNameStudios
    • Twitch.tv - badnamestudios
    • YouTube - UCYSn5Pt6U6Aro-6_bSNWDgA
    • View Profile
    • Star Wars: Bear Force II
  • Faction: Nord
  • MP nick: BNS_Marko
  • WBNWM&BWF&SVC
Re: MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #7 on: December 31, 2014, 08:57:43 AM »
Well this made me download Sublime 3; no regrets!
I love the sidebar.

Shcherbyna

  • Sergeant
  • *
    • YouTube - https://www.youtube.com/channel/UCacNK79Fo2tcT1HgMpQQc7A
    • View Profile
    • Profile
  • Faction: Bandit
Re: [Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #8 on: February 17, 2015, 04:39:24 PM »
v1.165.0 up

+ module  system v1.165
+ plugin command to clean *.pyc
+ plugin moved to repository, so now it available for install via Package Control.
[!] If you have a previous version of plugin in SublimeText3\Data\Packages\MB Warband API - remove it manually and install new version via Package Control (see first topic).

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: [Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #9 on: February 17, 2015, 06:12:46 PM »
great plugin for Sublime! Thx!

DerGreif

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • WBVC
Re: [Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #10 on: April 02, 2015, 02:32:45 PM »
Will this also work with Lav's WRECK? I am thinking of moving to Sublime (currently using notepad ++), but I am using Lav's integrated module sys (WRECK), because the compilation time is so much faster, which allows for easy testing between builds. Lav introduced a few minor modifications to the sytax. Will that be a problem?
   

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: [Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #11 on: April 02, 2015, 02:46:35 PM »
Will this also work with Lav's WRECK? I am thinking of moving to Sublime (currently using notepad ++), but I am using Lav's integrated module sys (WRECK), because the compilation time is so much faster, which allows for easy testing between builds. Lav introduced a few minor modifications to the sytax. Will that be a problem?

@DerGreif: I am using WRECK for my plugins and it works fine, as it still uses WBScript and all the header_operations commands.

I expanded it to include my own extensions (WRECK feature allows us to create new 'fake' operations) quite easily thanks to Sublime and @Shcherbyna.

Say you create a new operation to do a try_range for companions filtered by only the ones in you party: (try_for_companions_in_party, <destination>). You add it to the plugin and it will work with all the cool shortcuts and colour code!

Cheers

DerGreif

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • WBVC
Re: [Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #12 on: April 03, 2015, 02:18:48 PM »
@DerGreif: I am using WRECK for my plugins and it works fine, as it still uses WBScript and all the header_operations commands.

I expanded it to include my own extensions (WRECK feature allows us to create new 'fake' operations) quite easily thanks to Sublime and @Shcherbyna.

Say you create a new operation to do a try_range for companions filtered by only the ones in you party: (try_for_companions_in_party, <destination>). You add it to the plugin and it will work with all the cool shortcuts and colour code!

Cheers
Great! Thank you for the quick answer!
   

Hz. Whitehead

  • Squire
  • *
  • Animator
    • Steam - huso413
    • YouTube - UCLAyF91FJ2Lx9q_O5_XSheA
    • View Profile
  • Faction: Nord
  • MP nick: Lisa
  • WBWF&SNW
Re: [Plugin] MB Warband API (Sublime Text 3 Syntax Plugin)
« Reply #13 on: July 30, 2017, 03:14:41 PM »
Thanks.  :party: