André de Cuyne
Knight
Fujiwara's code rewritten !
If your are interrested in making a translation, see here.
Spanish translation available (for 0.9.4) here !
Thanks to Megale91 !
I am glad to announce that the PyME version 0.9.5a (fixed 0.9.5) is out !
You can download it here.
For french users, here is the link to the french forum PyME board.
This app is designed to edit the Module System, not the other resources of the game.
New features in the version 0.9.5 (and 0.9.5a) ?
Of course :
Version 0.9.5
- Warband compatible : WB MS and mods should be fully editable.
- GUI refunded (partial) : most of the GUI code has been changed for more efficiency, but hasn't changed a lot for the user.
- Internal compiler implemented (only for M&B 1.010 and 1.011): saves time when building a mod.
- '+' limitation removed.
- 'Changes' option added to the help ('?') menu : objects to display the PyME changes also added.
- 'Readme' option added to the help ('?') menu : objects to display the PyME readme also added.
Version 0.9.5a
- Animations window and other bugs fixed.
- Mods importing functions updated.
- New plugin added for compatibility with "Fire Arrow" based mods.
Version 0.9.41a
Version 0.9.4
Most of the GUI bugs have been fixed in the version 0.9.4a.
- Plugin manager implemented in order to work with some mods (like "Form Ranks !").
You can write your own plugins, if you need. - PPF format implemented (PyME Project File format), which is smaller and faster than reading the entire Module System from the disk.
One PPF file is included in the 0.9.41a distribution. It contains the 1.01x Native Module System and is automatically loaded when you create a new project.
PPF files are exported as Module System when you build a mod. - Message watcher window added.
Very usefull for reporting bugs...
Version 0.9.4
- Search functions implemented.
- Lists with movable elements.
- Contextual menu for the lists.
- Contextual menu for the code editors.
- Mods can be compiled without installing Python.
Most of the GUI bugs have been fixed in the version 0.9.4a.
The main window hasn't changed...
Animations windows allows you to change them..
The 'human' and 'horse' buttons are locked for now (you can't change a human anim for a horse one and vice-versa).
They will be unlocked when I'll have the confirmation that mtarini's OpenBrf can add new animation to M&B.
(Those buttons will be replaced by a pop list, and some other items that will allow the integrations of new animations.)
Game menus.
The buttons with an arrow (<>V^) allows you to extend/minimize the window elements to edit better the operation blocs.
Research UI.
Research results UI.
The two windows are the same.
When opening the first (vie the 'Edit' menu), you can enter a string in the corresponding field.
After few second (when you click on the 'Search' button), the windows is modified to present the results (the second picture).
By double-clicking on one item in the results list, you open the corresponding module window.
Items window
It is realizable, like every module window, but enlarging/ reducing components buttons aren't implemented yet.
Placing components in this window was like a super-complicated Tetris. So just imagine the imbroglio...
Troops windows.
You can see the contextual menu, which allows you to move up and down items, cut , copy and paste.
This menu is available for all the list in the PyME (except the main window module list).
Some actions are disposable in the context menu: search, undo, redo, cut, copy, paste, delete and select all.
This menu is disposable for every code editor of the PyME !
The new core can work with Module System for Mount & Blade versions:
- 0.808
- 0.890
- 0.894
- 0.903
- 0.960
- 1.01x
Be sure to read the readme.txt file after installation !
Or just now !
Readme.txt for PyME (Pythonic Module Editor) version D.C.-G. 0.9.5a for Mount & Blade.
To have the best reading comfort, please chose Lucida Console font.
This stand alone program is Fujiwara's work completion.
You can edit the Module System files whith this app, without messing directly with several thousands of lines.
The PyME makes you forget unclosed parenthesis and missing commas errors ! This is due to the simplified syntax of the app code editors.
You can concentrate yourself on programming since the PyME put commas and parenthesis (and brackets, of course) itself.
TABLE OF CONTENT :
------------------
I - INSTALLATION
II - USE
1) First start
2) After the first start
3) Main window
i) Modules list
ii) First button group
iii) Second button group
iv) Third button group
v) 'Exit" button
vi) View menu
vii) Version menu
4) Modules windows
5) Localisation (language)
6) Edit menu
III - WARBAND COMPATIBILITY
IV - WRITING A LOCALISATION FILE
V - PLUGINS
VI - KNOWN PROBLEMS
VII - WHAT'S NEW SINCE 0.9.3 VERSION ?
VIII - LIMITATIONS
IX - REPORTING BUGS/PROBLEMS
X - DISCLAIMER
XI - LICENSE
XII - CONTACTS
I - INSTALLATION :
------------------
- Install the PyME where you want. No Python dependencies, the programm is stand alone.
- If not already done, download and unpack the Module System for Mount & Blade or Warband.
II - USE :
----------
!!! Make a backup of the mod Module System you want to edit !!!
1) First start :
- A warning window appears and tells you that data for Mount & Blade X.XXX isn't configured. Don't panick! Folow the instructions and configure, at least, 'Game path' and 'Module System path'. If you don't, you will not edit the modules properly, and get error messages, and a log file when you will quit PyME.
2) After the first start :
- If you select an unconfigured version of Mount & Blade, PyME will inform you like during the first start.
- Open an existing mod or create a new one (menu 'File', option 'Open Modification' or button 'Open Project' or hit CTRL+M keys; menu 'File', option 'New' or button 'New Project' or CTRL+N keys).
3 Main window :
i) Modules list :
This list is activated once a mod loaded or created.
Its length varies according to the M&B version. Effectively, not all the latest Module System files are present in older versions.
Double-click on a element brings the corresponding window up.
ii) First buttons group :
'New Project' : creates a new mod ; equiv. menu 'File'->'New'
'Open Project' : opens an exisisting mod ; equiv. menu 'File'->'Open Modification'
'Save Project' : saves a mod ; equiv. menu 'File'->'Save' or 'Save as...'
'Build modification' : compiles the mod. Attention ! Only the files on the disk are compiled.
If you want to compile the mod with le latest changes you made, save it before, or check the 'Save before compiling' box in the configuration panel.
When you click on this button, a new window pops up.
The text area on the top is used to display the mod compilation messages.
The three buttons on the bottom allow you to start the compilation, save the log messages in a file, and close the window.
iii) Second button group :
'Open Module' : opens the window to edit module selected in the list.
'Edit Header' : opens the selected module header window.
iv) Third button group :
'Export Module' : exports the selected module in the folder 'Export'.
Attention ! The module is exported 'brutaly', no con firmation wil be asked when overwriting !
'Export All' : do the same as above, but with every module.
v) 'Exit" button :
Its name is meaningfull.
Anyway, the app exits 'brutaly', without any warning or request for saving work.
vi) View menu :
In this menu, you can access the PyME configuration panel, the messages window and the plugins manager..
The configuration panel
This panel allows you to set up PyME in one view.
You can modify the game and the Module System paths (according to the game version), the language that PyME uses, and add or remove helper apps.
Check the 'Copy Native to new mod' box to make PyME automatically copy Native folder content to a new mod, so you don't have to do this yourself.
Check the 'Auto correct '+' bug' box to make PyME automatically correct the 'max_inventory_items + num_equipment_kinds' limitation. (Deprecated function.)
Check the 'Save before compiling' box and the PyME will save the mod automaticaly before compiling it when you click 'Build modification' button.
Check the 'PPF formated mods' box to save/load your mods in the 'PyME Project File' format. This format holds all the necessary Module System elements that the PyME needs in only one file.
This permits you to save disk space, and the mods loading time is greatly improved.
Warning ! The file extension .PPF is automaticaly associated with the PyME during the installation !
If you have other files with the .PPF extension on your system, they will be opened by default with the PyME.
The 'work arround' is to right click on the concerned files and open them with the appropriate program.
However, this file extension association grants you to open the .PPF file with a simple double click.
Check the 'Internal compiler' box to use the PyME internal modification compiling functions.
These functions are Tale Worlds 'process_...' python scripts embeded in one file.
The mod compilation time can be about 1.75 faster !
The internal compiler code is maintained in a separate file (!). It is '[pyme_folder]\extern\modulecompiler.py', where [pyme_folder] is the location where you have installed the PyME.
You can modify this file to improve the its efficientness or fit your needs, since the work I made is essentially 'copy and paste' Tale Worlds code.
But DO NOT IMPORT PYTHON MODULES WICH ARE NOT INCLUDED IN THE PyME, unless you know how to do this.
Warning ! The internal compiler is still experimental !
The messages window :
This window shows the messages outputed by the PyME, debugging informations, loading plugins, errors, etc.
The plugin manager :
In this window, you can chose the plugin(s) needed for the development of your mod.
To have more informations about plugins, see the section IV.
vii) Version menu :
This menu allow you to chose the version of Mount & Blade corresponding to the mod you are working on.
You can see the current Mount & Blade version under the buttons.
Attention ! When the game version is changed, all the mod data is reseted without any user's confirmation. You have to open a mod or create a new one.
4) Modules windows :
These informations are true for most of the windows. Though, some issues I didn't find the solution may alter the functionnalities
described here.
- On the left is the module entries list. Click on one, and the fields on the right fills up.
A right click pops a menu up, which allows the selected element to be move up and down, cut, copied and pasted.
You can drag an element to move it in the list.
- Click 'New' or 'Add' to add a whole new record or elements to a record.
A new module entry is inserted after the selectionned one. If no entry is selected, the new one is appended tho the end of the list.
- If you click 'Save', the current record is added to the records list.
- 'Close' closes the window, the changes made are not discarded, but they aren't save in the module file.
- Hit 'Save & Close' to validate the changes in the module.
- 'Delete' deletes a record or an element in the current record.
If a code editor (ore more...) is present, its contextual menu allows you to cut, copy, and paste text, and to perform researches.
5) Localisation (language) :
You can change the language used in the PyME by simply chosing one through the 'Configuration' menu or the configuration panel.
This takes effect the next time you use the PyME.
To know how to make a localisation file for the PyME, report to chapter III.
6) Edit menu :
'Find' option
When you click on this option, a window appears and allows you to search for character strings.
Find window
Select the module(s) you want to search in in the list on the left, type a the string you want in the field on the right, and click on the 'Search' button.
The process can take few seconds before the results appear in the window.
Result window
The results list is splitted in three columns.
The first gives the names of the modules where the string was found.
The second gives the modules zones.
The third give the exact line/data.
The syntax used in the second column is maybe a bit hard to understand.
Example:
A search for 'player' in native map icons gives this result :
+--------------+--------+--------------------+
| map_icons | 0,0 | player |
| map_icons | 0,2 | player |
| map_icons | 1,0 | player_horseman |
| map_icons | 1,2 | player_horseman |
+--------------+--------+--------------------+
The first line tells us that 'player' was found in 'map_icons'.
The concerned map icon is the first (the first '0' in the second column), and the map icon field is also the first (the secon '0' in the second column, which is the ID).
The string 'player' was alos found in the third field of the first map icon, as indicated on the second line.
Concerning operations blocks, you have to add one to the last number of the entries to obtain the exact line.
To point directly to a line/data, double-click on a line in the result window.
III - WARBAND COMPATIBILITY :
-----------------------------
The PyME is Warband compatible. That means that the PyME can edit Warband Module System like Mount & Blade ones.
But youl will have to 'customize' a bit Warband MS. Don't panic, this is only few lines to correct, and it won't change the compilation of the mod.
- In 'module_animations.py', cut all the 'amf_...' variables and paste them into 'header_animations.py'. Do the same with the 'attack_...', 'cancel_...', 'defend_...' and 'ready_...' variables.
- In 'module_troops.py', ad an indent *before* the sharp character ('#') of every commented line in the functions (stuff begining with 'def').
IV - WRITING A LOCALISATION FILE :
----------------------------------
This is quite simple.
Copy one of the file in the 'lang' folder of the PyME installation folder and rename it like you want, but with the '.lng' extension.
Edit this file and translate each line.
Don't forget to change the first word in the file. This is the name of the language.
The next time you'll use the PyME, you will see this new language in the corresponding sub menu.
V - PLUGINS :
-------------
The plugins for the PyME are designed to help programmers who have changed the structure in the Module System files.
When these programmers add a new function in 'module_troops.py', for example, the PyME is unable to import it and generates errors.
The plugin support is inteded to correct this behaviour, and is mainly a function (or 'static' data such numbers or strings) replacer.
Plugins are Python files containing informations about what causes problems and must be overrided by something else.
You can create your own plugins for the PyME if you see that your new functions or some data crashes the program.
The file extension has to be '.plg.py'.
The file name of the plugin can be anything, but if you give it the exact same name than an existing mod, the PyME will load it automaticaly if you open this mod.
Here folows the code in 'Form Ranks!.plg.py', which is included in this distribution.
Some keywords are used.
"None" signifies that the PyME has to keep the original value for the corresponding key in the data dictionnary.
'$str" means that the data between the double quotes must be treated as a string for replacement. As you can see in the code above, the value of the "debug_point" key starts and ends with with a simple quote('). Do not forget them. The data you want to be a string must be enclosed with double quotes (").
'$float", '$hex", '$int", '$list" and '$long" have the same behaviour than '$str".
PLUGINS MANAGER
In the 'Plugins' window, you can load and unload plugins.
To open this window, go to the menu 'View' and select the 'Plugins' option. Then you can check or uncheck the plugins found by the PyME. Plugins are loaded or unloaded in the check list order when you click on the 'Ok' button.
That means that you can override plugins values if you need. Just create a new plugin and write your changes.
If you load the following 'foo', 'Form Ranks !' plugin will be loaded first, then 'foo' values will override 'Form Ranks !' ones. This is due to the use of the optional container 'dependencies', which contains the names of the other plugins to be loaded first.
If you unload 'foo', 'Form Ranks !' won't be unloaded, unless you uncheck it.
Plugins can't be loaded with a PPF file. You have to open an existing mod Module System to use plugins.
The PyME plugin support is mainly intended to edit the mod 'Form Ranks !' and the mods containing 'Form Ranks !'.
VI - KNOWN PROBLEMS :
---------------------
- UI components aren't all ordered.
- Some windows look bad. They arent (re)ordered yet.
- When editing a Warband mod, the items flags 'itp_type' and 'itp_attach' aren't initialized properly.
The work-arround is to create a project for M&B 1.01x, then open (or create) your Warband mod. And the flags initialisation is correct.
- When you double-click on a line in the serch result list, the module window appears, but components arent enabled and you can't do anything.
Just double-clik again on the result line, or chose an element in the module window entries list to enable the components.
- Since this application is a beta version, it may have bugs that I did not find, so bug report will be wellcome...
VII - WHAT'S NEW SINCE 0.9.3 VERSION ?
--------------------------------------
- Search functions implemented.
- Lists with movable elements.
- Contextual menu for the lists.
- Contextual menu for the code editors.
- Mods can be compiled without installing Python.
- Most of GUI bugs fixed.
- Version 0.9.41a : plugins manager implemented.
- Version 0.9.42 (not published): internal compiler implemented.
- In the map icons window, it is now possible to choose the coordinates or the trigger.
- All module windows are ordered.
- The .PPF file extension is no more automaticaly associated with the PyME during the installation, except on the user's demand.
- Version 0.9.5 : Warband compatibility.
- GUI code corrections.
- View the PyME changes regarding the language.
- View the readme regarding the langage.
VIII - LIMITATIONS :
--------------------
- The commented lines in the Module System are not considered by the PyME when loading mods.
They are simply striped out, and won't be exported.
! ! Attention ! ! Do not insert comments in the operation blocks through the PyME; you will get errors when compiling the mods.
To solve this, I will revise (again) the import/export functions.
- All the Mount & Blade versions listed in the 'Version' menu are (theoricaly) editable, but, only the last ones are exportable (0.960, 1.010, 1.011).
This is due to the format changes of the Module System between its versions.
- If lists or functions are declared on several lines in 'module_constants.py', the PyME can throw errors in the constants window.
Thus, these lists or functions are corectly writen in the file when exported/saved.
You should not edit them in the PyME, but directly in the Module System.
IX - REPORTING BUGS/PROBLEMS :
------------------------------
Report bugs or problems in the 'PyME' topic in 'Unofficial Editing Tools' board of 'The Forge' subforum on Tale Worlds site (www.forums.taleworlds.com) or for french language users in the topic 'EMPy' on the french forum.
Before reporting, please set up the as complete as possible report :
- If a 'pyme.exe.log' is created in the installation folder of the PyME, copy its content in your message.
The PyME will warn you if such a file is created.
- Describe what you did with the PyME (opening/creating a modification, addig/deleting an entry in a list, etc.)
- Indicate the modification name if its Module System is downloadable.
- Please precise if you added functions or classes to the Module System.
Posts like "it does not work, why ?", without any other explanation, will be simply ignored (because I don't have, yet, the power to simply delete them).
The same thing will happen to any post where the author gives the feeling he didn't read this file.
X - DISCLAIMER :
----------------
This application is a beta version and is provided 'as is', you use it at your own risks.
The authors could not be responsible for data loss, hardware harm or any other issues.
XI - LICENSE :
--------------
This application have been written in Python and compiled with py2exe. It includes basic modules of Python and these other ones :
- wx,
- PythonCard,
- PIL,
- ConfigParser,
wich are under GNU-GPL license.
This application is the property of it's authors. It is freely distributed, hoping it can be usefull.
You may use this application for personnal purpose only.
You may not sell or distribute for fee the work done with this application.
You may not sell or distribute for fee this application.
Credit the PyME if you used it to build up all or parts of the modification.
XII - CONTACTS :
----------------
The original author is Fujiwara; you can contact him on the Taleworlds forum (www.forums.taleworlds.com).
The author of the actual version is D.C.-G.; contact on the Taleworlds forum (www.forums.taleworlds.com, pseudo 'André de Cuyne').
The Spanish version translator is Megale91; contact on the TalesWorld forums (www.forums.talesworld.com).
To get news on the PyME, please visit the english topic (www.forums.talesworld.com, section 'The Forge', subsection 'Unofficial Editing Tools', sujet 'PyME') or the french topic (www.forums.talesworld.com, french forum, topic 'EMPy').
To have the best reading comfort, please chose Lucida Console font.
This stand alone program is Fujiwara's work completion.
You can edit the Module System files whith this app, without messing directly with several thousands of lines.
The PyME makes you forget unclosed parenthesis and missing commas errors ! This is due to the simplified syntax of the app code editors.
You can concentrate yourself on programming since the PyME put commas and parenthesis (and brackets, of course) itself.
TABLE OF CONTENT :
------------------
I - INSTALLATION
II - USE
1) First start
2) After the first start
3) Main window
i) Modules list
ii) First button group
iii) Second button group
iv) Third button group
v) 'Exit" button
vi) View menu
vii) Version menu
4) Modules windows
5) Localisation (language)
6) Edit menu
III - WARBAND COMPATIBILITY
IV - WRITING A LOCALISATION FILE
V - PLUGINS
VI - KNOWN PROBLEMS
VII - WHAT'S NEW SINCE 0.9.3 VERSION ?
VIII - LIMITATIONS
IX - REPORTING BUGS/PROBLEMS
X - DISCLAIMER
XI - LICENSE
XII - CONTACTS
I - INSTALLATION :
------------------
- Install the PyME where you want. No Python dependencies, the programm is stand alone.
- If not already done, download and unpack the Module System for Mount & Blade or Warband.
II - USE :
----------
!!! Make a backup of the mod Module System you want to edit !!!
1) First start :
- A warning window appears and tells you that data for Mount & Blade X.XXX isn't configured. Don't panick! Folow the instructions and configure, at least, 'Game path' and 'Module System path'. If you don't, you will not edit the modules properly, and get error messages, and a log file when you will quit PyME.
2) After the first start :
- If you select an unconfigured version of Mount & Blade, PyME will inform you like during the first start.
- Open an existing mod or create a new one (menu 'File', option 'Open Modification' or button 'Open Project' or hit CTRL+M keys; menu 'File', option 'New' or button 'New Project' or CTRL+N keys).
3 Main window :
i) Modules list :
This list is activated once a mod loaded or created.
Its length varies according to the M&B version. Effectively, not all the latest Module System files are present in older versions.
Double-click on a element brings the corresponding window up.
ii) First buttons group :
'New Project' : creates a new mod ; equiv. menu 'File'->'New'
'Open Project' : opens an exisisting mod ; equiv. menu 'File'->'Open Modification'
'Save Project' : saves a mod ; equiv. menu 'File'->'Save' or 'Save as...'
'Build modification' : compiles the mod. Attention ! Only the files on the disk are compiled.
If you want to compile the mod with le latest changes you made, save it before, or check the 'Save before compiling' box in the configuration panel.
When you click on this button, a new window pops up.
The text area on the top is used to display the mod compilation messages.
The three buttons on the bottom allow you to start the compilation, save the log messages in a file, and close the window.
iii) Second button group :
'Open Module' : opens the window to edit module selected in the list.
'Edit Header' : opens the selected module header window.
iv) Third button group :
'Export Module' : exports the selected module in the folder 'Export'.
Attention ! The module is exported 'brutaly', no con firmation wil be asked when overwriting !
'Export All' : do the same as above, but with every module.
v) 'Exit" button :
Its name is meaningfull.
Anyway, the app exits 'brutaly', without any warning or request for saving work.
vi) View menu :
In this menu, you can access the PyME configuration panel, the messages window and the plugins manager..
The configuration panel
This panel allows you to set up PyME in one view.
You can modify the game and the Module System paths (according to the game version), the language that PyME uses, and add or remove helper apps.
Check the 'Copy Native to new mod' box to make PyME automatically copy Native folder content to a new mod, so you don't have to do this yourself.
Check the 'Auto correct '+' bug' box to make PyME automatically correct the 'max_inventory_items + num_equipment_kinds' limitation. (Deprecated function.)
Check the 'Save before compiling' box and the PyME will save the mod automaticaly before compiling it when you click 'Build modification' button.
Check the 'PPF formated mods' box to save/load your mods in the 'PyME Project File' format. This format holds all the necessary Module System elements that the PyME needs in only one file.
This permits you to save disk space, and the mods loading time is greatly improved.
Warning ! The file extension .PPF is automaticaly associated with the PyME during the installation !
If you have other files with the .PPF extension on your system, they will be opened by default with the PyME.
The 'work arround' is to right click on the concerned files and open them with the appropriate program.
However, this file extension association grants you to open the .PPF file with a simple double click.
Check the 'Internal compiler' box to use the PyME internal modification compiling functions.
These functions are Tale Worlds 'process_...' python scripts embeded in one file.
The mod compilation time can be about 1.75 faster !
The internal compiler code is maintained in a separate file (!). It is '[pyme_folder]\extern\modulecompiler.py', where [pyme_folder] is the location where you have installed the PyME.
You can modify this file to improve the its efficientness or fit your needs, since the work I made is essentially 'copy and paste' Tale Worlds code.
But DO NOT IMPORT PYTHON MODULES WICH ARE NOT INCLUDED IN THE PyME, unless you know how to do this.
Warning ! The internal compiler is still experimental !
The messages window :
This window shows the messages outputed by the PyME, debugging informations, loading plugins, errors, etc.
The plugin manager :
In this window, you can chose the plugin(s) needed for the development of your mod.
To have more informations about plugins, see the section IV.
vii) Version menu :
This menu allow you to chose the version of Mount & Blade corresponding to the mod you are working on.
You can see the current Mount & Blade version under the buttons.
Attention ! When the game version is changed, all the mod data is reseted without any user's confirmation. You have to open a mod or create a new one.
4) Modules windows :
These informations are true for most of the windows. Though, some issues I didn't find the solution may alter the functionnalities
described here.
- On the left is the module entries list. Click on one, and the fields on the right fills up.
A right click pops a menu up, which allows the selected element to be move up and down, cut, copied and pasted.
You can drag an element to move it in the list.
- Click 'New' or 'Add' to add a whole new record or elements to a record.
A new module entry is inserted after the selectionned one. If no entry is selected, the new one is appended tho the end of the list.
- If you click 'Save', the current record is added to the records list.
- 'Close' closes the window, the changes made are not discarded, but they aren't save in the module file.
- Hit 'Save & Close' to validate the changes in the module.
- 'Delete' deletes a record or an element in the current record.
If a code editor (ore more...) is present, its contextual menu allows you to cut, copy, and paste text, and to perform researches.
5) Localisation (language) :
You can change the language used in the PyME by simply chosing one through the 'Configuration' menu or the configuration panel.
This takes effect the next time you use the PyME.
To know how to make a localisation file for the PyME, report to chapter III.
6) Edit menu :
'Find' option
When you click on this option, a window appears and allows you to search for character strings.
Find window
Select the module(s) you want to search in in the list on the left, type a the string you want in the field on the right, and click on the 'Search' button.
The process can take few seconds before the results appear in the window.
Result window
The results list is splitted in three columns.
The first gives the names of the modules where the string was found.
The second gives the modules zones.
The third give the exact line/data.
The syntax used in the second column is maybe a bit hard to understand.
Example:
A search for 'player' in native map icons gives this result :
+--------------+--------+--------------------+
| map_icons | 0,0 | player |
| map_icons | 0,2 | player |
| map_icons | 1,0 | player_horseman |
| map_icons | 1,2 | player_horseman |
+--------------+--------+--------------------+
The first line tells us that 'player' was found in 'map_icons'.
The concerned map icon is the first (the first '0' in the second column), and the map icon field is also the first (the secon '0' in the second column, which is the ID).
The string 'player' was alos found in the third field of the first map icon, as indicated on the second line.
Concerning operations blocks, you have to add one to the last number of the entries to obtain the exact line.
To point directly to a line/data, double-click on a line in the result window.
III - WARBAND COMPATIBILITY :
-----------------------------
The PyME is Warband compatible. That means that the PyME can edit Warband Module System like Mount & Blade ones.
But youl will have to 'customize' a bit Warband MS. Don't panic, this is only few lines to correct, and it won't change the compilation of the mod.
- In 'module_animations.py', cut all the 'amf_...' variables and paste them into 'header_animations.py'. Do the same with the 'attack_...', 'cancel_...', 'defend_...' and 'ready_...' variables.
- In 'module_troops.py', ad an indent *before* the sharp character ('#') of every commented line in the functions (stuff begining with 'def').
IV - WRITING A LOCALISATION FILE :
----------------------------------
This is quite simple.
Copy one of the file in the 'lang' folder of the PyME installation folder and rename it like you want, but with the '.lng' extension.
Edit this file and translate each line.
Don't forget to change the first word in the file. This is the name of the language.
The next time you'll use the PyME, you will see this new language in the corresponding sub menu.
V - PLUGINS :
-------------
The plugins for the PyME are designed to help programmers who have changed the structure in the Module System files.
When these programmers add a new function in 'module_troops.py', for example, the PyME is unable to import it and generates errors.
The plugin support is inteded to correct this behaviour, and is mainly a function (or 'static' data such numbers or strings) replacer.
Plugins are Python files containing informations about what causes problems and must be overrided by something else.
You can create your own plugins for the PyME if you see that your new functions or some data crashes the program.
The file extension has to be '.plg.py'.
The file name of the plugin can be anything, but if you give it the exact same name than an existing mod, the PyME will load it automaticaly if you open this mod.
Here folows the code in 'Form Ranks!.plg.py', which is included in this distribution.
Code:
#PLG V1.0 # This signature is not optional. If it is not present, the
# PyME will ignore this file.
"""Form Ranks !"""
# ^^---------- This is used to store the names of the mods that
# this plugin concerns. To specify several names,
# just seperate them like this: """Form Ranks !,My
# Own Form Ranks !,an other mod""".
# Note that you must not use commas in mods names
# and you must not add spaces arround commas which
# separates the names.
# The name and the format of the data contained here can't be
# changed. There must be a dictionary called
# 'data'. The keys must be strings, but the
# values can be anything.
data = {"concatenate_scripts":"""def concatenate_scripts(block_list):
result = []
for block in block_list:
result += block
return result
""", # ^^-- You can enter source code...
"formation_arrays":"None", # or tell thePyME to take the mod's
# value...
"formation_commands_pl_begin":"None",
"formation_default_key_list":"None",
"formation_keys_list":"None",
"formation_order_functions":"None",
"formation_types":"None",
"slot_formation_array_marks_begin":"None",
"slot_party_formation_ai_switch":"None",
"slot_party_formation_keys_begin":"None",
"sfas_speed_base":"None",
"sfas_speed_unit":"None",
"sfas_charge":"None",
"sfas_fall_back":"None",
"sfas_speed":"None",
"slot_formation_tmp_alg_stat_begin":"None",
"slot_formation_array_marks_begin":"None",
"slot_formation_tmp_clustering":"None",
"debug_point":'$str"debug_point"', # or specify what you need.
"sftt_formation_stage":"None",
"sftt_array_no_base":"None",
"sfas_density_base":"None",
"sfas_density_unit":"None",
"sfas_engaged":"None",
"sfas_roar":"None",
}
Some keywords are used.
"None" signifies that the PyME has to keep the original value for the corresponding key in the data dictionnary.
'$str" means that the data between the double quotes must be treated as a string for replacement. As you can see in the code above, the value of the "debug_point" key starts and ends with with a simple quote('). Do not forget them. The data you want to be a string must be enclosed with double quotes (").
'$float", '$hex", '$int", '$list" and '$long" have the same behaviour than '$str".
PLUGINS MANAGER
In the 'Plugins' window, you can load and unload plugins.
To open this window, go to the menu 'View' and select the 'Plugins' option. Then you can check or uncheck the plugins found by the PyME. Plugins are loaded or unloaded in the check list order when you click on the 'Ok' button.
That means that you can override plugins values if you need. Just create a new plugin and write your changes.
If you load the following 'foo', 'Form Ranks !' plugin will be loaded first, then 'foo' values will override 'Form Ranks !' ones. This is due to the use of the optional container 'dependencies', which contains the names of the other plugins to be loaded first.
If you unload 'foo', 'Form Ranks !' won't be unloaded, unless you uncheck it.
Code:
#PLG V1.0
# foo.plg.py
""""""
dependencies = ["Form Ranks !"]
data = {"sfas_speed_base":'$int"25"',
"sfas_speed_unit":'$int"30"',
"sfas_charge":'$int"100",
"sfas_fall_back":'$int"10"',
"sfas_speed":'$int"50"',
}
Plugins can't be loaded with a PPF file. You have to open an existing mod Module System to use plugins.
The PyME plugin support is mainly intended to edit the mod 'Form Ranks !' and the mods containing 'Form Ranks !'.
VI - KNOWN PROBLEMS :
---------------------
- UI components aren't all ordered.
- Some windows look bad. They arent (re)ordered yet.
- When editing a Warband mod, the items flags 'itp_type' and 'itp_attach' aren't initialized properly.
The work-arround is to create a project for M&B 1.01x, then open (or create) your Warband mod. And the flags initialisation is correct.
- When you double-click on a line in the serch result list, the module window appears, but components arent enabled and you can't do anything.
Just double-clik again on the result line, or chose an element in the module window entries list to enable the components.
- Since this application is a beta version, it may have bugs that I did not find, so bug report will be wellcome...
VII - WHAT'S NEW SINCE 0.9.3 VERSION ?
--------------------------------------
- Search functions implemented.
- Lists with movable elements.
- Contextual menu for the lists.
- Contextual menu for the code editors.
- Mods can be compiled without installing Python.
- Most of GUI bugs fixed.
- Version 0.9.41a : plugins manager implemented.
- Version 0.9.42 (not published): internal compiler implemented.
- In the map icons window, it is now possible to choose the coordinates or the trigger.
- All module windows are ordered.
- The .PPF file extension is no more automaticaly associated with the PyME during the installation, except on the user's demand.
- Version 0.9.5 : Warband compatibility.
- GUI code corrections.
- View the PyME changes regarding the language.
- View the readme regarding the langage.
VIII - LIMITATIONS :
--------------------
- The commented lines in the Module System are not considered by the PyME when loading mods.
They are simply striped out, and won't be exported.
! ! Attention ! ! Do not insert comments in the operation blocks through the PyME; you will get errors when compiling the mods.
To solve this, I will revise (again) the import/export functions.
- All the Mount & Blade versions listed in the 'Version' menu are (theoricaly) editable, but, only the last ones are exportable (0.960, 1.010, 1.011).
This is due to the format changes of the Module System between its versions.
- If lists or functions are declared on several lines in 'module_constants.py', the PyME can throw errors in the constants window.
Thus, these lists or functions are corectly writen in the file when exported/saved.
You should not edit them in the PyME, but directly in the Module System.
IX - REPORTING BUGS/PROBLEMS :
------------------------------
Report bugs or problems in the 'PyME' topic in 'Unofficial Editing Tools' board of 'The Forge' subforum on Tale Worlds site (www.forums.taleworlds.com) or for french language users in the topic 'EMPy' on the french forum.
Before reporting, please set up the as complete as possible report :
- If a 'pyme.exe.log' is created in the installation folder of the PyME, copy its content in your message.
The PyME will warn you if such a file is created.
- Describe what you did with the PyME (opening/creating a modification, addig/deleting an entry in a list, etc.)
- Indicate the modification name if its Module System is downloadable.
- Please precise if you added functions or classes to the Module System.
Posts like "it does not work, why ?", without any other explanation, will be simply ignored (because I don't have, yet, the power to simply delete them).
The same thing will happen to any post where the author gives the feeling he didn't read this file.
X - DISCLAIMER :
----------------
This application is a beta version and is provided 'as is', you use it at your own risks.
The authors could not be responsible for data loss, hardware harm or any other issues.
XI - LICENSE :
--------------
This application have been written in Python and compiled with py2exe. It includes basic modules of Python and these other ones :
- wx,
- PythonCard,
- PIL,
- ConfigParser,
wich are under GNU-GPL license.
This application is the property of it's authors. It is freely distributed, hoping it can be usefull.
You may use this application for personnal purpose only.
You may not sell or distribute for fee the work done with this application.
You may not sell or distribute for fee this application.
Credit the PyME if you used it to build up all or parts of the modification.
XII - CONTACTS :
----------------
The original author is Fujiwara; you can contact him on the Taleworlds forum (www.forums.taleworlds.com).
The author of the actual version is D.C.-G.; contact on the Taleworlds forum (www.forums.taleworlds.com, pseudo 'André de Cuyne').
The Spanish version translator is Megale91; contact on the TalesWorld forums (www.forums.talesworld.com).
To get news on the PyME, please visit the english topic (www.forums.talesworld.com, section 'The Forge', subsection 'Unofficial Editing Tools', sujet 'PyME') or the french topic (www.forums.talesworld.com, french forum, topic 'EMPy').