Copyright: Help for "ERM Scripter" (28.01.2003)


 ERM Scripter

Introduction

...

Table of contents

Main interface:

File   Edit   Search   Options   Service   Tools   Window   ?

Others:

Hotkeys

Contacts


Contacts

"New Life of Heroes" in WWW:

http://www.strategyplanet.com/homm/wog/

Mail to "New Life of Heroes" team:

h3nl@narod.ru

zvs@mail.ru

Mail to "ERM Scripter" author:

Alexander Trifonov <craghack@bk.ru>

New version of ERM Scripter:

http://heroes.diaspora.ru/hmm3/addon/public/erm_s.zip

New version of ERM Help:

http://heroes.diaspora.ru/hmm3/addon/public/ermhelp.zip


Hotkeys

Main window

File

Ctrl+N	New document
Ctrl+O	Open document
Ctrl+Alt+R	Reopen file
Ctrl+Alt+Q	Reopen current text document as table
Ctrl+S	Save document
Ctrl+P	Open "Print" dialogue
Alt+F4	Exit
Edit

Ctrl+Z	Undo
Ctrl+Alt+Z	Redo
Ctrl+X	Cut
Ctrl+C	Copy
Ctrl+V	Paste
Ctrl+D	Delete
Ctrl+A	Select all
Search

Ctrl+F	Fined
F3	Fined next
Ctrl+F3	Fined previous
Ctrl+R	Replace
Options

Ctrl+Alt+P	Open "Settings" dialogue
Service

Ctrl+Alt+S	Open "Syntax Browser" window
Ctrl+Alt+I	Open "About document" window
Ctrl+Alt+V	Open "Analyzer" window
Ctrl+Alt+E	Open "Edit information about document" dialigue
Ctrl+Alt+G	Open "Go to" dialogue
Ctrl+Alt+C	Open "Clipboard manager" window
Ctrl+Alt+Ins	Open "Select Fast Insert List" dialogue
F9	Run "Check Syntax" service
Tools

F7	Open "Text resource manager" tool
F8	Open "ERM file converter" tool
Ctrl+Alt+T	Open "Configure tools" dialogue
Shift+[F1...F12]	This is reserved hot keys for custom tools
Other

Ctrl+F1	"ERM Scripter" help
F1	ERM help; Select text fragment and <F1> key press - context ERM help
Ctrl+Alt+A	Open "About" window

Edit window: text editor

Shift+Ctrl+N	Selection mode: Normal
Shift+Ctrl+C	Selection mode: Columns
Shift+Ctrl+L	Selection mode: Lines
Ctrl+Left	Cursor moving: right to left by words
Ctrl+Right	Cursor moving: left to right by words
Shift+Left	Standart selection
Shift+Right	Standart selection
Shift+Up	Standart selection
Shift+Down	Standart selection
Shift+Ctrl+Left	Selection: right to left by words
Shift+Ctrl+Right	Selection: left to right by words
End	Go to last symbol of current line
Home	Go to first sybol of current line
Shift+End	Selection: from current position to last symbol of line
Shift+Home	Selection: from current position to first sybol of line
Shift+PageUp	Selection: select page from current position to Up
Shift+PageDown	Selection: select page from current position to Down
Ctrl+Del	Delete current line
Ins	Open "Fast Insert List"
Ctrl+F4	Close current window
Shift+Enter	Go to ERT index

Edit window: table editor

Ctrl + Shift + UpArrow	Decrease fixed rows count
Ctrl + Shift + DownArrow	Increase fixed rows count
Ctrl + Shift + LeftArrow	Decrease columns count
Ctrl + Shift + RightArrow	Increase fixed columns count
Ctrl + Alt + RightArrow	Increase columns count
Ctrl + Alt + LeftArrow	Decrease columns count
Ctrl + Alt + DownArrow	Increase rows count
Ctrl + Alt + UpArrow	Decrease rows count
Shift+Enter	Go to ERM variable


"File" main menu
New document

Open

Reopen file

Reopen as table

Reopen

Save

Save As

Save All

Print

Exit


"Edit" main menu
Undo

Redo

Cut

Copy

Paste

Delete

Select All


"Search" main menu
Find

Find next

Find previous

Replace


"Options" main menu
Set Path to ERM Help

Set Path to ERM Help (HTML)

Settings


"Service" main menu
About document

Edit document information

Analyzer

Syntax Browser

Go to

Clipboard manager

Select "Fast Insert List"

Check syntax


"Tools" main menu
Text resource manager

ERM file converter

Configure tools


How to adjust Syntax Browser

Basic principles.

All settings for the browser are located in a ".\Syntax" folder. There are 4 files:

a) "syntax.cfg" is a primary settings file.

It has 5 parameters:

- "ERMVersion" means a version of the ERM that will be shown in the browser header.

- "Comment" means just a comment that will be shown in the bottom part of the browser.

- "TreeFile" means a name of a file that keeps a syntax hierarchy (in further as [TreeFile]).

- "DescriptionsFile" means a name of a file that keeps syntax items descriptions (in further as [DescriptionsFile]).

- "InsertsFile" means a name of a file that keeps items to be inserted in a script body (using double mouse click on the syntax tree item) (in further as [InsertsFile]).

b) [TreeFile] means a text file that keeps the syntax hierarchy.

Here are the rules for this file content:

- Every new item, sub-item or sequence of items start with a new line.

- To mark an hierarchy subordination use a tab symbol,

Example:

 Item_1

 <TAB>Subitem_11

 <TAB><TAB>Subitem_112

 <TAB>Subitem_12

 Item_2

 <TAB>Subitem_21

 <TAB><TAB>Subitem_212

In the browser this will look like:

Item1

|

+- Subitem_11

|  |

|  +- Subitem_112

|

+- Subitem_12

Item2

|

+- Subitem_21

   |

   +- Subitem_21

- Every item, sub-item or sequence of items have their unique index that is a number of a line they are located in the file [TreeFile].

If you choose an item in a browser window and press F1 key, a help window will appear with a help text on the item. The name of the item here means the name of help topic to be shown.

c) [DescriptionsFile] means a text file that keeps the syntax items descriptions. Every line in this file should correspond to the item index in the [TreeFile]. In order to insert an end-of-line character in the description use two apostrophes "``".

d) [InsertsFile] means a text file that keeps items that may be inserted to the script (using double mouse click on the syntax tree item). Every line in this file should correspond to the item index in the [TreeFile].


Analyzer

Icon:

Hotkey:	Ctrl+Alt+V

View:

Description:

...


"Settings" dialogue

Icon:

Hotkey:	Ctrl+Alt+P

View:

Description:

...


Syntax browser

Icon:

Hotkey:	Ctrl+Alt+S

View:

Description:

...

See also:

How to adjust Syntax Browser


Text resource manager

Icon:

Hotkey:	F7

View:

Description:

...


"Edit document information" dialogue

Icon:

Hotkey:	Ctrl+Alt+E

View:

Description:

...


Clipboard manager

Icon:

Hotkey:	Ctrl+Alt+C

View:

Description:

...


"Fast Insert List" dialogue

Icon:

Hotkey:	Shift+Ins

View:

Description:

...


ERM file converter

Icon:

Hotkey:	F8

View:

Description:

...


"Configure tools" dialogue

Icon:

Hotkey:	Ctrl+Alt+T

View:

Description:

...


"About document" dialogue

Icon:

Hotkey:	Ctrl+Alt+I

View:

Description:

...


"New document" dialogue

Icon:

Hotkey:	Ctrl+N

View:

Description:

...

Document types:

 ERM documents

External WoG script files (ERM files) have the extension ".erm". They are essentially text files but the line format is altered slightly so that they can be properly read by the ERM interpreter when a map loads. If an external ERM file isn't saved in ERM format, it won't work and may crash the game. The script editor automatically saves files in this format by default.

There are two ways that .erm files are used: scripts for single maps, and WoGify scripts. For a single map, you must give the .erm file the same name as the map (except for the .erm extension) and put both files into the Heroes3\maps folder. In the map's timed events, you must have at least one event with ZVSE as the first line. This lets the game know that it should load a .erm file of the same map name if one is found. Using an external .erm file is an alternative to putting the code in timed events, but the two can also be combined, although this may get confusing.

For WoGify scripts, the file must be named "scriptxx.erm" where "xx" is a two-digit number from 00 to 99. When a map is wogified, all scripts are loaded, although some may be set as "disabled" by wogify options, and commands within the scrip check for this.

Currently, scripts up to the early 40s are used by wogify, but more official wogify scripts will be added in the future. If you're going to add your own custom wogify scripts, it's a good idea to use higher numbers so they won't be overwritten by official scripts when you update WoG.

 CMD documents

...

 ERS documents

If you create a new wogify script you can add it to the WoGify Options Dialogue with a ".ers" file. The .ers file must have the same name as the wogify script, for example, script67.erm would have script67.ers as its wogify options setup file.

This file is a tab-delineated file containing information about the number of the script, the script's internal reference number used to enable or disable it (which may or may not be the same as the script number), the position it appears in the WoGify Options Dialogue and the description text that accompanies it there.

The following is a quick description of each field:

1. Comments is just that--you can put whatever you want. Usually I put the name or description of the script here but it's for your use only for editing the file and won't show up in the game.

2. Script is the script number (e.g. script10.erm).

3. Page is the page it goes on (starting at page 0)

4. Group is the group. I believe they go: 0=top right, 1=bottom right, 2=top left, 3=top right

5. Item is the item number (first item is 0, etc.) or you can put "-1" to indicate it's the next item on the list. Mostly I used -1.

6. State is the default state: 0=off, 1=on.

7. MP is the default state for MP (if you click the Multiplayer Defaults button)

8. ERM is the UN:P code that the checkbox sets or resets. You can read it with UN:P#/?v1; where # is the ERM number. The scheme I used was under 0-10 is for built-in options (Right-click, Commanders, Arrow Towers, etc.). 11-99 are for script numbers. If the script was under 11, I added 100 to it. So 101 is script 1, 102 is script 2, etc. Additional ERM numbers I used for extra options (Map Rules uses a lot, for example) start at 111 and go up from there. Mostly you'll just need a single ERM number (for a single option) and you can base it on your script number. I suggest numbering your custom scripts from script70.erm on so that they won't clash with new WoGify scripts we may write (at least not for awhile anyway).

9. Text is the text that shows up in the options screen next to the options checkbox.

10. Hint is the text that shows up in the message bar at the bottom of the screen when you move the mouse over it.

11. Popup is the text that shows up when your right-click on the option (or option text).

Note: everything in WoGify options is a checkbox (on or off) except a few that Slava has set as radio button groups (e.g. Master Settings). You won't be able to do this with .ers files, since it must set in the actual WoG code.

 ERT document

Now you can make a file Script##.ert that has a specific format:

Index(integer) [tab delimiter] Text [tab delimiter] Any Comments ...

Two columns are obligatory, others - optional (Comments are not loaded and saved to the game). One line - one Item.

Index means an index that will be used in the script to access the text.

Index may be from 0 to 1000000.

If Index is 0 (or empty), the line is ignored and will not be loaded.

If Index is between 1 and 1000, the text will be automatically copied to corresponding z variables at script loading (before executing any instruction in the script).

So if you have the next line:

123[tab]This is a Text[tab]Any Comments and in your script there is the next instruction:

!#IF:M1/z123;

you will see the message at load time "This is a Text"

This is the way to move your z vars initializations out of the script to the file.

It was:

!#VRz321:S^Hello, stranger!^;

...

Now you delete this line of the script and add a line to the ert file:

321[tab]Hello, stranger![tab]Start up message when a Hero enter to...

To get access to the text you should use the same way as for z vars but the number is higher than 1000.

If you have in your script a z var that is used for storing a constant name or text, you can free this z var and does not use it at all if you add a line to the ert file with higher than 1000 number and change your code.

Then, if you have something like this:

!#IF:M^You are not ready yet.^;

you should change your script to something like this:

!#IF:M1/z123456;

and add a line to the ert file:

123456[tab]You are not ready yet.[tab]Any Comments

You cannot use this constant extra z vars for changing any default text in the game (artifact name and so). This is the same limitation that is used for local z vars (z-1...z-10). With one exception. You can use the static extra z vars as a hint text in HT:T,P,Z,V, OB:H, HO:H. The only restriction is that the index should be not higher than 32000 in this case.

You may compare constant extra z vars in & and | sections.

You can use a formatted string also:

3333[tab]Hello, %Z55555![tab]...

55555[tab]Orin[tab]...

You can include static extra z vars as %Z format item.

As for loading. ert file is loaded only if there is a corresponding erm file and only if it is loaded correctly.

All extra static z vars are common for every ert file. So if you use the same number in one or different ert files, you will have the corresponding message and the map will not be loaded.

We recommend to divide the space of extra z vars the next way:

Index 1000...10000 reserved yet

Index 10000...20000 (100 vars per script for hint purposes).

Script00 10000...10099,

Script01 10100...10199...

(index is 1##00 ... 1##99, where ## is a script number)

Index 20000...100000 reserved yet.

Index 100000...200000 (1000 vars per script for non-hint purposes).

Script00 100000...100999,

Script01 101000...101999,

(index is 1##000 ... 1##999, where ## is a script number)


"ERTfication setup" dialogue

View:

Description:

...


HelpScribble

HelpScribble is a help authoring tool written by Jan Goyvaerts and available for download at http://www.jgsoft.com/. This help file was created with the free trial version of HelpScribble, which is why you can read this ad. Once the author of this help file is so honest to buy the shareware he uses, you will not see this ad again in his help files.

Recompiling the help project with the full version is all it takes to get rid of this ad and the little footers below each topic.

HelpScribble is a stand-alone help authoring tool. It does not require an expensive word processor. (Only a help compiler as Microsoft likes keeping the .hlp format secret. Not my fault.)

Here are some of HelpScribble's features:

·	The Setup program will properly install and uninstall HelpScribble and all of its components, including registry keys.

·	Create, edit and navigate through topics right in the main window. No need to mess with heaps of dialog boxes.

·	All topics are listed in a grid in the main window so you won't lose track in big help projects. You can even set bookmarks.

·	Use the built-in Browse Sequence Editor to easily create browse sequences.

·	Use the built-in Window Editor to change the look of your help window and create secondary windows.

·	Use the built-in Contents Editor to create Windows 95-style contents files. Works a lot better than Microsoft's HCW.

·	No need to mess with Microsoft's SHED: use the built-in SHG Editor to create hotspot bitmaps. Draw your hotspots on the bitmap and pick the topic to link to from the list.

·	With the built-in Macro Editor you can easily compose WinHelp macros whenever needed. It will tell you what the correct parameters are and provide information on them.

·	If you have a problem, just consult the online help. The help file was completely created with HelpScribble, of course.

·	HelpScribble is shareware. However, the unregistered version is not crippled in any way. It will only add a small note to your help topics to encourage you to be honest and to register the shareware you use.

These options are very interesting for Delphi and C++Builder developers:

·	If you are a component writer, use the Delphi Parser to build an outline help file for your component. Just fill in the spaces and you are done. HelpScribble can also extract the comments from your source file and use them as the default descriptions.

·	If you are an application writer, HelpScribble provides you with a property editor for the HelpContext property. You can select the topic you need from a list of topic titles or simply instruct to create a new topic. No need to remember obscure numbers.

·	The property editor also provides a tree view of all the components on your form and their HelpContext properties. This works very intuitively. (Much nicer than those help tools that simply mess with your .dfm files.)

·	HelpScribble can perform syntax highlighting on any Delphi source code in your help file.

HelpScribble is shareware, so feel free to grab your copy today from my web site at http://www.jgsoft.com/