Author Topic: MBDev - 0.2 (Updated 5/12)  (Read 8255 times)

0 Members and 1 Guest are viewing this topic.

Thorgrim

  • Cartographic Conquistador
  • Knight at Arms
  • *
    • View Profile
MBDev - 0.2 (Updated 5/12)
« on: September 05, 2006, 07:01:01 PM »
MBDev is a little utility that is designed to help speed up your mod development when doing python scripting.  It is not a stand alone tool, rather it is designed to be used in conjunction with your text editor of choice.


Download - MBDev 0.2

Requires .NET framework:  Download

Version 0.2

- Autocomplete should now allow autocompletion of all operations, ids, constants etc defined in the header and ID files after typing the fourth character.
- Compile should now work correctly (both compile all and compile)
Compile will attempt to compile the minimum nuber of files required for those module files which have changed.



Version 0.1.7

- Highlighted variables auto display their value / declaration in the bottom info bar.  This will display the whole declaration line, including comments etc, which is quite handy for operations etc.
- Fixed some tuple hint problems.
- Can now use enter for auto completion as well as tab
- Pressing up & down while the autocomplete box is open should jump lines a bit less often.

Version 0.1.5

- Fixed a number of bugs (such as one that may have cause MBDev not to open)
- Added most header variables (except operations) to the auto complete lists
- Added a tuple "hint" box at the bottom of the screen.  This displays what value you should currently be entering. (Requires auto completion to be enabled)
- Started Adding Game Menus dialog.  Cant do much with it yet except view the menus you have, what they link to, and double click names to jump to that entry.

Recommended companion editor: Notepad++

Some of the features:

  • Shortcut button to run Mount & Blade
  • Shortcut button to compile your module (uses a "smart" compiler that only compiles the files that have changed)
  • Drop down menu for quick file selection
  • Tool to check for bracketing, and try-end_try errors: These tools can find and highlight the exact location of the error in many cases. 
      Considering try blocks are not checked by the default python compiler, this should be quite handy.
     (Note that these tools may not work with all editors, however they should work with all officially supported ones)
      These are also automatically run on the open file at compile time.
  • Shortcut to open BRFEdit with the BRF containing a highlighted mesh name (requires BRFEdit 0.7.2)
  • Tool to jump to the declaration of a highlighted variable.  Can also jump to declarations of items, menus etc within the other module files.
  • Initial test version of "Auto complete", which allows auto completion of most entities defined in the ID files (items, menus, factions etc), and some header variables .  You can press tab or double click the value to perform the auto completion, or press up and down to change the selection within the list.

Officially supported text editors: Notepad++, Notepad (yes, the standard windows notepad), Notepad2, Sciboo

A few useability points:

When you loose focus on the compiler window it will be minimised.
Clicking it after it auto minimises will expand it again, or if you minimize it yourself you will need to click the little Arrow.
You can freely adjust the compiler window location, for example to place it on the right side of the screen if you prefer.
You can reset the windows location in the options menu.
The "Bind to editor" Option may cause MBDev to not stay on top if you are using a non official editor, so if you are having this problem, or prefer MBDev to be on top of everything, uncheck this option.


The Editor I recommend using with MBDev is Notepad++.  This Editor is the one I use, and so will probably be the most compatible with MBDev.  Notepad, Notepad2, Sciboo have all been confirmed to work too. 

Notepad++ has a ton of great features, such as:

  • Tabs for having multiple files open
  • Configurable Syntax highlighting.
  • Block commenting/un-commenting.
  • Can remember what you had open, and restore it to the exact state you were in last time.
  • Has powerful find, bookmark etc tools

The basic MBDev features should work with other editors if you have something else you prefer using.  However auto completion etc most probably will not.  If you have an editor you really want supported let me know.

If you wish to use something like IDLE or SPE you must type the whole command into the "Default Editor" field.
For example if you wish to use IDLE, use:

"C:\Python24\pythonw.exe" "C:\Python24\Lib\idlelib\idle.pyw" -n -e

Assuming you installed to the default location.


Thanks to Janus for the hosting, and to everyone who has helped test this in its various stages (In particular Winter, Highelfwarrior and Reaper)
« Last Edit: January 21, 2007, 10:11:59 AM by Thorgrim »

Highelf

  • Iyum Farer
  • Grandmaster Knight
  • *
  • Consider this.
    • View Profile
  • Faction: Rhodok
  • MP nick: irc://Stoned_elf!
  • M&BWB
Re: MBDev - 0.1 (6/9) - New tool for scripters
« Reply #1 on: September 05, 2006, 07:11:07 PM »
Well, I've been a guinea pig for this one. :lol:
 I can tell you, if you work with Py.'s alot, you'll love this :)

Really really handy.

Once, again, thank you Thorgrim :P

fisheye

  • Back in Black
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: MBDev - 0.1 (6/9) - New tool for scripters
« Reply #2 on: September 05, 2006, 07:37:23 PM »
 :shock:

O ye godlike maker of modding tools! I am not worthy to post in the same thread!

Iberon

  • Grandmaster Knight
  • *
  • Endut! Hoch Hech!
    • View Profile
  • Faction: Neutral
Re: MBDev - 0.1 (6/9) - New tool for scripters
« Reply #3 on: September 05, 2006, 08:33:59 PM »
This isn't working for me. It was at running fine at first, however it was not minimising with Notepad++. I "cut" the file, thinking that there was somewhere in the Notepad++ directory for me to paste it into but there wasn't. I pasted it back to the desktop where it was before and got an error message. Now whenever I run it I get told there was an error and it had to close. I've re-downloaded the file and it still isn't working.

Invictus

  • Grandmaster Knight
  • *
    • View Profile
    • M&B Russian Community
  • Faction: Bandit
Re: MBDev - 0.1 (6/9) - New tool for scripters
« Reply #4 on: September 06, 2006, 02:48:36 AM »
Maybe it is better to make a new version of UE that works with Python files?
It would be an extremely useful tool.
I could make one myself but I'm busy with university and have no time.

Кто к нам с чем, тот от того и того.

Thorgrim

  • Cartographic Conquistador
  • Knight at Arms
  • *
    • View Profile
Re: MBDev - 0.1 (6/9) - New tool for scripters
« Reply #5 on: September 06, 2006, 04:14:13 AM »
This isn't working for me. It was at running fine at first, however it was not minimising with Notepad++. I "cut" the file, thinking that there was somewhere in the Notepad++ directory for me to paste it into but there wasn't. I pasted it back to the desktop where it was before and got an error message. Now whenever I run it I get told there was an error and it had to close. I've re-downloaded the file and it still isn't working.

Might you have set one of the directories in the options wrong?

I think there is a bit of a bug with that, I'll try fix it and upload a new version tonight.

Edit: Did a quick fix and uploaded it... try download it again and hopefully it should load up ok now.  If not let me know.

Maybe it is better to make a new version of UE that works with Python files?
It would be an extremely useful tool.
I could make one myself but I'm busy with university and have no time.

I have thought about this for a while, and discussed it with other people.  Really, there are not enough advantages with a UE like interface to make it worth it IMO.  For those who are used to scripting it is impossible for an interface like that to be faster to use.  The other problem is that if you parse all the module files, you need to go through and update all that code each time Armagan changes the system even slightly.  MBDev is designed to work even is Armagan makes fairly radical changes to the module system.  Of course there will still be minor things I need to update, but not nearly as much as creating whole new forms for each python file that is added or modified.

Of course a UE like interface would be great for a number of things, and there is no reason I could not add something like it for specific module files at a later date... and I do have that planned.

If there is anything in particular from the UE that you think makes life far easier than doing it in python, let me know.  The main things I have in mind to start with are dialogs, items and possibly troops.
« Last Edit: September 06, 2006, 04:30:07 AM by Thorgrim »

Iberon

  • Grandmaster Knight
  • *
  • Endut! Hoch Hech!
    • View Profile
  • Faction: Neutral
Re: MBDev - 0.1 (6/9) - New tool for scripters
« Reply #6 on: September 06, 2006, 05:38:25 PM »
This isn't working for me. It was at running fine at first, however it was not minimising with Notepad++. I "cut" the file, thinking that there was somewhere in the Notepad++ directory for me to paste it into but there wasn't. I pasted it back to the desktop where it was before and got an error message. Now whenever I run it I get told there was an error and it had to close. I've re-downloaded the file and it still isn't working.

Might you have set one of the directories in the options wrong?

I think there is a bit of a bug with that, I'll try fix it and upload a new version tonight.

Edit: Did a quick fix and uploaded it... try download it again and hopefully it should load up ok now.  If not let me know.


I've downloaded it again and it is still not working, with the same error. As it was working origionally I think that it's my computer, I am just going to try re-installing Notepad++ and any else related.

From what I could see before it stopped working, it looked like a good, helpful tool. Same with the Map Editor and BRFEdit.

Invictus

  • Grandmaster Knight
  • *
    • View Profile
    • M&B Russian Community
  • Faction: Bandit
Re: MBDev - 0.1 (6/9) - New tool for scripters
« Reply #7 on: September 06, 2006, 05:46:35 PM »
@Thorgrim

Exactly! Items, troops and dialogs, maybe party templates and props...
all the things where check boxes and drop-down lists could be used :)
The hardest work for me is editing units and weapon stats as it takes 3/4 time. I do not enjoy it absolutely.
Also item preview would VERY VERY...VERY GREAT feature.

Honestly, I've never used UE so I can't really say what I like there  :oops:
But I always prefer GUI rather than typing most of the things myself.
« Last Edit: September 06, 2006, 05:48:54 PM by Invictus »

Кто к нам с чем, тот от того и того.

Thorgrim

  • Cartographic Conquistador
  • Knight at Arms
  • *
    • View Profile
Re: MBDev - 0.1.5 ( Updated 9/9 )
« Reply #8 on: September 09, 2006, 10:39:37 AM »
Not sure if anyone uses this, but I updated it.

Added a few features and am hosting it on my own site while the repository is down.

Let me know if you find any bugs or have any suggestions.


I've downloaded it again and it is still not working, with the same error. As it was working origionally I think that it's my computer, I am just going to try re-installing Notepad++ and any else related.

I think this should be fixed now.
« Last Edit: September 09, 2006, 10:45:14 AM by Thorgrim »

Leprechaun

  • Private Pyle
  • Grandmaster Knight
  • *
  • That'd be grand.
    • View Profile
    • Imagesavant: Amazing fractals. Not my site, I just like it.
  • Faction: Neutral
  • M&B
Re: MBDev - 0.1.5 (Updated 9/9)
« Reply #9 on: September 09, 2006, 05:15:05 PM »
 :shock: I love you. I just got it working, and downloaded Notepad++, and... wow.

EDIT: Quick question: does the program automatically recognise what module to compile to?
« Last Edit: September 09, 2006, 05:33:46 PM by Leprechaun »

Thorgrim

  • Cartographic Conquistador
  • Knight at Arms
  • *
    • View Profile
Re: MBDev - 0.1.5 (Updated 9/9)
« Reply #10 on: September 09, 2006, 06:19:24 PM »
Yes.  It uses the last modified dates, so it will compile all files that have been modified since the text files were created.  This means it should work with all editors.

But of course Notepad++ is the best... since it can hook into the text window and read exactly where your cursor is for auto-complete etc :)

Edit: Oops, think I missread that.  It uses module_info.py like usual, so as long as you have the module path set right in Options, it will just read that, and it should be fine.
« Last Edit: September 09, 2006, 06:25:46 PM by Thorgrim »

Leprechaun

  • Private Pyle
  • Grandmaster Knight
  • *
  • That'd be grand.
    • View Profile
    • Imagesavant: Amazing fractals. Not my site, I just like it.
  • Faction: Neutral
  • M&B
Re: MBDev - 0.1.5 (Updated 9/9)
« Reply #11 on: September 09, 2006, 07:15:32 PM »
Yeah, you misread it. But you got the edit right. Thanks, it's great.

Iberon

  • Grandmaster Knight
  • *
  • Endut! Hoch Hech!
    • View Profile
  • Faction: Neutral
Re: MBDev - 0.1.5 (Updated 9/9)
« Reply #12 on: September 09, 2006, 07:26:18 PM »
It's finally working (:D) however I get an error message if the file is not in the same folder as the python files, is this intended?

Reaper

  • Regular
  • *
    • View Profile
  • Faction: Neutral
Re: MBDev - 0.1.5 (Updated 9/9)
« Reply #13 on: September 09, 2006, 07:59:38 PM »
it was on the one I messed with but that was pre-release, I don't know if Thorigrim changed it to use paths or not, I haven't had a chance to download it yet, cause I've been away playing Army for the last couple of weeks.
Member since Version .705

Thorgrim

  • Cartographic Conquistador
  • Knight at Arms
  • *
    • View Profile
Re: MBDev - 0.1.5 (Updated 9/9)
« Reply #14 on: September 10, 2006, 03:44:52 AM »
It's finally working (:D) however I get an error message if the file is not in the same folder as the python files, is this intended?

Ahh, you are opening the python files with MBDev?

Your right, it seems MBDev crashes if you try and open anything else, however I had more designed it so that you just open the MBDev exe, then select the module files from the dropdown list, or open other files normally (ie have notepad ++ as the default for opening py files).

I'll try and sort it out in future versions, because the other problem is that each time you open a file using MBDev, it starts a new instance of it, which causes a bit of a problem.  So for now, best stick with just opening the exe.

Glad its working though :)