Copyright: ERM help for ERM Scripter (19.05.2003)


Event Related Model
Event Related Model v.2.70

Triggers Receivers Instructions Formats list Flags & variables ERM instructions Contacts

ERM means Event Related Model and is dedicated to Heroes3: Shadow of Death game and add-on.

ERM is a new technology that makes possible dynamically changing the map object's properties as a result of certain player's (including computer) actions.

It essentially offers scripting (programing) posibility. Some default script files ensure WOG enhancements as described in the latest version info, but ERM also gives the basic game user access to creating its own scripts to add his own imagination and flavor to the game.


Triggers

Triggers list

Introduction

Whenever a player activates a trigger, it causes some actions on one or more receivers. A trigger can be an event, object or hero that a hero visits, or it could be an ERM function called by other ERM code or even a timer set up to trigger at a specific time or interval (e.g., every 14 days). Receivers can be events, heroes, map objects or other things. Since many things in the game can be used as a trigger or receiver, it's important to not confuse which is which.

How to Use Triggers

The properties of the trigger event or object do not matter for purposes of it being a trigger. The action of the trigger must be described in a timed event. In an ERM script, the trigger functions as the header, and following after the trigger on subsequent lines are one or more receivers that are executed one at a time in sequence. If you place more than one trigger in the same timed event, it's important to realize that there is no "end trigger" code; a new trigger signals the end of one triggered script and the start of the next.

Trigger Syntax

Every trigger begins with an exclamation mark/question mark combination (!?) and ends with a semicolon (;). Immediately following the !? is a two-letter trigger name which must be entered in capital letters, e.g., BA, OB or HE. Following the trigger name are one or more parameters shown as # in the list below. Each parameter notation (#) must be replaced by an integer number in your code, e.g., !?HE47;. The meaning and allowable range of these numbers is different for each type of trigger. For the HE trigger, the number is the hero number (the number used by the game to reference a particular hero), while for the LE trigger, the numbers specifies the x, y and level coordinates of a local event on the adventure map.

Using Variables in Triggers

Variables cannot be used in place of a number as a trigger parameter. If you try, the variable will either be ignored or treated as zero. If you use a variable comprised of a letter and number, such as v4, the letter part (v) will be ignored and it will be treated as the number 4.

Duplicate Triggers

If the exact same trigger is used more than once in a map, ALL receivers following all occurrences of that trigger are executed, starting with the first trigger (earliest timed event and first trigger reference within that event) and ending with the last trigger.

Note that !?BA0; is a different trigger from !?BA1; and likewise !?HE47; is a different trigger from !?HE48;.

Conditional Triggers

A condition can be added to a trigger so that the receivers following it only execute if the condition is true. To do this, place an ampersand sign (&) immediately after the last parameter and before the semicolon. After the &, put your conditional statement. This statement must consist of either a flag or a variable followed by a comparison symbol (=, >, <, >=, <=, or <>) and either a second variable or an integer value.

Example: !?BA0&v10=51; This means that the receivers following the BA0 trigger will only execute if v1 has a value of 10. You can include multiple tests as well by separating each subsequent condition check by a slash (/) e.g., !?BA0&v10=51/v2>=5; The BA0 trigger receivers will now only execute if v10 is equal to 51 and if v2 is equal to 5 or higher. See the Flags and Variables section for more details about flags, variables and conditional checks. Adding a second trigger of the same type but with a conditional check part way through a script is one easy way of only executing the rest of the script if certain conditions are true.


Receivers

Receivers list	Common options

Introduction

Receivers are ERM codes that affect heroes, objects, events, timers, functions, messages or game settings. Most receivers have multiple commands that can be used with them for doing different things. For example, the LE receiver affects local events on a map and there are different commands for changing the properties of the event.

How to Use Receivers

Receivers are placed in timed events on lines following after a trigger that serves as a header. They are executed one at a time until the end of the timed event or a new trigger is reached. More than one receiver may be placed on a line but for clarity and ease of debugging your script, it's usually best to keep it to one per line.

Receiver Syntax

All receivers begin with a double exclamation mark (!!) and end with a semicolon (;). Immediately following the !! is a two-letter receiver code, such as AR for artifact, HE for hero, LE for local event or OB for object. The next part after this code depends on the type of receiver. Some receivers have one or more parameters before the colon (:), each parameter being an integer number, while other receivers have no parameters before the colon. Following the colon are the receiver's commands. Commands take many forms and may include one or more parameters each; they are represented in the list below as XXXX. Replace XXXX with the appropriate command or commands. After the last command, a semicolon (;) must be used to mark the end of the receiver code.

If a command parameter is shown as $ it means that its value can be stored in a variable. If it's shown as # it means that it can only be set, but not read. And if it's shown as ?$ it means it can be read but not set.

Example of receiver syntax:

!!LE12/21/0:E1000;

In the above example, a local event on the map at x=12, y=21 and level=0 (surface) is being modified so that it now gives 1000 experience to a hero.

Relative Syntax

Often you don't want to replace a value but simply add or subtract from that value. For example, if you give a hero experience, you want to add to that hero's current experience rather than replacing it completely with a new, set value. Likewise for a player's gold or other resources. To accomplish this, we use a relative syntax: the lowercase d as a prefix to the number.

Example of relative syntax:

!!HE-1:Ed500;

In the above example, 500 experience points are added to the current hero's present experience total. If we had used E500 rather than Ed500, the hero's experience would be set to 500 rather than increased by 500. To subtract 500 experience, use Ed-500 instead. If you wish to leave a parameter unchanged, use d0 or simply d on its own.

Current Date Syntax

In a similar fashion to using the prefix d, we can use the prefix c (again, always lowercase) to indicate that the value of the current day will be added to the number. In other words, c is equal to the current day (e.g., c=4 if it's month 1, week 1, day 4, c=8 if it's month 1, week 2, day 1, and c=30 if it's month 2, week 1, day 2).

Example:

If an event is set to occur on the 5th, we can change it so that the event occurs on a new day by using the global receiver (GE, option F$). If we have numbered the event as 100 (first text in the global event message), we could use !!GE100:Fc6; to make the event occur 6 days after the day the receiver takes effect (it could be set to be triggered by a local event trigger). Or, if we wish to simply increase the existing day by 6 days, we can combine relative syntax d with current date syntax c. If the current day is the 14th, then Fc6 evaluates to 14+6=20, Fcd6 or Fdc6 evaluates to 14+5+6=25. Thus, we have the following combinations: d#, c#, cd#, and dc#.

Empty Parameters

If a command has four parameters, you must fill in all four, each separated by a slash. You cannot omit any parameters or the command won't work, and you'll probably get an error too. However, in some cases you can omit the actual numbers and just put in the slashes. When you omit a number in this fashion it is treated as if you entered zero, and as long as zero is a valid number for that parameter, the command will work.

Example of empty parameters:

!!IF:D1/5//4////////////;

The command in the above example is used to set up an extended dialog box. It has more parameters than any other command in ERM, but you won't always need to use them all. We've only used three out of the possible 16 here. For this particular command, leaving an empty parameter or entering 0 means "do not change" but for many other commands it simply means "assume the value 0" which won't always be appropriate.

Multiple Commands

In most cases, you can place multiple commands after a single receiver header (the part before the colon). Commands do not have to be separated by spaces, but for readability this is often a good idea. In some instances, such as setting and manipulating variables with the VR receiver, multiple commands don't always work correctly. So if you do use multiple commands, make sure you check that they're all executing properly and giving you the correct or desired result. If one of your commands is to display or set message text using the carets (^) to delineate the text, you must place this command last. If you put any other commands after it (as part of the same receiver), you'll get an error.

Example of multiple commands:

!!LE10/12/0:E1000 M^You learned a lot walking through the ancient forest of lore.^;

Adding Comments to Your Code

Anything appearing in a script that comes after a semicolon and before the next receiver or trigger is considered a comment and is ignored by the ERM processor. Some people like to put their comments inside square or angle brackets to make it easier for another person reading the script to tell the difference between comments and ERM code, but this isn't strictly necessary.

Example of code with comments (after the semicolon):

ZVSE

!?LE10/23/1; Event at x=10, y=23, level=underground

!!HE-1:B0/?z5; Store hero's name in variable z5.

!!IF:M^A disembodied voice calls out "%Z5...%Z5...you are our last hope..."^;

[The above message displays using the hero's name to make it more personal.]

Using Variables in Receivers

Variables may be used in receivers to replace any # or $ with the exception of the # used for the CE and GE receivers prior to the colon. All other occurrences of # or $ in a receiver, both before and after the colon may be replaced by a variable of an appropriate type. Most of the receivers that reference a map location may also be used with an indirect variable reference. In this form, the index number of the v variable holding the x location is entered. The y location and level location must be stored in the following two v variables. For example, if you store the location of x in v10, y must be in v11 and level in v12. See the Flags and Variables page for more details on variables.

Example of OB receiver using indirect reference:

!!VRv10:S24; [Store x location]

!!VRv11:S14; [Store y location]

!!VRv12:S0; [Store map level]

!!OB10:S; [Disable object at v10/v11/v12]


Instructions

Instructions are identical to receivers except that they begin with an exclamation mark/pound sign combination (!#) and activate only once, when the map is first loaded. Most receivers work fine when used as instructions, but some (especially certain object receivers), will not work at all and will cause an error or map crash. Instructions are executed one at a time, at map load, in the order that they appear in timed events, regardless of whether or not there are triggers, receivers or comments before or after them. You can use an instruction to call a function trigger and all the regular (non-instruction) receivers that are part of that function will then execute normally, however, you must include the function in the timed event before the instruction that calls it, or it won't work; you won't get an error, it just won't execute the function.

Example of instruction:

!#VRv10:S25;  [store 25 in the variable v10]


Formats list

Legend

 Format A1 Artifact Numbers

 Format AD Specialties

 Format AP Position of the artifact

 Format P2 UN:A Position of Artifact

 Format BG Border Guards, Border Gates and Keymaster's Tents

 Format C Creatures

 Format CB Creature Banks

 Format CC Commander Classes

 Format CG Creature Generators

 Format CO Combo Artifact Number

 Format E Colours of players (bits)

 Format E1 Colours of the players

 Format H Heroes' id's

 Format HC Hero Classes

 Format HL Level/Experience Points

 Format OB Type of objects

 Format M1 One-Way Monoliths

 Format M2 Two-Way Monoliths

 Format MI Mines

 Format PK Primary Skills

 Format R Resources

 Format SP Spells

 Format SS Secondary Skills

 Format SQ Secondary Skills + level

 Format T Towns

 Format TR Terrain Type

 Format U Buildings

 Additional objects: Types and Subtyps

 Terrain Types and Subtypes

 Type and subtype of Pictures using the IF:Q command

 Blessings and Curces Table

 List of all buildings

 Background picture for the battle


Flags and variables

Content List of the claimed

Introduction

Flags and variables are at the very heart of the ability of ERM to transform Heroes into a highly dynamic game that responds to the actions and choices made by the players. While ERM scripts can be written without using flags or variables, learning to use them will greatly enhance your options, and in fact, a number of the commands require their use.

Conditional Flags

Conditional Flags are also referred to as flags or CFs. A flag is a conditional switch that is either true (1) or false (0). Like a binary number, it has only two states and no other. Initially, all flags are set to false (0). A value of 1 (true) is sometimes referred to as the flag being "set" while a value of 0 (false) is sometimes referred as a flag being "not set".

Setting Flags

In ERM, there are 1000 conditional flags and these are each represented by a number from 1 to 1000. Flags are set with the IF receiver using the V command. To set a flag to true, use the value 1 and to set it to false, use 0.

Example: to set flag number 4 to true, use: !!IF:V4/1;

In addition to the V command, there are also several IF commands for setting the first 10 flags all at once. Refer to the IF receiver for the specific syntax of these commands.

Using Conditional Flags

The most common use of a flag is to control whether or not a piece of ERM code (such as a trigger or receiver) executes under certain conditions in the game. For example, if you want a map object to display a message the first time any hero visits it but never after, you could use a flag for this purpose; it would display the message if the flag was false (not set) and a following command would then set the flag to true (1) so that next time the object was visited, no message would be displayed.

The symbol for indicating a flag (or variable) test is the ampersand (&) which is placed immediately prior to the colon of a receiver statement, or prior to the semicolon of a trigger statement. The ampersand is immediately followed by the flag number used for the test. If a test for a true flag (a flag that has been set to 1) is made, the number alone is used. If the test is for a false flag (not set, or set to 0), a negative sign is placed in front of the number. So to test if flag number 5 is true, you would use &5, and to test if flag number 5 is false, you would use &-5.

Example of code:

ZVSE

!?OB10/14/0;  [object at x=10,y=15,level=surface is visited by a hero]

!!IF&-5:M^Come in. I have been expecting you.^;  [display if flag 5 is false]

!!IF:V5/1;  [set flag 5 to 1 (true)]

Checking Multiple Flags

At times, you may want to check for more than one conditional flag (or variable). To do this, separate each subsequent number with a slash (/). When there are multiple flags or variables to test for, ALL conditions must be met before the statement executes. For example, if you were testing for flag number 7 being true, flag 8 being false and flag 10 being true, then if even one of those flags had a different value, the statement would not be carried out.

Example of code:

ZVSE

!?OB10/14/0;  [object at x=10,y=15,level=surface is visited by a hero]

!!IF&7/-8/10:M^Come in. I have been expecting you.^;

[The above message is displayed only if flags 7 and 10 are true and 8 is false]

Initializing Flags

While all flags initially begin as "not set" (i.e., value of 0 or false), flags 501 to 1000 will retain their last value when you begin a new map (or the same map over) without first quitting and restarting the Heroes game. This is so they can be used for making campaigns in which you want certain flag values to carry over to the next map in the campaign. If you wish to avoid potentially having flags that aren't set to 0 at the start of a game, either stick to using flags 500 and below or initialize to 0 at the start of your map or script (with IF:V statements) all flags that you wish to use.

Special Flags

There are three flags that have special significance in the game.

Flag 1 is used by certain commands to return a result and will also return the result of a conditional check of values (see below). Therefore, it's a good idea to never use flag 1 for any long term storage. Or to be safe, don't use it at all and stick to higher numbered flags.

The second flag is Flag 999, which is set to 1 if the current player (when trigger executes) is a player "here" and 0 if he or she is at another PC. The AI has it always set to 0. If flag 999 is set, you can be sure that this is human and he is here. It's working for all triggers.

The third flag that's significant is flag 1000. This flag will be set to true when a hero owned by a human player visits a map object or is the subject of a trigger such as a timer or level gain check. If a computer (AI) hero visits an object, flag 1000 will be set to false. Again, you can set this flag yourself but it's probably safest not to, since you may wish to check its value in a script to determine if the subject is a human or AI player.

On other way : -1000 means AI and 1000 means Human.

Displaying the Value of Flags in Messages

To display the value of a flag (0 or 1) in a message, use %F followed by the flag number you wish to display (1 to 1000). So to display flag number 4 within a message, you would use %F4. Displaying the value of flags may be useful primarily as a tool to help in debugging scripts.

Example:

!!IF:M^The value of flag number 4 is %F4.^;

Comparing Values

To compare the game parameter to a particular value you can use the following way: ...[compare operator] value... The result of comparing is stored in flag 1. You can use its value for further ERM statements.

Examples of Value Comparison using the GE Receiver:

!!GE100:F5	Set first day to 5 for Time event (standard syntax)
!!GE100:F=5	Check if first day is 5 and set Cond.Flag1 (CF1)
!!GE100:F<>5	Check if first day is NOT 5 and set Cond.Flag1 (CF1)
!!GE100:F><5	The same as above
!!GE100:F>5	Check if first day is greater than 5 and set CF1
!!GE100:F>=5	Check if first day is greater or equal to 5 and set CF1
!!GE100:F=>5	The same as above
!!GE100:F<5	Check if first day is below than 5 and set CF1
!!GE100:F<=5	Check if first day is below or equal to 5 and set CF1
!!GE100:F=<5	The same as above

Variables

Variables are similar to flags in that they can be set and checked, but unlike flags they can hold many more values than true and false. In most cases, a variable can be used in place of a number. Also, the contents of a variable (the value it stores) can be changed at any time simply by storing a new value in it, hence the name variable. There are also several different types of variables that may be used for different purposes or in different places in your code.

If a command parameter is shown as $ it means that its value can be stored in a variable. If it's shown as # it means that it can only be set, but not read. And if it's shown as ?$ it means it can be read but not set.

Types of Variables and their Allowed Value Ranges

All numeric variables are integer variables and have a range of -2147483647...+2147483647

a	not yet used
b	not yet used
c	stores today value (game active day number)
d	adds or subtracts values from variables
e1...e100	Function floating point variables
f...t	Standard variables (former known as quick variables)
v1...v10000	Standard variables
w1...w100	Hero variables (unique for each hero)
x1...x16	Function parameters (values passed to a function)
y1...y100	Function local variables (unique for each function)
z1...z1000	String variables (store strings of characters)
z-1...z-10	Function string variables (unique to each function)

Storing Variables

There are several ways of storing a value in a variable. The VR receiver can be used to set the value of any variable and can also be used to do arithmetic operations with variables such as adding, subtracting, multiplying or dividing. The exception is the z variables which is used to store strings of characters rather than numerical values.

Example of storing the value 18 in the v5 variable: !!VRv5:S17;

The second way of storing a value in a variable is to read the value from an object or setting in the game, such as number of a hero, the value of a pile of gold, the number of gems that player number 4 currently possesses, or the type or subtype of any object. To store a value in this way, immediately after a command, use the question mark symbol (?) followed by the variable name in place of a value parameter.

Example of storing the type of an object located at x=10, y=15, level=1 (underground) in the variable j: !!OB10/15/1:T?j;

Example of storing the number of crystals (resource type 4) that the green player (player number 3) currently possesses, in the variable v12:

!!OW:R3/4/?v12;

The third method of storing a variable is by an indirect reference. A few ERM commands require a number that is the index number of a v or z variable. In this case, instead of using the question mark, you simply enter a number for that parameter and the value retrieved by the command will be stored in the corresponding variable (e.g., if the command asks for a index number for a v variable, putting in 17 would store a value in v17).

Using Variables Instead of Numbers

Once you have a value stored in a variable, you can use that variable in place of a number in your code. Almost anywhere that you could normally enter a number, you can instead use any of the variables, provided the value they hold is within an acceptable range for the command or parameter you're using it with. Again, the exception is the z variables which are used when you wish to set or display a string of characters, such as a hero's name, the name of an artifact, or a word or phrase. In most cases it will be fairly obvious when a z variable should be used with a command rather than a numeric variable (any of the other variable types).

Example of using a v variable to set a hero's spell points

!!VRv200:R50;  [Store random number between 0 and 50 in v200 variable]

!!HE155:Iv200;  [Set hero number 155's spell points to value stored in v200]

Example of using a z variable to add "Sir" to the start of a hero's name

!!VRz50:S^Sir ^; [Store the word "Sir " in the variable z50]

!!HE-1:B0/?z51;   [Store current hero's name in z51]

!!VRz52:S50 +z51; [Add contents of variable z51 to z50 and store in z52]

!!HE-1:B0/z52;      [Set current hero's name to text stored in variable z52]

Note: both the above examples of code would need to be preceded by a trigger event of some sort in order to function.

Conditional Statements with Variables

Like flags, you can use the value of one or more variables to determine if a statement (trigger or receiver) executes. And in fact, the syntax is similar. However, instead of putting the flag number (with or without a minus sign in front of it), you would put the name of the variable followed by a comparison symbol (=, >, <, <>, >=, or <=) and the number (or variable) you wish to compare it with.

Example of conditional statement, comparing v1 to see if it's greater than or equal to the number 7, and if it is, a message is displayed:

!!IF&v1>=7:M^You were wise to make that choice, hero!^;

Example of conditional statement, comparing the text stored in the z1 string variable to the text stored in the z2 string variable, and if it's the same displaying a message:

!!IF&z1=z2:M^So, you're the one!^;

Checking Multiple Variables

This is accomplished in much the same way as checking multiple flags, by separating subsequent variable tests with the slash symbol (/). In fact, you can freely mix and match checks for flags and variables in the same statement, as in the following example that gives the current hero the Armor of Wonder artifact, but only if certain conditions are fulfilled (flags set and variables with specific values): !!HE-1&7/v2>6/-1/y4=v8:A31;

In the above example, the following conditions must be true before the statement executes and gives the hero an artifact:

1. Flag 7 must be true (set to 1);

2. The v2 variable must currently store a value  of 6 or higher;

3. Flag 1 must be false (set to 0 or not set);

4. The y4 variable must currently store the same value as the v8 variable.

Only if ALL four of these conditions are true will the hero be given the artifact.

Checking syntax - OR conditions.: |

!(!|?|#)XX&c1/c2/c3|c4/c5/c6:...;

Full condition is: (c1 AND c2 AND c3) OR c4 OR c5 OR c6

Comments.

- OR section may be alone or only after AND section

- if there is only OR section, full condition will be true if at least one OR condition is TRUE

- there may be up to 16 AND conditions and up to 16 OR conditions

The Different Types of Variables

As mentioned earlier, there are several different types of variables, each used in a slightly different way or place in your code.

Standard variables (f-t) and (v1-v10000) are for the most part interchangeable, except that quick variables can hold slightly larger numbers than v variables, and certain commands require an index number of a v variable to store the results. Both types are used for storing numerical integer (whole) numbers. No variables in ERM can store real numbers (numbers which include a decimal).

Hero variables (w1-w100) store the same type of information as v variables, but are unique for each hero. This means that two different heroes could have different values stored in their w1 variable (or w2, w10 or anything up to and including w100).

In order to set or check one or more w variables you must first set the hero number that they apply to by using the IF:W command. For example, if you wish to set or check w5 for hero number 27 (Gem), you would first put !!IF:W27; prior to the statement that referenced her w5 variable. To specify the current hero, use -1 instead of a number. So !!IF:W-1; means that subsequent references to w variables will refer to the current hero (until another IF:W statement is issued).

See also IF:W topic and VR receiver)

Function parameter variables (x1-x16) also store the same types of values (numeric) as v and w variables. However, these variables only exist within functions (code following a function trigger) and are initially set to values passed to the function in the function receiver statement after the P command (P stands for parameter). See the FU receiver page for more details on functions. If you call a function from within another function, any x variables that aren't set (as new parameters) maintain their same values in the new function. When used with the DO receiver, the x16 parameter stores the loop count of the function (i.e., the number of times the function has been executed so far since the DO receiver activated).

Function local variables (y1-y100) are similar to x variables in that they are normally only be used within a function. However, they are unique to each function, so if you have four different functions, each will have its own set of y variables. Like most of the other variables, they store numeric values only. There is also one set of global y variables that may be used outside of functions and could be used if you run low on v variables, but be aware that if another trigger (e.g., HL or BA) occurs in the middle of your script, the values of these y variables could be wiped out.

Function local float point variables (e1..e100) They are used the same way as y vars:

- not stored in the saved game;

- are local in every function;

- filled with 0 at every function/cycle start;

- restored when return from other function call.

You may use them to set parameters but the main feature is to use it to calculate floating point expression and then store it to integer variable.

You can use +,-,* and : commands of VR receiver for e vars in floating point calculations though all numbers should be integer in the expression.

You can also put e vars in the message with %E# command. In this case only 3 digits after dot is shown.

Example:

!#VRe5:S32;

!#IF:M^e5 is "%E5"^; [ e5=32.0 ]

!#VRe5:*5;

!#IF:M^e5 is "%E5"^; [ e5=160.0 ]

!#VRe5::200;

!#IF:M^e5 is "%E5"^; [ e5=0.8 ]

!#VRe5:+e5*10+5:10;

!#IF:M^e5 is "%E5"^; [ e5=2.1 ]

!#VRv100:Se5;

!#IF:M^v100 is "%V100"^; [ v100=2 ]

String variables (z1-z1000) store strings of characters (one or more) and cannot be used to store numeric values; they could store a number as text but that number couldn't be compared or manipulated numerically in any fashion. z variables can be concatenated (joined together) but have a maximum size of 512 characters each. They can also be compared to another z variable to see if they match each other exactly. When comparing two z variables for a match, the comparison is NOT case-sensitive. So if z1 stores "This" it will match z2 storing "thIS" or any other combination of upper and lower case. Leading blank spaces or lines are also ignored in z variable comparisons. The 500 new z variables added in the ERM 2.60 update (WoG 3.57) are identical to the original 500, but note that z501-z1000 will not keep their values between different maps. Continue to use z301-z500 for this purpose.

Note: Since string variables handle text messages, be aware that a string cannot contain the ; , ^ characters.

Example:

!!VRz567:S^wrong text ; it contains ^special elements^. ^;

!!VRz567:S^this is a correct  text. It contains no "special elements".  ^;

!!IF:M^this is a correct  text. It contains no "special elements".  ^;

Function local string variables (z-1-z-10) are similar to their y variable counterparts but store string values like z variables. If you set one and then call a function or function loop that sets another value, when you return to the original function you will have the variable value you set before the function call. However they differ from y variables in that they will keep their value when you initially call the function, so they may be used to pass strings to functions, but cannot be used to return values. Like regular z variables, they have a maximum size of 512 characters.

Special Variables

There are several variables in ERM that have special significance. Like the flags 1 and 1000, special variables can still be set by to anything you like at any time, but it is advisable to do with some degree of caution, since other commands may make use of them.

The v1 variable is occasionally used to store the results of a few commands. This isn't a common occurrence so it can still be used in your scripts, but it's advisable to not use it for long-term storage of a value; in other words, don't store a value in v1 if you need to guarantee that it remains unchanged at some later point in the game.

The z1 variable is used to store the text entered by a player in an extended dialog box. If you don't use extended dialog boxes, you won't need to worry about this, but it's still a good idea not to use z1 for long-term storage.

The v variables v998, v999, and v1000 always store the position of the object or event that a hero is currently visiting when a corresponding trigger is used, or in some cases the location of the hero him or herself (for example, the !?HM trigger). It's best to leave these variables alone except to compare their values or copy their values to other variables.

The x16 variable (used in functions called with the DO receiver), stores the current cycle number of the function. For example, if the function is being repeated 12 times (from 1 to 12), the first time through, x16 will equal 1, the second time 2 and so on. If you change the x16 variable, you can actually "speed up" or "slow down" a function loop, or even exit from it completely by setting x16 equal to the end value (or higher) that was specified in the DO receiver.

Initializing Variables

Like flags, all variables begin the game with an initial value of 0. However, also like flags, certain variable ranges will NOT be reset between maps without restarting the Heroes game. Again, this is to allow those variables to "carry over" their values to another map as part of a multi-map campaign.

When you start a new map, the following variables will be reset to zero (0) or a void string "" for z variables: f...t, v1...v500, v1001-v10000, z1...z300, z501-z1000, w1-w50.

The following variables will retain their current values between games (unless you quit and restart Heroes): v501-v1000, z301-z500, w51-w100.

Displaying Variables in Messages

Like flags, the values of variables may be displayed in messages by using special codes for the type of variable followed by the variable number as shown below:

%V#	Shows a quick or v variable of the specified number. # = f to t or 1 to 10000
%W#	Shows a hero variable of the specified number. # = 1 to 100
%X#	Shows a parameter variable of the specified number. # = 1 to 16
%Y#	Shows a local function variable of the specified number. # = 1 to 100
%Z#	Shows a string variable of the specified number. # = 1 to 500
%$macro$	Shows a variable associated with the macro name "macro"

It's important to note that the code for displaying a variable is always an uppercase letter after the %letter is always uppercase while a regular variable reference is always a lowercase letter.

Example showing the display of quick variable j, standard variable v21 and z variable z100 within a message string:

!!IF:M^Sorry, %Z100, but you only have %Vj gold left and you need at least %V21 gold to buy this artifact.^;

Assuming that z100 had previously been used to store the hero's name (let's say it's Clancy) and j to store the current player's gold (let's say it's 750) and v21 to store the cost of some artifact in gold (let's say it's 2000), the message would appear as:

Sorry, Clancy, but you only have 750 gold left and you need at least 2000 gold to buy this artifact.

Including Variables as Part of a String Variable

By using the same commands you use for displaying a variable in a message (see above), you can include a variable as part of a string variable. This is handy way of concatenating strings made up of several z variables and possibly some other variable values all at once.

Example of combining several z variables and v variables together in one z variable:

!!VRz10:S^Clancy^;  [set z10 to "Clancy"]

!!VRz11:S^green^;   [set z11 to "green"]

!!VRz12:S^red^;        [set z12 to "red"]

!!VRv25:S1 R1000;    [store a random number between 1 and 1000 in v25]

!!VRz100:S^%Z10 always wished he had a %Z11 horse but instead he had a bright %Z12 one. He was %V25 years old now and %Z10 had never owned a %Z11 horse in his life!^;  [store text in z100]

!!IF:M^%Z100.^; [display text stored in z100]

Assuming the random number generated and stored in the v25 variable is 247, the following message would display to the player:

Clancy always wished he had a green horse but instead he had a bright red one. He was 247 years old now and Clancy had never owned a green horse in his life!

Indirect Reference of Variables

Several receivers requiring map locations (x, y and level values) can be used with an indirect variable reference. This is a single number that is the starting index number of consecutive v variables storing the x, y and level values to be used. Thus, if you have stored an x value in v100, y value in v101 and level value in v102, you could use the number 100 in the receiver in place of these values.

Example of using a local event receiver with an indirect reference:

!!VRv100:S10;  [number to be used for x value]

!!VRv101:S15;  [number to be used for y value]

!!VRv102:S0;    [number to be used for level value]

!!LE100:M^Strangely, there is no sound of life here.^;

[set message of event at location stored in v100, v101, v102 variables]

Indexed Variables

Sometimes it's useful to be able to refer to a variable index (e.g., the number between 1 and 1000 for a v variable) with another variable. In this fashion you could use a repeated function loop such as the DO receiver to store information in a series of variables. Instead of putting a number after the v, you would put another variable and the value it stores would be the number of the v variable.

Example of a referencing a v variable with a y variable:

!!VRy10:S7;

!!VRvy10:S5;

!!IF:M^The value of v7 is %V7.^;

This would display the following:

The value of v7 is 5.

This is because y10 has the value 7. And vy10 then means v at the index number stored in y10, which in this case is 7. Thus v7 stores the value 5.

Macros

If you want to be able to refer to a variable by a more meaningful name, you can set up a macro with the MC receiver. The macro can then be used almost any place the variable can be used and is interchangeable with the variable. A macro is referenced with the name enclosed by dollar signs, e.g., $treasure$. For more information on macros, see the MC receiver page.

A Guide to Suggested Variable Use

You can use any combination of variable numbers you like in your scripts but to make scripts easier to keep track of, change or transfer to other maps, it's a good idea to use a series of contiguous index numbers such as v100 through v120 or however many you need. It's also a good idea to use Quick Variables to only store temporary numbers and to keep the low numbered v and z variables also for this purpose, using only higher numbered v variables and z variables for long-term storage of values. Furthermore, where possible, it's good to make use of local y variables within functions, thus keeping more non-local variables available for general use elsewhere in your map scripts. The hero variables (w variables) will generally only be useful for specific purposes, but do make use of them when the situation arises, since every single hero has their own set.

Using y Variables Outside Functions

There is one global set of y vars [1...100]. Every time you use it. But every function trigger storied all current y vals in a stack, sets them all to 0 and after executing of the latest receiver them all are restored back.

But of course you can use this global set anywhere.

Example:

ZVSE

!#VRy15:S3;

....

!?...;

!!IF:M^%Y15^; it shows 3

...

!!FU234:P;

!!IF:M^%Y15^; it shows 3

...

!?FU234;

!!IF:M^%Y15^; it shows 0

!!VRy15:S5;

!!IF:M^%Y15^; it shows 5

!?FU234;

!!IF:M^%Y15^; it shows 0

!!VRy15:S7;

!!IF:M^%Y15^; it shows 7


Triggers list

Legend

!?AE Equip/Unequip artifact triggers

 !?BA Battle control

 !?BF Battle field trigger

 !?BG Action taken by any stack or heroes

 !?BR Start turn trigger

 !?CM Click the right mouse button

 !?CO Commander control

 !?FU Function

 !?GE Global event (Time)

 !?HE Hero attacks

 !?HL Hero gain a next level

 !?HM *Before* hero movement trigger

 !?IP Multiplayer support

 !?LE Local event (Place)

 !$LE Local event (Place) post-visit trigger

 !?OB "Entrance" of object

 !$OB "Entrance" of object post-visit trigger

 !?TM Time events

 !?MW Wandering monsters


Receivers list

Legend

 !!AI AI movement control

 !!AR Artifact or resource

 !!BA Attributes of a battle

 !!BF Sets up a battlefield with custom placement of obstacles

 !!BG Ñheck/set/get parameters on taken action

 !!BH Ñheck/set/get parameters on the action taken by a hero

 !!BM Check/Set/Get some parameters of a stack of monsters

 !!BU Check/set/get some universal parameters of the battle

 !!CA Town settings

 !!CD Setup the parameters for town demolitions

 !!CE Modify the attributes of a timed Town Event

 !!CM Get/check/set info about mouse click

 !!CO Commanders support

 !!DO Calls a function trigger multiple times

 !!FU Function receiver

 !!GE Global event on the map

 !!HE Modify hero

 !!HL Control what skills a hero may choose when gaining a new level

 !!HO Enable/Disable interaction with heroes

 !!HT Set the hint for adventure map objects

 !!IF Management of conditional flags

 !!LE Modify the attributes of a local event

 !!MA Modify all creatures of a given type

 !!MC Sets up macros

 !!MO Modify the attributes of the monsters in the specified position

 !!MW Wandering monsters

 !!OB Modify the attributes of an object at the specified position

 !!OW These are commands that apply to a specific player

 !!PM  Pyramid or any New Object control

 !!PO Set up information for any square on the map

 !!QW Add, remove or change an entry in the new Quest Log

 !!TM ERM equivalent for time events

 !!TR Set terrain types or change passability of a square

 !!UN Universal commands

 !!VC Variable Control

 !!VR Management of variables

Miscellaneous object receivers

 !!MN Object "Mine"

 !!SC Object "Scholar"

 !!CH Object "Treasure Chest"

 !!WT Object "Warrior's Tomb"

 !!KT Object "Tree of Knowledge"

 !!FR Object "Campfire"

 !!LN Object "Lean To"

 !!ST Object "Learning Stone"

 !!WG Object "Wagon"

 !!SK Object "Skeleton (Corpse)"

 !!SP Object "Magic Spring"

 !!WM Object "Water Wheel"

 !!SW Object "Swan Pond"

 !!MT Object "Obelisk"

 !!GD Object "Mystical Garden"

 !!ML Object "Windmill"

 !!DW Object "Monster dwelling"

 !!WH Object "Witch Hut"

 !!SY Object "Shipyard"

 !!GR Object "Garrison"

 !!SR Object "Magic shrine"

 !!UR Object "University"

 !!SG Object "Sign/Bottle"


Trigger !?BA

Legend

!?BA#

This will be called when any battle occurs.

# = 0 Turn on at start of every battle;

# = 1 Turn on at end of every battle.

If we have a multiplayer (MP) battle at the defending side we have not !?BA0 and !?BA1 triggers but !?BA50 and !?BA51 instead.

This brings almost no changes for:

- non MP battle goes as befor !?BA0...!?BA1.

- H vs H battle goes this way:

    A           D

  !?BA0

    ---data--->

              !?BA50

  .....battle.....

    <---data---  (if defender wins)

  !?BA1       !?BA51

!?BA51 is not needed actually except some cases for the control is passed to the Attacker PC.

- AI vs H battle goes this way:

    A           D

  !?BA0

    ---data--->

              !?BA50

              battle

              !?BA51

    <---data---

  !?BA1

You see that now we can synchronize many things on a battlefield.

Then at attacker's side you can use !!HE# without any problem but as I wrote at the defender's side we have copies of hero's and you cannot control them with ordinary !!HE#. So I have added a specific syntax for defender's side only(!).

!!HE-10:... apply changes to the copy of attacker hero info;

!!HE-20:... apply changes to the copy of attacker hero info.

You can get hero's number but make all changes with this syntax.

Once again. This works ONLY during a battle and only at defending (non-active) side.

Example:

Let us set the attacking hero's attack skill to 3 and increase an attack skill every battle turn by the current day value.

So if the battle takes place at day 2, he will have 5 at the first round (3+2), 7 at the second (3+2+2), 9 at the third (3+2+2+2) and so on.

Our script:

!?BA0; [battle begins at attacker side]

!!HE-1:F3/d/d/d; [set attacker attack to 3]

;  [NOTE that this need to be set only at attacker's side]

;  [then Hero's statistics will be transferred to defender's side]

!!VRv9001:Sc; [set v9001 to a current day (just an example)]

;  [v10 is a flag for us; if it is 1, this is the attacker's side]

;  [if it is 0, this is the defender's side]

!!VRv10:S1;   [set v10 to 1 - attacker's side]

!?BA50; [battle begins at defender's side]

;  [NOTE both heroes info is transferred here already]

;  [also v9001...v10000 transferred here also]

!!VRv10:S0; [set v10 to 0 - defender's side]

;  [now increase attacker hero's attack by v9001 every turn]

!?BRv10=1; [this runs at attacker's side]

!!HE-1:Fdv9001/d/d/d; [set attack for hero -1 (attacker)]

!?BRv10=0; [this run at defender's side]

!!HE-10:Fdv9001/d/d/d; [set attack for hero -10 (attacker)]

Note that if you delete one of !?BR section, there will be a problem for changes takes place at only one side.

And then in this example you change just a Hero's statistics that can be checked by right mouse click on him on the battlefield but the changes are not applied to the army (this is just a simple example).

To set up a battle, use the !!BA Receiver.


Trigger !?BF

Legend

!?BF

This will be called when a battlefield is prepared for a battle prior to the combat beginning. It may be used in conjunction with the !!BF Receiver to set up a custom battlefield.


Trigger !?BG

Legend

!?BG#

This combat trigger occurs at every action taken by any stack or by the hero (for spellcasting, retreating and surrendering).

# = 0 is called before the action occurs. (Same as !?BG)

# = 1 is called after the action occurs.

Variable v997 keeps the number of the current turn:

0 - start turn (after Tactics phase)

1 - second turn

2 - third turn

...

Comments:

You can use this with the !!BG Receiver to find a monster stack number (BG:N) and use this number to get access to this monster's set up (!!BM Receiver).


Trigger !?BR

Legend

!?BR

This trigger occurs every turn of a battle (for the first turn it occurs twice). Variable v997 keeps the number of the current turn:

-1 - start turn (before Tactics phase)

0 - start turn (after Tactics phase)

1 - second turn

2 - third turn

...

Comments:

1. The starting turn (-1,0) goes in "darkness" and you will not be able to show any message, though you can take actions.

2. The turn of a battle (v997) may be not the same if a Tactics phase took place. For the full sequence of triggers, see the detailed listing following the Triggers List.

Sequence of Combat Triggers with and without a Tactics phase:

Also a sequence of triggers is now:

(without tactic)

BA0 (on the map screen)

(in darkness)

BR(-1)

BF0

(show battle field)

BR(0)

(all actions of first round)

BG0-BG1

BG0-BG1

...

BG0-BR(1)-BG1 (second round started)

(all actions of first round)

BG0-BG1

BG0-BG1

...

BG0-BR(2)-BG1 (third round started)

and so on.

BA1 (on the map screen)

(with tactic)

BA0 (on the map screen)

(in darkness)

BR(-1)

BF0

(show battle field)

(all actions of first tactic round)

BG0-BG1

BG0-BG1

...

BG0-BR(-2)-BG1 (second tactic round started)

(all actions of second tactic round)

BG0-BG1

BG0-BG1

...

BG0-BR(-3)-BG1 (third tactic round started)

and so on

*BR(0)

(all actions of first round)

BG0-BG1

BG0-BG1

...

BG0-BR(1)-BG1 (second round started)

(all actions of first round)

BG0-BG1

BG0-BG1

...

BG0-BR(2)-BG1 (third round started)

and so on.

BA1 (on the map screen)

Note:

1. A new round starts between BG0 and BG1.

2. *BR(0) may have two form. If a player has a tactic phase, this will be:

BG0-BG1

BR(0)

Though if AI has a tactic phase, this will be:

BG0-BR(0)-BG1

So if you do not use BG1 trigger it will be the same.

I did not test it for both AIs and both players, but think this

will be the same cases.


Trigger !?CM

Legend

!?CM#

The trigger occurs when you click the right mouse button any place on the adventure map.

It sets up an internal ERM structure that can be used with the CM Receiver to get information about the area clicked as well as disabling the standard right-click function.

Comments:

Data in the structure will not be saved. This means that you can use it in a receiver section of this trigger.

For now there is only one CM trigger - !?CM0; (!?CM;).

But later there will be more triggers for other screens such as the town screen or combat screen. When they're done, they will be !?CM1, !?CM2, etc.

•	!?CM0 - Mouse manager trigger for adventure map the same as !?CM. The trigger occurs when you click the right mouse button.

•	!?CM1 - Mouse manager trigger for town screen. The trigger occurs when you click the right mouse button.

You can also use !!CM Receiver with the next command: T, S, I, F, A, R and cannot use P. The trigger works for left mouse push (subtype=12), left mouse release (subtype=13) and right mouse push (subtype=14 and also has a corresponding bit in flags).

To show message on right mouse click use the same  technology as for Sorcery script.

•	!?CM2 - Mouse manager trigger for Hero information screen. The trigger occurs when you click the right mouse button.

The current hero !!HE-1:... is an active one.

•	!?CM3 - Mouse manager trigger for Heroes meeting screen. The trigger occurs when you click the right mouse button.

•	!?CM4 - Mouse manager trigger for battle field. The trigger occurs when you click the right mouse button. Get the number of position on the battle field (and heroes image).


Trigger !?FU

Legend

!?FU#

Function with # (integer value 1-30000) called within a block of ERM code by an !!FU Receiver and followed by code that's part of the function.


Trigger !?GE

Legend

!?GE#

This is a "global" event with number #. The # must be first in the Event text (the event title doesn't matter).

This number WON'T APPEAR later in message text in the game as long as it's used by a trigger.

Example:

Text "1230There you are!" transforms to "There you are!" with number 1230.

To change a global event, use the !!GE Receiver.


Trigger !?HE

Legend

!?HE#

This will be called when any hero attacks an enemy hero or visits/trades with an allied hero having the specified hero #. To change characteristics of a hero, use the !!HE Receiver.


Trigger !?HL

Legend

!?HL#

Will be triggered whenever a hero gains a level.

#=number of hero (-1 = all).

If you have !?HL-1 and !?HL5, for example, first will be processed all receivers for all heroes (HL-1) and then a particular hero (HL5). To change the primary and secondary skills available when a hero gains a level, use the !!HL Receiver.


Trigger !?HM

Legend

Take control over every step a hero takes. It is triggered before the hero takes each step (not after). So if you check v998, v999, v1000, you get a coordinate of the point the Hero will move to. This movement cannot be cancelled.

!?HM#

#=number of hero (-1 = all).

At triggering moment you can find: HE-1 will refer to a hero who moves.

v998, v999, v1000 = X, Y and Level of the point of destination. Also, flag1000 is set to gamer (1) or AI (0) as usual.

If you have !?HM-1 and !?HM5 for example, first will be processed all receivers for all heroes (HM-1) and then a particular hero (HM5).

Example:

!?HM-1;

!!IF:M^Moving!^;

!?HM0;

!!IF:M^Personal Orin's Moving!^;


Trigger !?LE
Trigger !?LE (!$LE)

Legend

!?LE#1/#2/#3

An Event on the map can be a Trigger. The contents and features of the Event are not significant in any way. The event won't be changed. It is used as an Event Trigger only.

#1 - X position of the Event on the map,

#2 - Y position on the map,

#3 - level (0-ground, 1-underground).

An Event must exist at that position on the adventure map.

You can refer to the exact position of the event in receivers following the trigger: X, Y and Level will be stored in v998, v999 and v1000 when the trigger activates.

!$LE#1/#2/#3

Local Event post-visit trigger. This trigger works identical to any of the formats of the !?LE trigger but instead of occurring before the event trigger, it occurs after.

Syntax is !$LE... then all as usual.

Example:

?!LE10/21/0;

This will identify an event at the location X = 10, Y = 21 on the surface map Level (0) as a trigger. If a hero trips this event, then all ERM statements following the trigger code will be executed.

To change the properties of an event, use the !!LE Receiver.


Trigger !?OB
Trigger !?OB (!$OB)

Legend

This trigger works for any object that has an "entrance" (yellow square in editor). Note: this includes monsters, artifacts, and resource piles too but does not include other heroes (use the !?HL trigger for heroes).

!?OB#1

!?OB#1/#2

!?OB#1/#2/#3

#1 - X position of entrance on the map

#2 - Y position on the map,

#3 - Level (0-Surface, 1-Underground).

Important:

The sequence of finding object triggers:

!?OB#1; common by type

!?OB#1/#2; common by type and subtype

!?OB#1/#2/#3; particular object

You can refer to the exact position of the object in receivers following the trigger: X, Y and Level will be stored in v998,v999 and v1000 when the trigger activates.

!$OB#1/#2

!$OB#1/#2/#3

Object post-visit trigger. This trigger works identically to any of the formats of the !?OB trigger but instead of occurring before the regular object function, it occurs after. For example. a post-visit trigger used with a dwelling will occur after any creatures have been recruited from the dwelling. A post-visit trigger on a castle would occur after the battle is over if the castle was attacked.

Syntax is !$OB... then all as usual.

____________________

See: Format OB

Example:

!?OB101; come here for any chest on the map

!!CH998:... change whatever you want

using indexed variables as a position X, Y, L for a particular chest at X, Y, L.

To set up or change the properties of an object, use the appropriate Object Receiver or the general OB Receiver.


Trigger !?TM

Legend

This is the ERM equivalent of timed events.

!?TM#

# - from 1 to 100 - the number of a timer.

To set up a timer, use the !!TM Receiver.


Trigger !?MW

Legend

Trigger for Wandering Monsters.

!?MW#

1) # = 0

Called when monster reaches a destination point/hero.

Comments:

It will be called a next turn after monster really reached a position or just before attacking a Hero. Called if only a corresponding flag is set. v997 keep a number of WM that is a caller.

2) # = 1

Called when a monster is killed.

Comments:

It will be called the turn after a monster is really killed. It's only called if the corresponding flag is set. v997 keep the number of the WM that is the caller.

See also: MW Receiver.


Receiver !!AR

Options Legend

Used to modify the attributes of an artifact or resource at the specified location or with a specified reference number.

!!AR#1/#2/#3:XXXX

Artifact OR resource at X, Y, Level coordinates.

Artifact : Format A1 (Artifacts are Type 5, Scrolls are Type 93)

Resource : Format R (Resources are Type 79)

!!AR#:XXXX

Artifact OR resource with # (integer value) as 1st text in message box.

This syntax is an old style and is no longer supported.

Comments:

Artifacts and resources share common ERM numbering.

Important Note:

Most of these commands will not work on an artifact or resource pile unless the artifact has some setup already done in the editor. This can be as simple as clicking the customize checkbox on the Guardians tab of the artifact or resource. If the artifact or resource pile has no setup, the command will generate an ERM error message. However, the V$ command will work correctly even if the scroll or resource does not have any setup.


Options for !!AR receiver

Options list Legend

G#1/$2/$3

Set/Check/get the guardian monster in position #1 (from 0 to 6) of type $2 (Format C) and number $3. This only saves the guardians but does not turn them on. Use X option to turn them on. Check possibilities when placed asterisk.

M^TEXT^

Set message text to TEXT. The text's length may exceed the original one. It may contain any symbols except ^ and the semicolon.

M#

Set message text to that of the timed event number #.

M-1

Restores default message for artifact.

Mz#

Set/Get message text from string variable.

M1/$

M1/-1

Set and  get the string parameters. You can use it when M command is used to set name/message.

M1/$ - $=index of string var.

M1/-1 - disable (restore default) message.

Now you can not only set but also get the string parameters. You can use it when M command is used to set name/message.

V$

Set/Check/get the number of spell to set up the Scroll. (Format SP) When used with a resource, sets/checks/gets amount of resource.

X#

Turn the guardians on if # is non-zero, otherwise turn them off. The check for the presence of the guardians is not made. So it must be set by G#1/$2/$3 option or preset with the map editor.


Receiver !!BA

Options Legend

!!BA:XXXX

Set up the attributes of a battle.

Used to set up the attributes of a battle. Generally it makes sense to set up only after !?BA0 trigger.

Notes about the !?BA Trigger (that must precede the BA receiver)

This Trigger is for every battle. But if you use 0 (!?BA0), this will be triggered at the beginning of the battle and if you use 1 (!?BA1), this will be triggered at the end of the battle.

Every time a battle takes place this trigger will work. For ANY number of battle (for all) it will work. For all your script you can use only one trigger and gain access at every battle whenever it happen. If you want for example make some help for every Sunday, just check the day and make it with receivers.

The !!BA command appears to work fine, but how do we:

   a) tell who won the battle?

   b) tell where the battle is occurring?

It must not be too hard. You have both (or one left) heroes when the battle start. So check their owners before and after the battle  (who has lost will have a different one after the battle :-) And I let you ability to set or check the battle location. Just use P command with *get* syntax: !!BA:P?v100/?v200/?v300;

Note:

Checking the location after a battle won't work because the hero moves (vanishes) from the location after the end of battle check is all done. Same with monsters - they vanish only after it has completed. So the easiest way to do it seems to be to check the current hero's owner  - if it's -1 then the hero has lost the battle.


Options for !!BA receiver

Options list Legend

A$

Get or check (NOT set) an AI only battle:

   $ = 1 if this battle is theoretical only (complete AI battle),

   $ = 0 if this is a real battle or quick battle.

So you can always check whether you can use battle receivers for this battle or not (see comments below).

Comments:

You may use set syntax, but this means nothing. If we have any battle on the map (Hero to Hero, Hero to Monsters, Hero to defended object...), the !?BA# trigger works always. Also a corresponding receiver !!BA... works fine. But. If this is a battle WITHOUT human (completely AI battle, not quick auto battle!), there is NO REAL battle simulation. AI just calculates possible losses using AI value of creatures, no more. This means that in such battles none of the next receivers may be used (corresponding triggers also will not work in this case):

!!BG, !!BM, !!BH, !!BU, !!BF

This is important for all of them treat a combat manager as filled by correct values, though actually, this is not. Game will most probably crash if this is the first battle since game start or a result is undetermined otherwise.

Warning! Even for Human battle, the combat manager IS NOT READY in !?BA0 trigger section. So you cannot use

!?BA0;

!!BH0:N?v426;

BH receiver should be used only in BH trigger section.

I see that using BA:A may be not the easiest way to track it and made another change. We have flag1000 as a marker of HUMAN/ai owner of a hero. For the battle trigger !?BA# this flag is set to inverse "complete AI battle" flag. So you can use it to check like this:

!?BA1&1000;

Here you run !?BA trigger section only if this is a real battle (there is at least one human as an opponent).

In many senses this flag1000 value is the same as before I think that this is enough for other battle triggers: !?BG, !?BR and !?BF must not be called in theoretical battles (complete AI battles).

B#

Set the background picture for the battle. See table "Background picture for the battle".

Comments:

Background 21 is clearly a placeholder; I guess they were going to have a favorable winds combat screen but didn't get around to it.

Background 24 has built-in obstacles - the space between the ships; I don't yet know if those hexes are obstacles or not if you don't use BF:C, but of course if you do use BF:C, they aren't.

B^file.pcx^

Set a custom picture for a battlefield.

Comments:

Path to the file.pcx is taken from DATA folder. As usual filename+extension must not be longer than 12 chars.

D#

Disable/Enable the battle.

   # = 1 to disable (battle is automatically won)

   # = 0 to enable the battle

E$

Check for real MP battle.

   $ - is a state of the battle:

     = 2 is an AI vs non-active Human battle (runs at distant PC);

     = 1 is a Human vs Human battle (runs at two PCs);

     = 0 is all other battles (runs at this PC).

Comments:

Use this command to disable any non-reliable battle scripts. If $ is more than 0, the battle is not easy to be controlled by ERM (runs at distant or two PCs).

In Hot Seat mode you will get 0 always. The same is for Single Player mode.

H#/$

Set the Hero # that's fighting the battle.

   # = 0 for attacker

   # = 1 for defender

   $ = Hero number. $ = -2 for no hero (defender only)

M#1/#2/$1/$2

Set the Monsters that are fighting the battle.

   #1 = Attacker's monsters (0) or defender's monsters (1)

   #2 = Slot number (0..6)

   $1 = Monster type (use -1 for a slot with no monsters)

   $2 = Number of monsters

O$1/$2

Get attacker and defender owners.

   $1 - is an attacker owner (Hero's owner);

   $2 - is a defender owner (Hero's or monsters owner).

Comments:

   This may be used in !?BA0, !?BA1, !?BA50, !?BA51 triggers section or in any other battle based triggers. Only check or get syntax is available. You can set it by this command will not change it.

P$1/$2/$3

Position on the map (for background picture and terrain bonuses only).

   $1 = X;

   $2 = Y;

   $3 = Level.


Receiver !!BG

Options Legend

!!BG:XXXX

During combat, you may check/set/get parameters on actions taken by a monster stack. These receivers may be used/called only in the !?BG Trigger section.


Options for !!BG receiver

Options list Legend

A$

Type of an action:

   0 = Cancel Action (the stack can do a different action now but it may still be impossible to force, it to do most actions through ERM);

   1 = Hero cast a spell;

   2 = Walk;

   3 = Defend;

   4 = Retreat from the battle;

   5 = Surrender;

   6 = Walk and Attack;

   7 = Shoot;

   8 = Wait;

   10 = Monster casts a spell (fairy dragons).

D$

Destination position (magic to monster, walk or attack to)

E$

Get a destination monster stack (destination position is used).

   -1 if no monster stack at that position.

H$

Number of a hero owner (-1=no hero)

N$

Number of a stack  (0...41)

Q?$

Current attacking side (0=left or 1=right)

Check only!

S$

Number of a Spell to Cast (See Format SP)

Comments:

If a monster casts a spell before an action (enchanter magic or Troll resurrection), it goes before trigger.


Receiver !!BH

Options Legend

!!BH:XXXX

During combat, you may check/set/get parameters on the action taken by a hero. These receivers may be used/called only in the !?BG Trigger section.

See: Grid of the battlefield


Options for !!BH receiver

Options list Legend

C#1/#2/#3/#4

Cast a spell

   #1 - Spell number (See Format SP)

   #2 - Position to cast

   #3 - Hero Skill level (0...3)

   #4 - Check 4 Target Monster existing (alive)

M$

Disable (1) or (re)enable (0) to cast spell

Comments:

If you re-enable spell casting after a spell has been cast, the player still can't cast it immediately. The spellbook will only become accessible when the next creature stack belonging to that player gets a turn, or, if the same stack gets morale and can act again immediately.

N?$

Get or check a number of the hero (-1=no hero)

Q#1/#2/#3

Put a hex of Quick Sand or a Land Mine at a position

   #1 - Type (0=Quick Sand, 1=Land Mine)

   #2 - Position

   #3 - Redraw (1) or not (0)

Comments:

For Q command the position will be checked automatically for whether you can place a magic obstacle or not.


Grid of the battlefield


Receiver !!BM

Options Legend

You may check/set/get some parameters of a stack of monsters during combat.

!!BM#:XXXX

Check/Set/Get some parameters of a stack of monsters.

# - number of a stack (0...41).

Usually it is used like 0...20 for a first (0) player and 21...41 for a second (1) player.

Comments:

Q -

How do we read the flag notation again? (e.g. 0x200) -- what does this >mean? The value seemed to be always be 512. How does 0x200=512 again?

By Donald

A -

To look at just one bit, use & with the value of your bit, then see if the result is nonzero.

0x200 is C notation for hexadecimal values. 0x means, look out, a hexadecimal is coming! Then the digits that follow are in base 16, where 0-9 equal 0-9, and A-F equal 10-15. The last digit is the 1's place, the digit before it 16's, the digit before it 16*16 = 256's, before that 16*16*16 = 4096's, and so on. It's just like base 10 except with 16's.

512 = 2 * 256. So in hexadecimal it's 0x200 - 2 * 256 + 0 * 16 + 0 * 1.

To read the value, load it into a variable, say v1, then use VRv1:&512, then FU1&v1<>0 or whatever. The & command clears all bits except the ones you specify. Thus it lets you ignore those bits and just see the ones you want. Similarly | sets the bits you specify, regardless of the other bits.

So if you want to know if a monster stack is defending, you go

!!BMx16:F?i; [read the flags into a 32-bit variable]

!!VRi:&134217728; [just look at the bit that means defending]

!!FU1&i<>0:P; [if defending call function 1]

!!FU1&i=134217728:P; [this also calls function 1 if defending]

!!FU2&i=0:P; [if not defending call function 2]


Options for !!BM receiver

Options list Legend

A$

Attack with bonuses.

B$

Number of monsters in the stack (at the beginning of the battle).

C#1/#2/#3/#4/#5

Cast a spell.

   #1 - spell number (Format SP);

   #2 - position to cast;

   #3 - Monster skill level (0...3);

   #4 - Hero (???) Skill level (0...3);

   #5 - Check 4 Target Monster existing (alive).

D$

Defense with bonuses.

E$

Spell numbers (not a number of a spell).

Comments:

This is the number of times remaining that this stack can cast its spell this combat. So Archangels will start with this value set to 1; after they Resurrect something, this will be 0.

For BG triggers, the value changes after the trigger for them casting the spell.

F$

Monster flag (as for MA:X).

Comments:

Four of the previously unknown MA:X values are used to handle the flow of combat:

  0x01000000 = 16777216 - set if this stack has had morale this round

  0x02000000 = 33554432 - set if this stack is waiting

  0x04000000 = 67108864 - set if this stack is done acting for this round

  0x08000000 = 134217728 - set if this stack is defending

  0x00C00000 = 12582912 - set if the stack being a clone is 12582912

To check these bits, use BR:F, then use VR:& with the value corresponding to the bit you're interested in. Remember that the flags are 32 bits, and so must be put into a single-letter variable (or at least, they won't fit in a v variable). So:

!!BRx16:F?i; [read flags]

!!VRi:&33554432; [just look at waiting bit]

!!IF&i>0:M^This stack is waiting.^;

G#/$1/$2

Set/check/get active spell parameters

   # - spell number (Format SP)

   $1 - set/check/get duration (0=not applied)

   $2 - set/check/get a power

H$

Hit points

I$

Side index as for heroes,

 0 - Left,

 1 - Right.

J?$

Get or check for number of active spells.

K#

Strike a monster with #damage points.

L$

Hit points lost by the next monster in the stack.

M#1/#2/#3

Apply a spell to the monster.

   #1 = number of spell (See Format SP);

   #2 = duration in turns ;

   #3 = level of skill,

        0 - no,

        1 - basic,

        2 - advanced,

        3 - expert.

Comments:

If you cast a spell that a monster already has, it will be ignored. But you can use "Dispel" spell :-).

In Format SP, the special monster abilities aren't listed, but some were determined through testing:

   70. Stone

   71. Poison

   72. Bind

   73. Disease

   74. Paralyze

   75. Age

You can set those 6 fine with BR:M, except that a creature with Bind on it will never get to move (duration is ignored), and a Poisoned creature doesn't take damage in the first round of combat. And of course there is no graphic to show the condition being caused, but the condition itself is displayed correctly and works fine - a Stoned creature looks like it's made of stone and doesn't get to act, etc.

You can set any other spell with BM:M, even ones that have no meaning in combat - for example you can give a creature "summon boat" for 3 turns.

The graphic will show up when you right-click on the creature, and be listed as "summon boat." The creature will have a green number-of-creatures (indicating it's assumed to be a friendly spell),

except for a few spells that show up as red (magic arrow and implosion were two).

Additionally spell numbers from 76 on appear to be used for creature abilities that have a picture and effect but don't permanently affect the target (i.e. aren't displayed when you right click on the creature later). You can set these for creatures with BR:M, but it either shows no picture (but shows the name if you put the mouse over the empty square), or crashes when you look at the creature (and it's not consistent - usually it crashes, but sometimes you see a blank square).

And if you use BG:C to try to "cast" one of these spells, it either does nothing or crashes. However I worked out a few names anyway, and perhaps they'll be useful to know eventually:

   76. Death Cloud

   77. Thunderbolt

   78. ?

   79. Death Stare

   80. Acid Breath

N$

Number of monsters in the stack (current).

Comments:

A stack of Vampire Lords has 100 initially, and grows to 120. 10 are killed, but the remaining 110 do over 400 damage. Does the stack return to 120?

There is 3 numbers:

  N1. Current number.

  N2. Number before current attack (equal to N1 if this stack attacks)

  N3. Number at the beginning of the battle.

Vampire will always grow no more than N3. Playing with these 3 numbers, you can get different results.

O$

Number of a (hero's) army slot (0...6,-1)

Comments:

If O$ sets to -1, the stack will not appear in (hero's) army after the battle (summoned creatures).

If O$ sets to -1, the stack will not appear in (hero's) army

after the battle (summoned creatures).

P$

Position on a battle field.

Q#1/#2/#3

Put a hex of Quick Sand or a Land Mine at a position.

   #1 - type,

        0 - Quick Sand,

        1 - Land Mine;

   #2 - position;

   #3 - redraw

        1 - yes,

        0 - no.

Comments:

For Q command the position will be checked automatically for whether you can place a magic obstacle or not. You can use a stack number 0 for a left side and 21 for right side to be always sure that the magic obstacle will be placed (stack may be dead - all that is needed is a side number).

R$

Number of retaliations for attack (check for Royal Griffin).

Comments:

This is the number of retaliations this stack has left this round. It starts each round at 1 and becomes 0 once the stack retaliates.

For Royal Griffins it's set to 5000 each round and counts down.

S$

Speed.

T$

Type of a monster (Format C)


Receiver !!BU

Options Legend

!!BU:XXXX

Check/set/get some universal parameters of the battle.

See: Grid of the battlefield


Options for !!BU receiver

Options list Legend

S#1/#2/#3/#4/#5/#6

Summon a stack of monster on a battle field.

   #1 - Type of monster (See Format C);

   #2 - Number of monsters;

   #3 - Position;

   #4 - Side,

        0 - left,

        1 - right of owner;

   #5 - Hero's slot number,

        -1 - no slot;

   #6 - Redraw,

        1 - yes,

        0 - no.

Restrictions:

1. It must be correct position number.

2. It must be free of other monsters and obstacles position.

3. There may be no more than 20 stacks on each side.

R

Redraw a battlefield after taking some action.

Suggestion:

Do not use this command in !?BF trigger and before it.

E#/?$

Get or check alive monster stack to $ at position #.

   -1 if no alive monster stack at that position.

D#/?$

Get or check a dead monster stack to $ at position #.

   $ = number of dead monster

         -1 if not any monster stack at that position;

         -2 if there is alive stack at that position.

O#/?$

Get or check an obstacle flag to $ at position #.

Bit mask:

   $ = 0 if there is NO obstacle at the position;

   $ & 1 if there is a magic obstacle at the position;

   $ & 2 if there is an obstacle at the position;

   $ & 4 if quick sand obstacle (magic);

   $ & 8 if land mine obstacle (magic);

T?$

Check if the battle has a Tactics phase.

   $=1 if yes;

   $=0 if no.

C?$

Check if the battle has ended (on this turn).

   $=1 if yes;

   $=0 if not.

Comments:

Command C may be called from the BG1 trigger section or later.


Receiver !!CA

Options List of all buildings Legend

!!CA#1/#2/#3:XXXX

Used to modify the attributes of a town, including name, owner and internal structures.

#1 - X;

#2 - Y;

#3 - Level.

Syntax variants:

!!CA#:XXXX

Indirect reference to town at x=v[#], y=v[#+1], l=v[#+2]. (Towns are Type 98. See Format T)

!!CA0/#:XXXX

Town with town number of # on the map list (see U option below). (Towns are Type 98. See Format T)

!!CA-1:XXXX

The current town. Be careful for you can use it only in Town screen.


Options for !!CA receiver

Options list Legend

B1/$

Build the $ structure.

B2/$

Demolish the $ structure.

B3/$

Check if the $ structure built (in flag 1).

B4/$

Enable to build the $ structure.

B5/$

Disable to build the $ structure.

G$

Set/get/check a level of magic guild (in spells screen).

G$1/$2

Set/get/check a number of available spells ($2) in $1 level.

G$1/$2/$3

Set/get/check a specific spell ($3) in slot $2, level $1. See Format SP.

H#/$

Set/get/check heroes in Town garrison or visitor.

   # = 0 - hero in the town garrison;

   # = 1 - hero - a town visitor;

   $ - the number of hero (-1 = no one). See Format H.

You can get/check or set heroes. If you set it, do not forget to move the previous to somewhere.

Note:

One should be careful with the H command, for checking garrison heroes - if there isn't a specific check for whether it returns -1 or not, and just a check on something else on the hero, it will check the current hero, which might not be to good.

M1/$1/$2/$3

Set/get/check a number of available monsters ($2 - not upgraded creature and $3 - upgraded) of level $1. If you have an upgraded building, the $3 is used, otherwise $2.

M2/$1/$2/$3

Set/get/check a number of guards.

   $1 - position;

   $2 - type (see Format C);

   $3 - number.

N^text^, N#, N?#

Set/get a name of a Town.

O$

Set/get/check an owner.

See Format E1

Note1:

That if you want to set/get/use neutral as owner, see that neutral value is -1.

To check if owner of i.e. a castle is neutral use

!!CAx/y/l:O?variable; or

!!CA#:O?variable; or

!!CA0/#:O?variable;

and check if variable is -1 (replace variable with ERM variable type. See Flags and Variables, VR and FU receiverss.

But note that !!CA0/#:O?variable; has no use since if you're in the castle it is obvious that the castle is not neutral any more.

Note2:

Please note that if owner is neutral (value for object owner is -1), there is no need to get alliance team.

If however you do so, the resulted team number is shown as 0 (which in most cases is the same alliance number for human red player).

T$

Set/get/check a type of a Town (only inside).

(See Format T).

U$

Get/check a number of a Town on the map list (not hero list).


Receiver !!CD

Options Legend

!!CD:XXXX

Used to set up the parameters for town demolitions initiated by a player.

Coments:

Q -

What's happen when you destroy completely your town and there are two heroes inside it?

A -

External (visiting) hero has no choice just to go away for 6 days.Internal Hero will be lost for owner :-) He become a nobody's hero. He always stays inside and protect the town from everyone. If he wins, he will gain experience :-)

Q -

Can the AI destroy towns?

A -

AI cannot destroy a town at this time. The problem is that it's hard to formulate rules for this (though it is possible). If you want AI to break towns, you should use ERM script (take control when AI visits a town, decide for him what to do and break it yourself). But AI will rebuild town including changing it to a native hero's town type.


Options for !!CD receiver

Options list Legend

A$1/$2/$3

Lets you set up a Hero's army minimum HP to break a particular building type in particular town.

   $1 = town type (see Format T);

   $2 = building type (see Format U);

   $3 = HP of all Hero's army.

D$

   $=number of demolitions allowed per day.

E$1/$2/$3

Lets you set up a Hero's minimum experience level required to break a particular building type in particular town.

   $1 = town type (see Format T);

   $2 = building type (see Format U);

   $3 = experience.

M$

   $ = Hero's movement to lose per demolished building.

N$1/$2

   $1 = number of demolition in one day;

   $2 = cost to break next building on the same day.

P$1/$2/$3/$4/$5

Used to set up a square on the map where the battle with these monsters will take place (as though it were really there) when you break their dwelling. This may be used for adjusting a terrain type and terrain bonus during the battle. Nothing more.

   $1 = monster number inside town (0...7 basic, 8...13 upgraded);

   $2 = X;

   $3 = Y;

   $4 = Level;

   $5 = relative(1)/absolute(0) coordinates.


Receiver !!CE

Options Legend

!!CE#:XXXX

The Event in a town(# - number of event). This is the number, which should be first in the text of the appropriate event. It won't appear in the text of the message.


Options for !!CE receiver

Options list Legend

B#1/$2

Set/Check/Get the amount of resource #1 (Format R) to $2 (may be negative).

C#1/$2

Set/Check/Get a "gift" monster of type $2  (Format C) in position #1 (from 0 to 6).

D#

Do NOT build building number # (from 0 to 40)  (see Format U).

E$

Set players allowed to activate the event.  (see Format E) If $ begins with d that means bit wise OR, i.e. you can allow a player to activate the event without changing the other permissions.

Example:

E3 allows red and green and bans all other. Ed3 allows red and green but does not change permission for the other players.

F$

Set/Check/Get day of first occurrence to $.

H#

Apply or check event to human players if # = 1.

M^TEXT^

Set message text to TEXT. The text's length must not exceed the original one. It may contain any symbols except ^.

M#

Set message text to that of the timed event number #.

M-1

Do not show the message on the screen.

N$

Set players NOT allowed to activate the event.  (see Format E) If $ begins with d that means bitwise AND with inversion, i.e. you can forbid a player to activate the event without changing the other permissions.

Example:

N3 forbids red and green and allows all other. Nd3 forbids red and green but does not change permission for the other players.

Q#

Apply or check event to computer players if # = 1.

R$

Set/Check/Get the interval between successive occurrences to $.

U#

Build building number # (from 0 to 40) (see Format U).


Receiver !!CM

Options Legend

!!CM:XXXX

Get/check/set info about mouse click  Get/check/set info about mouse click  Get/check/set info about mouse click  Get/check/set info about mouse click. This receiver must follow after a !?CM trigger.

Comments:

If you want to display a message box that doesn't remain on the screen (like the normal one when a player right-clicks the mouse), use IF:Q with the 4 option. This will create a message box with no buttons (no Okay or cancel button) that will only display while the mouse is held down. If you don't want a picture, use a value of -1 for type and subtype. See the Dialogue Box Receiver page for more information on IF:Q.


Options for !!CM receiver

Options list Legend

A$1/$2

Absolute position of a cursor in pixels.

   $1 - X;

   $2 - Y.

D$

Set/Check/Get a battlefield position.

    $ - is a number of position.

The hex grid follows the numbers we already have for it (0-186) in the docs for setting up the battlefields.

The background and outside the grid is number -1.

The left hero's number is 252. The right hero's number is 253.

There's also some 254 areas along the extreme right edge of the screen below the right side hero but it only goes down about half way and the rest is -1.

F$

Flags.

   &0x200 means right mouse click

   ...

I$

Item (area) of the screen:

0	area with no item number
1	world map (mini map)
2	border of hero information square
3	kingdom overview button
4	surface/underworld button
5	quest log button
6	sleep/wake hero button
7	move hero button
8	cast spell button
9	adventure options button
10	system options button
11	next hero button
12	end turn button
13	hero list: scroll up arrow
14	hero list: scroll down arrow
20	hero list: move bar for hero #1
21	hero list: move bar for hero #2
22	hero list: move bar for hero #3
23	hero list: move bar for hero #4
24	hero list: move bar for hero #5
25	hero list: mana bar for hero #1
26	hero list: mana bar for hero #2
27	hero list: mana bar for hero #3
28	hero list: mana bar for hero #4
29	hero list: mana bar for hero #5
30	town list: scroll up arrow
31	town list: scroll down arrow
32	town list: town #1
33	town list: town #2
34	town list: town #3
35	town list: town #4
36	town list: town #5
37	adventure map
38	rollover bar (messages/chat etc.)
39	hero list: hero #1
40	hero list: hero #2
41	hero list: hero #3
42	hero list: hero #4
43	hero list: hero #5
1000	resource/date bar (edges)
1001	wood value
1002	mercury value
1003	ore value
1004	sulfur value
1005	crystal value
1006	gems value
1007	gold value
1008	date (month/day/week)
1009	wood icon
1010	mercury icon
1011	ore icon
1012	sulfur icon
1013	crystal icon
1014	gems icon
1015	gold icon
2000	hero information square
2001	hero info square: portrait
2002	hero info square: name
2003	hero info square: attack value
2004	hero info square: defense value
2005	hero info square: power value
2006	hero info square: knowledge value
Note: some areas won't even register when right-clicked and others have the no item number (value 0).

Item (area) of the  Town Screen:

numbers returned by !!CM:I when clicking on various spots on a town screen. This will eventually find its way into the ERM docs but for anyone who needs the information now, here it is. (Much of it is the same as the information listed under the CA Receiver as the numbers generally match up.) Some notes follow the item list.

0	Level 1 Mage Guild
1	Level 2 Mage Guild
2	Level 3 Mage Guild
3	Level 4 Mage Guild
4	Level 5 Mage Guild
5	Tavern
6	Shipyard (Castle, Fortress, Necropolis)
7	Fort
8	Citadel
9	Castle
10	Village Hall
11	Town Hall
12	City Hall
13	Capitol
14	Marketplace
15	Resource Silo
16	Blacksmith
17	Special Building: Mystic Pond (Rampart), Cover of Darkness (Necropolis), Artifact Merchant (Tower, Dungeon and Conflux), Escape Tunnel (Stronghold), Cage of Warlords (Fortress), Lighthouse (Castle)
18	Horde Building: Miner's Guild (Rampart), Griffin Bastion (Castle), Mushroom Rings (Dungeon), Unearthed Graves (Necropolis), Birthing Pools (Inferno), Garden of Life (Conflux), Sculptor's Wings (Tower), Mess Hall (Stronghold), Captain's Quarters (Fortress)
19	Upgraded Dwelling with Horde Building (see 18 for particulars).
21	Special Building: Glyths of Fear (Fortress), Necromancy Amplifier (Necropolis), Lookout Tower (Tower), Mana Vortex (Dungeon), Stables (Castle), Brimstone Stormclouds (Inferno), Fountain of Fortune (Rampart), Freelancer's Guild (Stronghold), Magic University (Conflux)
22	Special Buildings: Ballista Yard (Stronghold), Portal of Summoning (Dungeon), Blood Obelisk (Fortress), Library (Tower), Skeleton Transformer (Necropolis), Treasury (Rampart), Brotherhood of the Sword (Castle), Castle Gate (Inferno), NFA: Waterfall (Conflux)
23	Special Building: Battle Scholar Academy (Dungeon), Order of Fire (Inferno), Wall of Knowledge (Tower), Hall of Valhalla (Stronghold), NFA: Waterfall (Castle), NFA: Little Huts (Rampart), NFA: Swamp (Fortress), NFA: Graveyard (Necropolis), NFA: Much of the foreground area that isn't built on (Conflux)
24	Horde Building 2: Dendroid Saplings (Rampart), Cages (Inferno)
25	Upgraded Dwelling with Horde Building 2 (see 24 for particulars)
26	Grail Building
27	NFA: Waterfall (Stronghold)
28	NFA: Area just in front of the Resource Silo and Marketplace in Necropolis.
29	NFA: Much of the inbetween foreground area of Conflux once buildings have been built.
30	Level 1 Dwelling (Basic)
31	Level 2 Dwelling (Basic)
32	Level 3 Dwelling (Basic)
33	Level 4 Dwelling (Basic)
34	Level 5 Dwelling (Basic)
35	Level 6 Dwelling (Basic)
36	Level 7 Dwelling (Basic)
37	Level 1 Dwelling (Upgraded)
38	Level 2 Dwelling (Upgraded)
39	Level 3 Dwelling (Upgraded)
40	Level 4 Dwelling (Upgraded)
41	Level 5 Dwelling (Upgraded)
42	Level 6 Dwelling (Upgraded)
43	Level 7 Dwelling (Upgraded)
115	Garrison Creature Slot 1
116	Garrison Creature Slot 2
117	Garrison Creature Slot 3
118	Garrison Creature Slot 4
119	Garrison Creature Slot 5
120	Garrison Creature Slot 6
121	Garrison Creature Slot 7
123	Garrison Hero Slot
125	Visiting Hero Slot
140	Visiting Hero Creature Slot 1
141	Visiting Hero Creature Slot 2
142	Visiting Hero Creature Slot 3
143	Visiting Hero Creature Slot 4
144	Visiting Hero Creature Slot 5
145	Visiting Hero Creature Slot 6
146	Visiting Hero Creature Slot 7
147	Town Screen Background (no specific object)
148	Below Town Screen Background (between slots and icons)
149	Town Name
150	Town Icon Picture
151	Rollover Bar (hint messages)
152	Town List Scroll Up Arrow
153	Town List Scroll Down Arrow
154	Split Creature Stack Button
155	1st (top) Town in Town List
156	2nd (middle) Town in Town List
157	3rd (bottom) Town in Town List
158	Hall Icon
159	Castle Icon
160	Daily Income (produced by town)
164	Level 1 Troop Icon
165	Level 2 Troop Icon
166	Level 3 Troop Icon
167	Level 4 Troop Icon
168	Level 5 Troop Icon
169	Level 6 Troop Icon
170	Level 7 Troop Icon
171	Extra Troop Icon (Portal of Summoning)
172	Level 1 Troop Daily Growth
173	Level 2 Troop Daily Growth
174	Level 3 Troop Daily Growth
175	Level 4 Troop Daily Growth
176	Level 5 Troop Daily Growth
177	Level 6 Troop Daily Growth
177	Level 7 Troop Daily Growth
179	Extra Troop Daily Growth (Portal of Summoning)
1001	Player's Total Wood
1002	Player's Total Mercury
1003	Player's Total Ore
1004	Player's Total Sulfur
1005	Player's Total Crystal
1006	Player's Total Gems
1007	Player's Total Gold
1008	Date (Month/Week/Day)
1009	Wood Icon
1010	Mercury Icon
1011	Ore Icon
1012	Sulfur Icon
1013	Crystal Icon
1014	Gems Icon
1015	Gold Icon
30720	OK Button (Checkmark)
Notes:

1. NFA stands for Non Functional Area. These are areas of the Town Screen that produce a distinct number when clicked, but have no actual game function. NFAs vary between different town types and not every town has them. They sometimes occur in a town that doesn't have a special building using that number.

2. Many buildings numbers overlap each other. For example, the lower part of the Mage Guild in the Rampart has the Hall on the right (#10, 11 or 12) and the NFA huts on the left (#23) and clicking will often produce these numbers instead of the Mage Guild number. In a few cases, it may even be impossible to produce the actual building number when clicking due to the overlaps.

3. The number produced by clicking on a Mage Guild is always for the highest level of guild currently build. Likewise, an upgraded Dwelling number replaces a basic Dwelling number when the upgraded dwelling is built. Furthermore, the number of a horde building (when built) replaces that of the corresponding Dwelling. Other upgrades behave the same, such as the Castle's Tavern (#5) being replaced by the Brotherhood of Sword (#22) when built.

Hero Screen:

0	Empty Areas
1	Name
2	Head Slot
3	Shoulder Slot
4	Neck Slot
5	Right Hand Slot
6	Left Hand Slot
7	Torso Slot
8	Right Ring Slot
9	Left Ring Slot
10	Feet Slot
11	Misc. Slot 1
12	Misc. Slot 2
13	Misc. Slot 3
14	Misc. Slot 4
15	Ballista Slot
16	Ammo Cart Slot
17	First Aid Tent Slot
18	Catapult Slot
19	Spell Book Slot
20	Misc. Slot 5
40	Backpack Slot 1
41	Backpack Slot 2
42	Backpack Slot 3
43	Backpack Slot 4
44	Backpack Slot 5
45	Hero Portrait
46	Attack (value)
47	Defense (value)
48	Power (value)
49	Knowledge (value)
50	Attack Icon
51	Defense Icon
52	Power Icon
53	Knowledge Icon
68	Troop Slot 1
69	Troop Slot 2
70	Troop Slot 3
71	Troop Slot 4
72	Troop Slot 5
73	Troop Slot 6
74	Troop Slot 7
77	Backpack Scroll Left Arrow
78	Backpack Scroll Right Arrow
79	1st Skill Icon
80	2nd Skill Icon
81	3rd Skill Icon
82	4th Skill Icon
83	5th Skill Icon
84	6th Skill Icon
85	7th Skill Icon
86	8th Skill Icon
87	1st Skill Name
88	2nd Skill Name
89	3rd Skill Name
90	4th Skill Name
91	5th Skill Name
92	6th Skill Name
93	7th Skill Name
94	8th Skill Name
95	1st Skill Level
96	2nd Skill Level
97	3rd Skill Level
98	4th Skill Level
99	5th Skill Level
100	6th Skill Level
101	7th Skill Level
102	8th Skill Level
103	Attack (text)
104	Defense (text)
105	Power (text)
106	Knowledge (text)
107	Blessings and Curses Icon
108	Experience (text)
109	Spell Points (text)
110	Quest Log (text)
111	Dismiss Hero (text)
112	Experience
113	Spell Points
115	Rollover Bar (hint text)
116	Morale Icon
117	Luck Icon
118	Specialty Icon
119	Experience Icon
120	Spell Points Icon
122	Loose Combat Formation Button
124	Tight Combat Formation Button
126	Disable/Enable Tactics Button
127	Split Creature Stack Button
128	Quest Log Button
129	Dismiss Hero Button
130	1st Hero in Hero List
131	2nd Hero in Hero List
132	3rd Hero in Hero List
133	4th Hero in Hero List
134	5th Hero in Hero List
135	6th Hero in Hero List
136	7th Hero in Hero List
137	8th Hero in Hero List
138	Current Hero in Hero List (regardless of position)
139	God Bonus Icon
140	Level and Class
141	Flag above Hero List
30720	OK Button (Checkmark)

Heroes visiting Screens:

Common

0	Empty Areas
115	Attack Icon
116	Defense Icon
117	Power Icon
118	Knowledge Icon
300	Rollover Bar (hint text)
301	Central Area with Double Arrows
30720	OK Button (Checkmark)
Left Hero

1	Hero Portrait
3	Attack
4	Defense
5	Power
6	Knowledge
13	1st Troop Slot
14	2nd Troop Slot
15	3rd Troop Slot
16	4th Troop Slot
17	5th Troop Slot
18	6th Troop Slot
19	7th Troop Slot
27	Head Slot
28	Shoulder Slot
29	Neck Slot
30	Right Hand Slot
31	Left Hand Slot
32	Torso Slot
33	Right Ring Slot
34	Left Ring Slot
35	Feet Slot
36	Misc. Slot 1
37	Misc. Slot 2
38	Misc. Slot 3
39	Misc. Slot 4
40	Ballista Slot
41	Ammo Cart Slot
42	First Aid Tent Slot
43	Catapult Slot
44	Spell Book Slot
45	Misc. Slot 5
65	Number of Troops in Slot 1
66	Number of Troops in Slot 2
67	Number of Troops in Slot 3
68	Number of Troops in Slot 4
69	Number of Troops in Slot 5
70	Number of Troops in Slot 6
71	Number of Troops in Slot 7
81	Experience
83	Spell Points
85	Quest Log Button
87	Name, Level and Class
89	Backpack Slot 1
90	Backpack Slot 2
91	Backpack Slot 3
92	Backpack Slot 4
93	Backpack Slot 5
99	Backpack Scroll Left Arrow
101	Backpack Scroll Right Arrow
103	Split Creature Stack Button
105	Specialty Icon
107	Morale Icon
109	Luck Icon
111	Experience Icon
113	Spell Points Icon
200	1st Skill Icon
201	2nd Skill Icon
202	3rd Skill Icon
203	4th Skill Icon
204	5th Skill Icon
205	6th Skill Icon
206	7th Skill Icon
207	8th Skill Icon
Right Hero

2	Hero Portrait
8	Attack
9	Defense
10	Power
11	Knowledge
20	1st Troop Slot
21	2nd Troop Slot
22	3rd Troop Slot
23	4th Troop Slot
24	5th Troop Slot
25	6th Troop Slot
26	7th Troop Slot
46	Head Slot
47	Shoulder Slot
48	Neck Slot
49	Right Hand Slot
50	Left Hand Slot
51	Torso Slot
52	Right Ring Slot
53	Left Ring Slot
54	Feet Slot
55	Misc. Slot 1
56	Misc. Slot 2
57	Misc. Slot 3
58	Misc. Slot 4
59	Ballista Slot
60	Ammo Cart Slot
61	First Aid Tent Slot
62	Catapult Slot
63	Spell Book Slot
64	Misc. Slot 5
72	Number of Troops in Slot 1
73	Number of Troops in Slot 2
74	Number of Troops in Slot 3
75	Number of Troops in Slot 4
76	Number of Troops in Slot 5
77	Number of Troops in Slot 6
78	Number of Troops in Slot 7
82	Experience
84	Spell Points
86	Quest Log Button
88	Name, Level and Class
94	Backpack Slot 1
95	Backpack Slot 2
96	Backpack Slot 3
97	Backpack Slot 4
98	Backpack Slot 5
100	Backpack Scroll Left Arrow
102	Backpack Scroll Right Arrow
104	Split Creature Stack Button
106	Specialty Icon
108	Morale Icon
110	Luck Icon
112	Experience Icon
113	Spell Points Icon
208	1st Skill Icon
209	2nd Skill Icon
210	3rd Skill Icon
211	4th Skill Icon
212	5th Skill Icon
213	6th Skill Icon
214	7th Skill Icon
215	8th Skill Icon

Combat Screen Mouse click:

0	Background and spaces outside the Hex Grid plus some spaces near the edge of the Hex Grid
1	Hex Grid spaces (except some have a value of 0)
2000	Border Area around Buttons
2001	Surrender Button
2002	Retreat Button
2003	Combat Options Button
2004	Auto Combat Button
2005	Combat Text Window
2006	Scroll Up Arrow for Combat Text Window
2007	Scroll Down Arrow for Combat Text Window
2008	Cast Spell Button
2009	Wait Button
2010	Defend Button
2200	Statistics/Active Spell Box
2205	Primary Skills in Statistics/Active Spell Box
2207	Primary Skills in Statistics/Active Spell Box
2214	Troop Picture in Statistics/Active Spell Box
2216	Middle Slot in Statistic/Active Spell Box
2217	Lower Slot in Statistics/Active Spell Box
2218	Upper Slot in Statistics/Active Spell Box
Notes:

The Statistics/Active Spell Box only appears if this option is selected in the Combat Options screen. The box is rather tricky to click on and probably not of much use in this fashion. The information for parts of the box is probably incomplete due to the almost impossible nature of clicking on all parts of it.

P$1/$2/$3

Map position.

   $1 - X;

   $2 - Y;

   $3 - Level.

Comments:

P command work only for items 1 (small map) and 37 (big map).

R$

Enable/Disable standard reaction.

   0 - Disable;

   1 - Enable.

Comments:

If you wanted a right-click on the adventure map to do something, you'd use a CM Trigger to intercept it, then use CM:R to disable the standard do-you-want-to-leave-troops-here thing.

S$

Subtype of the action (usually 14).

T$

Type of an action (usually 512).


Receiver !!DO

Options Legend

!!DO#1/#2/#3/#4:XXXX

Calls a function trigger multiple times:

   #1 - is number of function;

   #2 - is start value;

   #3 - stop value;

   #4 - is increment.

Comments:

The x16 variable (used in functions called with the DO Receiver), stores the current cycle number of the function. For example, if the function is being repeated 12 times (from 1 to 12), the first time through, x16 will equal 1, the second time 2 and so on. If you change the x16 variable, you can actually "speed up" or "slow down" a function loop, or even exit from it completely by setting x16 equal to the end value (or higher) that was specified in the DO receiver.

Now if you change x16 in the function you can speed up, slow down, repeat or end the cycle. Moreover, all parameters are only set when you first enter the function. Within the function, you may change them.

Example1:

!!DO1/2/10/2:P5;

...

!?FU1;

!!IF:M^Var x1=%X1 and x16=%X16^;

!!VRx1:+1;

!!VRx16:+1;

It must show:

Var x1=5 and x16=2

Var x1=6 and x16=5

Var x1=7 and x16=8

Example2:

Loop backwards, jumping 4 elements / loop (speeding up) , starting with 47

!!DO2/1/66/1:P47/11; [send  value 47 to the function's variable x1]

!?FU2;

!!VRv5:Sx1+1-x16; [do the loop backwards]

!!IF:M^the present value of x16 is $X16 and v5 is $V5^;

!!VRx16:+7; [set jump value to 8]

Instead of 66 loops you get only 9 loops, with these values:

x16:  1  9 17 25 33 41 49 57 65

v5:  47 39 31 23 15  7  -1 -9 -17

Other sugestions:

The same can be done forwards.

Also, the !!VRx16:+7; can be replaced (i.e.) with R7: "!!VRx16:R7";,

calculating a next random jump value up to 7, every jump, or (i.e.) with Rx2: "!!VRx16:Rx2",

calculating  a random number up to x2, in this case x2 being 11 (!!DO2/1/66/1:P47/11;).

However, you have got to take care when asigning x16 a value, directly or through another variable.

If this value is not within the loop extremes (in this case 1 and 66: !!DO2/1/66/1:P47/11;) the cycle breakes, meaning you end the loop prematurely.

Questions and answers:

Q: How is x16 effected by nested DOs?

A: Each DO loop keeps its own x16 value.

Q: Let's say I have the following code: (this would reflect, say, checking a 10x11 array for something)

!!DO1/1/10/1:P;

!?FU1;

!!DO2/20/30/1:P;

point A

!?FU2;

point B

My question is, at point B, will x16 have a value between 1 and 10, or between 20 and 30?

A: 20 and 30

Q: Also, at point A, will x16 have the value from DO1, or DO2?

A: DO1, because the line is inside FU1 function

A: (note) If you change the value of x16, that will change the loop. For example, if you set x16 to 999 (or even 50 in this case), that would end this loop as soon as it checks the x16 value (after it finishes one looping).

Q: I have a main loop covering all heroes (DO1/0/155/1), but for each hero I need to check through all creature slots (DO2/0/6/1). Would it work?

A: That should work fine with a standard nested DO loop structure as far as I can tell.


Options for !!DO receiver

Options list Legend

P$1/$2/$3... up to $16

To get access to parameters use x# (#=1...16) syntax. They may be used anywhere (within the function) that standard variables are used. When you call another function (see example), all parameters that are not set will be inherited.

Note:

the P parameter must be placed in the !!DO calling (even if no values are to be transfered to the loop) for the loop to work correctly .

Example:

!!DO1/1/15/1:P; is right but

!!DO1/1/15/1; is wrong command

All ERM commands (receivers, instructions) have to use at least one parameter in order to work correctly.


Receiver !!FU

Options Legend

!!FU#:XXXX

Function receiver - transfers control to ERM code (following !?FU trigger)

# = 1 to 30000.

Used to create a separate section of code that can be accessed from more than one place and thus reused. A function is called by using the function receiver. The function trigger then defines the start of the function code.

Declarations and Instruction usage:

If you call a function with an instruction, the function must be declared *before* the instruction.

So, for example, if you want to call function 100 at the start of a map, you can put in the instruction !#FU100:P; but it won't work if the function trigger follows the instruction. Instead, the function trigger (and code within it) must be first.

So:

ZVSE

!?FU100;

!!IF:M^This is function 100.^;

!#FU100:P;

The above will work but if !#FU100:P; would have been put first (right after ZVSE), it wouldn't work. You wouldn't get an error message but the function wouldn't execute.

Usage of a variable in a function receiver:

You can use a variable in a function receiver. So you could put, for example, !!FUv10:P; and the function called (if it exists) would be the function number *currently* stored in v10.

Function Examples:

Example1:

!?FU1;

!!IF:M^Here we are before. %X1 %X16^;

!!VRx1:+1;

!!FU2:Px1;

!!IF:M^Here we are after. %X1 %X16^;

To call a function use a receiver FU# (#=1...1000)

Example2:

!!FU1:P5;

This calls the function above with one parameter (5)

Local Variable in functions:

In functions you have local variables (up to 100). To get access to local variables use y# (#=1...100) syntax. You can set/check/get these vars. Every call creates a unique set of local variables that all equal to zero at entrance. So all operation with local variable take place inside a function only. You can make recursive calls.

Example3:

!!FU1:Pi/102/v10/35; means that in the body of the function we have:

!?FU1; x1=i, x2=102, x3=v10, x4=35 others x5...x16 are undefined

!!IF:M^x1=%X1, x2=%X2^;

Then if you call a function with other parameters, x1...x16 variables in a body of a function will have corresponding values.

!!FU1:P10/20; will show "x1=10, x2=20"

!!VRv5:S33;

!!FU1:Pv5/0; will show "x1=33, x2=0"

Y variables y1...y100 are local variables. You can use them inside functions for any purpose. All functions have their OWN y variable set, even if you call recursively one function. When you go out of a function a previous set of y vars is restored.

!!FU1:P; call FU1

!?FU1; y1 is undefined (=0)

!!VRy1:S1; y1=1

!!FU2:P; call FU2

!!IF:M^y1=%Y1^; "y1=1" (y1 take its original value 1 that was before calling FU2)

!?FU2; y1 is undefined (=0)

!!VRy1:S2; y1=2

!!IF:M^y1=%Y1^; "y1=2"

Q -

Can we make a generic function where I terra transform a big square?

A -

But I still recommend to pass all arguments to the function like this:

!!FU#:Px1/y1/x2/y2/level/type/subtype;

This is a call:

!!FU20000:P5/15/7/28/0/2/50; x1=5,y1=15,x2=7,y2=28,level=0,type=2,subtype=50

Function:

!?FU20000; transform an area

!!DO20001/0/144/1:Px1/x2/x3/x4/x5/x6/x7;

!?FU20001&x16>=x1/x16<=x3; transform a column

!!DO20002/0/144/1:Px16/x2/x4/x5/x6/x7;

!?FU20002&x16>=x2/x16<=x3; Transform one square

!!VRv1:Sx1; X coordinate

!!VRv2:Sx16; Y coordinate

!!VRv3:Sx4; level

!!TR1:Tx5/x6/d/d/d/d/d/d; start retain type

Functions

A function is an entry point as a trigger and a body as receivers.

The trigger is !?FU# (#=1...1000)

Receivers are any receivers.

Example4:

!?FU1;

!!IF:M^Here we are before. %X1 %X16^;

!!VRx1:+1;

!!FU2:Px1;

!!IF:M^Here we are after. %X1 %X16^;

To call a function use a receiver !!FU# (#=1...1000)

It has only one command: P

P$/$/$... up to 16 #s.

Example5:

!!FU1:P5;

This calls the function above with one parameter (5). To get access to parameters use x# (#=1...16) syntax. They may be used everywhere when f...t variables. When you make a next call to another function (see example) all parameters that are not set will be inherited.

In functions you have local variables (up to 100). To get access to local variables use y# (#=1...100) syntax. You can set/check/get these variables. Every call creates a unique set of local variables that all equal to zero at entrance. So all operation with local variables take place inside a function only. You can make recursive calls.

Coupling

You can add a code (receivers) to already exist triggers using the same triggers two or more times.

Example6:

!?FU1;

!!... receivers 1

...

!?FU1;

!!... receivers 2

...

!!FU1:...

Last call execute all receivers 1 and then all receivers 2 at the same context.

Example7:

!!IFv10:S5;

!!SG4/3/0:M1/v10; set sign message to string var z[v10] or z5

!!SG4/3/0:M1/?z10; get current sign message to z10 string var


Options for !!FU receiver

Options list Legend

E

This command allows to exit from the last function/trigger immediately.

Comment:

You can use this command to avoid re-entering the function.

Example1:

  It was:

!?FU123;

...

!!VRv10:S0 T10; [get random value]

!?FU123 v10<5; [continue only if random value <5]

...

  Now you can do it this way:

!?FU123;

...

!!VRv10:S0 T10; [get random value]

!!FUv10>=5:E;  [exit the function only if random value >=5]

;[continue only if random value <5]

...

  The plus of this technology is that you have the same set of y and other local vars and you can use it in triggers also.

Example2 (complete):

***************

ZVSE

!?LE3/4/0;    [all is attached to local event]

!!IF:M^L0-0^;

!!FU123:P;

!!IF:M^L0-1^;

!!FU:E;       [leave]

!!IF:M^L0-2^;

!?FU123;

!!IF:M^L1-0^;

!!FU124:P;

!!IF:M^L1-1^;

!!FU:E;       [leave]

!!IF:M^L1-2^;

!?FU124;

!!IF:M^L2-0^;

!!FU125:P;

!!IF:M^L2-1^;

!!IF:M^L2-1a^;

!?FU125;

!!IF:M^L3-0^;

!!FU126:P;

!!IF:M^L3-1^;

!!FU:E;       [leave]

!!IF:M^L3-2^;

!?FU126;

!!IF:M^L4-0^;

!!IF:M^L4-1^;

!!FU:E;       [leave]

!!IF:M^L4-2^;

***************

  You will get the next messages:

L0-0

L1-0

L2-0

L3-0

L4-0

L4-1

L3-1

L2-1

L2-1a

L1-1

L0-1

P$1/$2/$3... up to $16

To get access to parameters use x# (#=1...16) syntax. They may be used anywhere (within the function) that standard variables are used. When you call another function (see example), all parameters that are not set will be inherited.

Note:

The P parameter must be placed in the !!FU calling (even if no values are to be transfered to the function) for the command to work correctly.

Example:

!!FU1:P; is right

but !!FU1; is wrong command

All ERM commands (receivers, instructions) have to use at least one parameter in order to work correctly.


Receiver !!BF

Options Legend

This command lets you customize a battlefield and should be used with the !?BF Trigger to prepare it before the first round of combat begins, although placing obstacles is also possible during the combat itself.

!!BF:XXXX

Sets up a battlefield with custom placement of obstacles.

See: Grid of the battlefield

Comments:

Also we've noticed that VR:R doesn't work inside a BF trigger; or rather, it always produces the same series of numbers, every battle. The first number generated in battle is always the same as the first number generated in any other battle. VR:T is fine, but of course can only be used once per BF trigger.

Answer of Slava: I think this is made on purpose so you could use the same pattern of a battle whenever you load this map. As I stated before, the way you use VR:T and VR:R is good.

1. Generate the number with VR:T ->n

2. Now generate n random numbers with VR:R and skip them.

3. Now all is ready to use VR:R for your script.

I think this is quite simple, random and may be organized like one function :-)

Example:

A Battlefield with BF:M

ZVSE

!?BF;

!!BF:M131071/65537/65537/65537/65537/65537/65537/65537/65537/65537/131071;

Every number is a line from top down and is a bits combination for every position:

First and last lines bits: 11111111111111111 = 131071 (1+2+4+8+...+65536)

Other lines bits: 10000000000000001 = 65537 (65536 + 1)

Example by Donald:

Every time your hero moves, you get attacked by 1 Pikemen. It displays what the number of the first obstacle is, and then you get a battlefield with 4 obstacles (3 for the last 3). That obstacle number is displayed in the upper left, then it goes upper right, lower left, lower right. So the first screen shows obstacles 0-3, with 2 in the lower left.

ZVSE

* pikemen at every step!

!?HM-1;

!!HE-1:T0/0/0/0/1;

* place 4 obstacles

!#VRv1:S0;  [obstacle number]

!?BA0;

!!IF:M^Obstacles starting from #%V1^;

!?BF;

!!BF:C;  [start with empty except for phantom cliff]

!!BF:Ov1/69;

!!VRv1:+1;

!!BF:Ov1/77;

!!VRv1:+1;

!!BF:Ov1/171;

!!VRv1:+1;

!!BF&v1<>91:Ov1/179;

!!VRv1:+1;

!!VRv1&v1=92:S0;


Options for !!BF receiver

Options list Legend

C

Clear the battlefield (every square is accessible)

O#1/#2

Place a particular object

   #1 - type of obstacle to place (0...90). For the moment no Water object

   #2 - position (0...184)

M#1/#2/#3/#4/#5/#6/#7/#8/#9/#10/#11(/#12)

Places a rock at specific positions on the battlefield

   #1 - bitimage of position 0...16

   #2 - bitimage of position 17...33

   #3 - bitimage of position 34...

   . ..

   #12 - type of obstacle to place (0...90)

Comments:

If a battle field is not filled, it still will have inaccessible squares - e.g., drawbridge in a town siege screen. The M command automatically includes the C command. If #12 is omitted, the M command places  obstacle 84 (rock).


Common Receivers options

Z commands are common to all receivers but are standard for ERM 1.4 only. They are now mostly obsolete for ERM 2.0 and later. (They would not work with many new receivers).

Z0

The receiver is considered to be "switched on". That is, it accepts all the instructions from the current moment. From the very beginning all the receivers are "switched on". THIS OPTION IS DISABLED IN ERM 2.1 AND LATER VERSIONS.

Z1

The receiver is "switched off". That is, it does not accept all the instructions from the current moment. THIS OPTION IS DISABLED IN ERM 2.1 AND LATER VERSIONS.

Z2

The condition of this receivers is inverted. THIS OPTION IS DISABLED IN ERM 2.1 AND LATER VERSIONS.

Z3

Restores the previous condition of the receiver (The depth of the memory is one level). THIS OPTION IS DISABLED IN ERM 2.1 AND LATER VERSIONS.

Z4

The trigger - is an equivalent of this receiver is" switched on" that is its receivers starts work. From the very beginning all the triggers are "switched on".

Z5

The trigger - is an equivalent of this receiver is "switched off" that is its receivers does not work.

Z6

The condition of the trigger (equal the current receiver) is inverted.

Z7

To restore the previous condition of the trigger (equals the current receiver). The depth of the memory is one level.


Receiver !!GE

Options Legend

Used to modify the attributes of a global (timed) event.

!!GE#:XXXX

Receiver is global event on the map (# = number of event which must be placed as the first thing in the event text).

Example:

!?GE1; First changes that cannot be done with instructions

!!OW:R0/0/0;  *Remove all resource of red player

!!OW:R0/1/0;

!!OW:R0/2/0;

!!OW:R0/3/0;

!!OW:R0/4/0;

!!OW:R0/5/0;

!!OW:R0/6/0;


Options for !!GE receiver

Options list Legend

B#1/$2

Set/check/get the amount of resource #1 (from 0 to 6) to $2 (may be negative). See Format R.

D#1/#2

Disable (#2=1) or enable (#2=0) event for gamer #1 (see Format E1)

E$

Set players allowed to activate the event. (see Format E) If $ begins with d that means bit wise OR, i.e. you can allow a player to activate the event without changing the other permissions.

Example:

E3 allows red and green and bans all other. Ed3 allows red and green but does not change permission for the other players.

F$

Set/check/get day of first occurrence to $.

H#

Apply or check event to human players if # = 1.

M^TEXT^

Set message text to TEXT. The text's length must not exceed the original one or it will be truncated. It may contain any symbols except ^ or the semicolon.

M#

Set message text to that of the timed event number #.

M-1

Do not show the message on the screen.

N$

Set players NOT allowed to activate the event. (See Format E) If $ begins with d that means bit wise AND with inversion, i.e. you can forbid a player to activate the event without changing the other permissions.

Example:

N3 forbids red and green and allows all other. Nd3 forbids red and green but does not change permission for the other players.

Q#

Apply or check event to computer players if # = 1.

R$

Set/check/get the interval between successive occurrences to $.


Receiver !!HE

Options Legend

Used to modify characteristics, troops, inventory, skills, location and just about everything imaginable for a specified hero. Also used for setting blessings and curses.

!!HE#:XXXX

The hero number of # (see Format H - each hero has a unique number in the game).

!!HE#1/#2/#3:XXXX

The hero  at X, Y, Level coordinates

#1 = X

#2 = Y

#3 = Level  (0-Surface, 1-Underground)

!!HE-1:XXXX

The hero who activated the trigger. Using this format simplifies things greatly as you do not need to keep changing the coordinates for every !!HE command if you move the trigger event or object.

Comments:

For "couple" creatures (basic and upgraded), if the first is changed, the second will also be changed.

In the line, options should not be separated by other symbols and may be repeated with the last cancelling all the previous. The same receiver can occur several times. There might be comments between trigger's and receivers' descriptions.


Options for !!HE receiver

Options list Legend

A1/$1/$2

Equip an artifact:

   $1 - number of artifact. (see Format A1).

   $2 - position on the body where to place (see Format AP).

Comments:

If the slot is busy, the ERM Flag1 will be set to 0 otherwise to 1.

A2/$1/$2/$3

Calculate numbers of an artifact (get or check):

   $1 - number of artifact. (see Format A1).

   $2 - returns number of artifacts of the type hero has (get or check syntax)

   $3 - returns the numbers of equipped artifacts of the type (get or check syntax)

A3/$1/$2/$3

Remove several copies of artifact:

   $1 - number of artifact. (see Format A1).

   $2 - numbers of copy to delete

   $3 - flag to delete first equipped (1) or in backpack (0)

A4 (ERM v. 3.58)

Equip an artifact You can now automaticaly add spells from artifacts. Also, the locked slots problem solved.Uses an internal function for this so artifact will be equipped if possible and not equipped (put to backpack) otherwise.

Example:

!?LE4/2/0;

!!HE-1:A4/129;  [equip Angelic Alliance]

!!HE-1:A4/15;   [try to equip a shield but put to backpack]

!!HE-1:A4/1016; [equip Magic Arrow scroll]

!!HE-1:A4/1000; [equip Magic Book]

A#

Get/Give/Remove an artifact.

# is the artifact's number (see {Format A1}).

    If # > 0 the artifact will be added to the hero's backpack.

    If # < 0 removes the artifact from all slots.

Comments:

An artifact given with this command will not be automatically equipped and will be placed in the hero's backpack.

HE:A-1 command will delete all scrolls from the hero.

Example:

!!HE106:A-1;    [Remove all scrolls in Lydorie's possession]

Notes:

1. If you use HE:A1 to equip an artifact that gives spells, such as a Tome, Spell Scroll or Spellbinder's Hat, the spell won't be added. It will only be added if the player unequips and reequips the artifact.

Note: The new HE:A4 command will added for 3.58 WILL correctly add the spells to the spellbook. However, since this command isn't in 3.57f, you probably shouldn't include anything about it in the help file yet (unless Slava decides to add this to the allinone build of 3.57f).

2. If you use the HE:A1 command to equip an artifact, it will equip into a locked slot and the slot won't register as busy.

Note: Again, this particular issue is solved by the new A4 command which only equips to a non-busy, non-locked slot.

3. If you remove an artifact that has added a spell to a hero's book with ERM (HE:A- or HE:A3), the spell remains in the hero's book permanently.

4. If you remove an artifact with HE:A- it will correctly remove the added bonuses but if you remove it with HE:A3 it won't remove the bonuses.

5. If you remove a combo artifact with HE:A- it will correctly remove the locked slots and added bonuses too, but if you remove it with HE:A3 it won't remove either!

B0/$

Set/get the name of a hero.

B1/$

Set/get the bios of a hero.

Comments:

If it has a default name or bio, you will get a void string not default text.

Example:

!!IFv10:S3;

!!IFz15:S^This is a new bios.^;

!!HE-1:B1/?v10;  get the old bios of current hero to z[v10] -> z3 string var

!!HE-1:B1/z15; set the new bios to z15 string var

B2/$

Set/get the class of a hero.

   $ is a class (0...17).

Divide $ to 2 and you will get a town/class type.

C0/#1/$2/$3 - Change monsters: format 1.

 #1 - hero's slot number (slots are numbered 0..6);

 $2 - monster type (Format C);

 $3 - number of monsters.

C1/#1/$2/$3 - Change monsters: format 2.

All monsters of type #1 will change into:

 $2 - type: (Format C);

 $3 - number.

Example:

!!HE-1:C1/0/1/d; (all pikemen change to halberdiers).

C2/#1/#2/#3

Add a new stack of monsters to a hero.

 #1 - type of monsters (Format C);

 #2 - number of monsters;

 #3 = 1 - ask human to find room in the army if all slots are filled.

    = 2 - use AI to add it (if it feels the addition is more valuable than an existing stack).

C#1/#2/..../#14

Change monsters : Give to player a choice of monsters set.

Use C command with 14 parameters:

   #1 - type of monster 1 (-1 = no)

   #2 - number of monsters 1

   #3 - type of monster 2 (-1 = no)

   #4 - number of monsters 2

   #5 - type of monster 3 (-1 = no)

   #6 - number of monsters 3

   #7 - type of monster 4 (-1 = no)

   #8 - number of monsters 4

   #9 - type of monster 5 (-1 = no)

   #10 - number of monsters 5

   #11 - type of monster 6 (-1 = no)

   #12 - number of monsters 6

   #13 - type of monster 7 (-1 = no)

   #14 - number of monsters 7

Example:

This will be a dialog like when you leave creatures.

!!HE-1:C5/6/7/8/9/10/11/12/13/14/15/16/17/18;

!!HE-1:C1/2/-1/0/-1/0/-1/0/-1/0/-1/0/-1/0;

D

Call upgrade dialog for hero's army (no parameters)

E$

Set/check/get experience# to the hero

E$1/$2

Set/check/get hero's experience (additional syntax)

   $1 - Experience points

   $2 - Hero's level

Additional syntax: E$1/?$2/1.

The same as HE:E$1/?$2 but without redrawing. For standard syntax some of them called redrawing always even if you check only.

F$1/$2/$3/$4

Set/check/get primary skills.

$1=Attack, $2=Defense, $3=Power, $4=Knowledge (Format PK)

F$1/$2/$3/$4/1

Additional syntax for primary skill checking.

Adding /1 at the end of the command returns the base value of a hero's primary skill without including artifact bonuses.

   $1 - attack;

   $2 - defense;

   $3 - power;

   $4 - knowledge.

Comments:

You can use only get or check syntax. You can also set it but it will do nothing.

e.g., !!HE-1:F?v100/?v101/?v102/?v103/1;

H$1/$2/$3/$4

Set army type for newly hired heroes.

   $1 - slot number (0,1,2);

   $2 - monster type (-1 means no monster);

   $3 - min value of monsters number;

   $4 - max value of monsters number (may be equal to min number for fixed number).

Comments:

This will be applied to a hero that CANNOT be hired right now. So if Orin and Jeddite are currently available in a tavern, their army WILL NOT be changed until next week. But if you change the army of Crag Hack and he will be available to be hired after you hire Orin or Jeddite, he WILL have the army that you set.

Then, when you hire a hero that appears in a Tavern in the beginning of the week, he will have 2 or 3 slots of army (it's not possible to set 2 or 3 exactly). So you can set 1st and 2nd slots to desired monsters and 3rd slot to -1 monster type. This will result in the hero always having 2 slots of monsters. Then if you hire a Hero, he or she will have only one slot of monsters and number 1.

Example:

Set Army of Orin to Gnoll at the game start

!#HE0H0/99/3/3H1/-1/2/2H2/-1/0/0;

This may be used later during a game.

!?LE3/7/0; Trigger for cycle

!!DO21000/0/155/1P; Set Army to all Heroes

!?FU21000;

!!VRv1Sx16;

!!HEv1H0/99/3/3H1/-1/2/2H2/-1/0/0;

I$

Set/check/get spell points.

Be sure to use d for relative change if you wish to add or subtract rather than set.

Example:

!!HE-1:Id-1; This will reduce the hero's current spell points by 1.

Additional syntax: I$/1.

The same as HE:I$ but without redrawing. For standard syntax some of them called redrawing always even if you check only.

K

Instantly kills the hero (put this to a well - all fall inside).

Additional syntax: K$/1.

The same as HE:I$ but without redrawing. For standard syntax some of them called redrawing always even if you check only.

L#^file.pcx^

Sets a hero's portrait to an external image file.

   # = 1 - set small picture to file.pcx;

   # = 2 - set large picture to file.pcx;

   # = 3 - reset both pictures to default (no ^...^ allowed).

Comments:

file.pcx will be searched for in heroes DATA directory. But you can use subdirectory. Example ^c\name.pcx^ - in "c" subdirectory of the DATA dir. Or ^..\maps\1.1^ - in MAPS dir of Heroes.

Important! The full length of file name (with subdirectory path) cannot be more than 12 characters.

The screen will be redrawn automatically if you change the hero's portrait.

L0/$

Set hero's portrait to portrait number $. (Cf.CMD file).

L4/$

Sets both the small and large portrait to the game portrait equal to $.

L5/$1/$2

Set a hero portraits.

   $1 - String variable for large pic (0-do not change)

   $2 - String variable for small pic (0-do not change)

M#1/$2

Set/check/get spell (only for spellbook).

   #1 - spell (See Format SP);

   $2 - level (0 = remove spell, 1 = give spell).

Note:

that a check should be performed  to see if hero has spellbook (like M=0/1, flag 1 set to 1 if hero knows summon boat).

Also note that it only checks if the spell is in the actual spell book, it won't know if the hero has a scroll or tome that gives the spell.

N$

Check or get the hero's number.

Comments:

Don't try to set the hero's number to something else. It won't work or will cause instability.

Example: !!HE-1:N?v100;

O$

Set/check/get the hero's owner  (see Format E1).

$ - player number that controls hero. If a hero isn't on the map and thus has no owner, the number returned will be -1.

Comments:

This command should work properly to let you change the owner of a player, unlike in previous versions where the changeover didn't work completely.

Note: If you try to give a hero to an owner that has 8 active heroes already, the command will be just canceled. Check a hero's owner to be sure that he/she was transferred successfully.

P$1/$2/$3

Set/check/get the hero to X = $1, Y = $2, level = $3. (Move)

Comments:

In addition to its normal use of moving a hero on the map, this command can also be used to bring a hero from the hero pool (not currently "in play" into the game. After you bring the hero onto the map with this command, you should then set the hero's owner with the HE:O command.

P$1/$2/$3/S

Move an opponent hero (not one of your color) with sound and redraw operation:

   if $<>0 - move hero with sound and redraw (teleport);

   if $=0 - old style (hero jump to the new place immediately).

Old style of command (without $) suppose $=0.

R0/$

Set/check/get hero's moral (until next battle).

R1/$

Set/check/get hero's luck (until next battle).

R2/$

Set/check/get sex of a Hero.

   $=0 - Male,

   $=1 - Female.

R3/$

Set hero's availability in the hero pool for all players.

   $ - (set/check/get) enabled (1) or disabled (0) hero to hire to all.

R3/$1/$2

Set hero's availability in the hero pool for each player.

   $1 - (set/check/get) enabled (1) or disabled (0) hero to hire;

   $2 - (set/check/get) players that may hire (one bit - one color).

Comments:

$2 makes sense (will be set) only if you enable a hero.

If you disable a hero that is owned by any player, the hero will be killed.

R4/$

Set/check/get a hero's Tactic control.

    -1 = Enable;

     0 = Disable.

R#1/$/#2

R command with redraw control (for all HE:R commands).

   #1 - R command number;

    $  - value;

   #2 - redraw flag (1=redraw, 0=no redraw).

Comments:

The adventure screen will no longer be redrawn automatically after an HE:R command. If you wish it to redraw, use this syntax with a redraw flag of 1.

S#1/$2

Set/check/get secondary skill.

   #1 - Format SS in level;

   $2 (0=none, 1=basic, 2 =advanced, 3 =expert).

Comments:

You can even set all(!) secondary skills (28 altogether) but only the first eight will show on the hero screen.

T$1/$2/$3/$4/$5

Provoke a battle but only with one type of monsters.

   $1 - X position of the battle;

   $2 - Y position of the battle;

   $3 - Level of the battle;

   $4 - type of monsters to fight;

   $5 - number of monsters to fight.

Comments:

X, Y and level are used only for choosing the type of the ground and corresponding bonuses.

U$1/$2/$3

Set/check/get hero's patrol position and radius.

Patrol position will be set to X($1), Y($2) (the level is fixed).

The radius will be set to $3 ("set free" if $3 = -1).

V#1/$2

Set/check/get if hero visited (1) or not (0) $2 all objects of type #1 ($2 is used as a bit mask)

V#1/#2/$3

 #1 - object type;

 #2 - object number (0..31);

 $3 - hero visited (1) or not (0);

Types of objects (#1):

(Number in parenthesis is object type number).

0 - Learning Stone (100);

1 - Marletto Tower (23);

2 - Garden of Revelation (32);

3 - Mercenary Camp (51);

4 - Star Axis (61);

5 - Tree of Knowledge (102);

6 - Library of Enlightenment (41);

7 - Arena (4);

8 - School of Magic (47);

9 - School of War (107).

Examples:

V0/0/0 - set the Learning stone number 0 to be "not visited" by the hero.

V6/2/0 - set the Library of Enlightenment number 2 to be "not visited" by the hero.

V5/2 - set all Trees of Knowledge except second to be "not visited" (second one is visited).

W$

Change Hero's movement points.

   $ - points to change (W0,Wd-10,W?i,W>=100...).

This number is not the number of steps that the hero can take in a turn but is a much higher number (usually between 1500 and 2000 depending on fastest troop speed) that the game sets internally. This was probably done so that they wouldn't have to deal with fractions when calculating terrain bonuses and penalties (plus pathfinding, logistics, Boots of Speed, etc.). On grass terrain with mixed creatures, 1 step equals about 100 movement points.

Additional Syntax: W$/1

The same as HE:W$ but without redrawing. For standard syntax some of them called redrawing always even if you check only.

X#(...)

Change hero's specialty.

# from 0 to 6. The number of other parameters depends on a type of specialization #.

Syntax X options for HE receiver:

 0/$

To give to a hero a secondary skill $ (See Format SS).

 1/$

To make the hero by the master of creatures $(and possibly $+1) (See Format C).

 2/$

To generate the resources $ each day. (See Format R).

 3/$

To give to the hero a spell $ (See Format SP).

 4/$1/$2/$3/$4

Another way to make the hero by the master of creatures $1(and possibly $1+1) (see Format C). $2 - bonus of monster's attack, $3 - bonus of monster's defense, $4 - bonus of monster's damage.

 5/#

Set hero's additional specialty (See Format AD).

 6/$1/$2/$3

Upgrade of creatures type $1 and $2 ($1+1 and $2+1 possible as well) to creatures type $3. Upgrade's price is counted as difference between the prices of the creatures (if its more than zero)

 7/$1/$2

Dragon Master.

   $1 - attack bonus.

   $2 - defense bonus.

 8/#

   # = 1 - Walking Darkness. Shroud is replaced for all other players as hero moves.

   # = 2 - Town Builder. Hero may choose which type to rebuild a destroyed town as from any of the 9 available town types.

Y$1/$2/$3/$4

Bless and Curse. See Blessings and Curces Table.

Give, remove or adjust blessings and curses on a specific hero.

!!HE#:Y$1/$2/$3/$4;	Place a blessing or curse on the hero number of # (see Format H - each hero has a unique number in the game).
!!HE#1/#2/#3:Y$1/$2/$3/$4;	Place a blessing or curse on the hero at X, Y, Level coordinates. #1 = X; #2 = Y; #3 = Level (0-ground, 1-Underground).
!!HE-1:Y$1/$2/$3/$4;	Place a blessing or curse on the hero who activated the trigger. Using this format simplifies things greatly as you do not need to keep changing the coordinates for every !!HE command if you move the trigger event or object.

Options

Y$1/$2/$3/$4	Add/change/remove a curse. $1 - number of curse from 1 to 65; $2 - the power of curse (not used for Blinding and Lock); $3 - the length in days of the curse; $4 - what to do (1 = set, 2 = add/sub, 0 = del). Comments: Every hero can have only one curse of each type. So when you add/sub (sub is addition of negative value), that means that the power and the length will be changed to a sum of old and new values. If you del the curse, the power and length parameters do not matter.
Y2/$1/$2/#	Slot lock curse. $1 - number of slot to lock (- 1 = random slot). Use: Format AP. If the slot has an artifact, it will be hidden and appear at the same place when curse has gone.


Options list for !!HE receiver
A1/$1/$2 Equip an artifact

A2/$1/$2/$3 Calculate numbers of an artifact

A3/$1/$2/$3 Remove several copies of artifact

A4 Equip an artifact automaticaly

A# Set/check/get/give/remove an artifact

B0/$ Set/get the name of a hero

B1/$ Set/get the bios of a hero

B2/$ Set/get the class of a hero

C0[1]/#2/$3/$4 Change monsters

C2/#1/#2/#3 Add a new stack of monsters to a hero

C#1/.../#14 Change monsters : Give to player a choice of monsters set

D Call upgrade dialog for hero's army

E$ Set/check/get hero's experience

E$1/$2 Set/check/get hero's experience

F$1/$2/$3/$4 Set/check/get primary skills

F$1/$2/$3/$4/1 Set/check/get primary skills

H$1/$2/$3/$4 Set army type for newly hired heroes

I$ Set/check/get spell points

K Instantly kills the hero

L#^file.pcx^ Sets a hero's portrait

L0/$ Set hero's portrait

L4/$ Sets both the small and large portrait

L5/$1/$2 Set a hero portraits

M#1/$2 Set/check/get spell

N$ Check or get the hero's number

O$ Set/check/get the hero's owner

P$1/$2/$3 Set/check/get the hero

P$1/$2/$3/S Move an opponent hero

R0/$ Set/check/get hero's moral

R1/$ Set/check/get hero's luck

R2/$ Set/check/get sex of a Hero

R3/$ Set hero's availability in the hero pool for all players

R3/$1/$2 Set hero's availability in the hero pool for each player

R4/$ Set/check/get a hero's Tactic control

R#1/$/#2 R command with redraw control

S#1/$2 Set/check/get secondary skill

T$1/$2/$3/$4/$5 Provoke a battle but only with one type of monsters

U$1/$2/$3 Set/check/get hero's patrol position and radius

V#1/$2 Set/check/get if hero visited objects

V#1/#2/$3 Set/check/get if hero visited objects

W$ Change Hero's movement points

X#(...) Change hero's specialty

Y$1/$2/$3/$4 Bless and Curse


Options list for !!AR receiver
G#1/$2/$3 Set/Check/get the guardian monster in position

M^TEXT^ Set message text to TEXT

M# Set message text to that of the timed event

M-1 Restores default message for artifact

Mz# Set/Get message text from string variable

M1/$, M1/-1 Set and  get the string parameters

V$ Set/Check/get the number of spell to set up the Scroll

X# Turn the guardians on if # is non-zero, otherwise turn them off


Options list for !!BA receiver
A$ Get or check an AI only battle

B# Background picture (as index)

B^FILE.PCX^ Background picture (as file)

D# Disable/Enable the battle

E$ Check for real MP battle

H#/$ Set the Hero that's fighting the battle

M#1/#2/$1/$2 Set the Monsters that are fighting the battle

O$1/$2 Get attacker and defender owners

P$1/$2/$3 Position on the map


Options list for !!BG receiver
A$ Type of an action

D$ Destination position

E$ Destination monster stack

H$ Number of a hero owner

N$ Number of a stack

Q?$ Current attacking side

S$ Number of a Spell to cast


Options list for !!BH receiver
C#1/#2/#3/#4 Cast a spell

M$ Disable/Enable to cast spell

N?$ Get or check a number of the hero

Q#1/#2/#3 Put a hex of Quick Sand or a Land Mine at a position


Options list for !!BM receiver
A$ Attack with bonuses

B$ Number of monsters in the stack

C#1/.../#5 Cast a spell

D$ Defense with bonuses

E$ Spell numbers

F$ Monster flag

G#/$1/$2 Set/check/get active spell parameters

H$ Hit points

I$ Side index as for heroes

J?$ Get or check for number of active spells

K# Strike a monster with # damage points

L$ Hit points lost by the next monster in the stack

M#1/#2/#3 Apply a spell to the monster

N$ Number of monsters in the stack (current).

O$ Number of a army slot

P$ Position on a battle field

Q#1/#2/#3 Put a hex of Quick Sand or a Land Mine at a position

R$ Number of retaliations for attack

S$ Speed

T$ Type of a monster


Options list for !!BU receiver
S#1/.../#6 Summon a stack of monster

R Redraw a battlefield after taking some action

E#/?$ Get or check alive monster stack

D#/?$ Get or check a dead monster stack

O#/?$ Get or check an obstacle flag

T?$ Check if the battle has a Tactics phase

C?$ Check if the battle has ended (on this turn)


Options list for !!CA receiver
B1/$ Build the $ structure

B2/$ Demolish the $ structure

B3/$ Check if the $ structure built

B4/$ Enable to build the $ structure

B5/$ Disable to build the $ structure

G$ Set/get/check a level of magic guild

G$1/$2 Set/get/check a number of available spells

G$1/$2/$3 Set/get/check a specific spell

H#/$ Set/get/check heroes in Town garnison or visitor

M1/$1/$2/$3 Set/get/check a number of available monsters

M2/$1/$2/$3 Set/get/check a number of guards

N^text^,N#, N?# Set/get a name of a Town

O$ Set/get/check an owner

T$ Set/get/check a type of a Town

U$ Get/check a number of a Town


Options list for !!CD receiver
A$1/$2/$3 Lets you set up a Hero's army minimum HP to break a particular building type in particular town

D$ Number of demolitions allowed per day

E$1/$2/$3 Set up a Hero's minimum experience level

M$ Hero's movement to lose per demolished building

N$1/$2 Number of demolition in one day

P$1/.../$5 Set up a square on the map where the battle with these monsters will take place


Options list for !!CE receiver
B#1/$2 Set/Check/Get the amount of resource

C#1/$2 Set/Check/Get a "gift" monster

D# Do NOT build building

E$ Set players allowed to activate the event

F$ Set/Check/Get day of first occurrence

H# Apply or check event to human players

M^TEXT^ Set message text to TEXT

M# Set message text to that of the timed event

M-1 Do not show the message on the screen

N$ Set players NOT allowed to activate the event

Q# Apply or check event to computer players

R$ Set/Check/Get the interval between successive occurrences

U# Build building


Options list for !!CM receiver
A$1/$2 Absolute position of a cursor in pixels

D$ Set/Check/Get a battlefield position

F$ Flags

I$ Item (area) of the screen

P$1/$2/$3 Map position

R$ Enable/Disable standard reaction

S$ Subtype of the action

T$ Type of an action


Options list for !!DO receiver
P$1/.../$16 To get access to parameters


Options list for !!FU receiver
E exit from the last function/trigger immediately

P$1/$2/$3... To get access to parameters


Options list for !!BF receiver
C Clear the battlefield

O#1/#2 Place a particular object

M#1/.../(#12) Places a rock at specific positions on the battlefield


Options list for !!GE receiver
B#1/$2 Set/check/get the amount of resource

D#1/#2 Disable/Enable event for gamer

E$ Set players allowed to activate the event

F$ Set/check/get day of first occurrence

H# Apply or check event to human players

M^TEXT^ Set message text to TEXT

M# Set message text to that of the timed event

M-1 Do not show the message on the screen

N$ Set players NOT allowed to activate the event

Q# Apply or check event

R$ Set/check/get the interval between successive occurrences


Receiver !!HL

Options Legend

!!HL:XXXX

Hero level controler.

Lets you control what skills (primary and secondary) a hero may choose when gaining a new level. It must be used with the !?HL Trigger.


Options for !!HL receiver

Options list Legend

S$1/$2/$3

Lets you set primary and secondary skills that a hero can take.

   $1 = set/check/get a +1 primary skill (0...3) Format PK.

   $2 = set a next level of left second skill (-2,-1.0..27) Format SS

       -2 = do not change

       -1 = not allowed to choose (no skill)

       0... = number of secondary skill

   $3 = set a next level of right second skill (-2,-1.0..27) Format SS

Comments:

This receiver may be used only inside !?HL trigger and takes effect for the current level gain only.

Example:

!?HL-1; every one who gains a new level

!!HL:S0/-1/-1; set Attack+1 and no choice for secondary skills


Options list for !!HL receiver
S$1/$2/$3 Set primary and secondary skills


Receiver !!HO

Options Legend

Used to enable/disable interaction with heroes.

!!HO$:XXXX

This is not the same as the HE receiver. At present, it is solely used for enabling/disabling interaction with a given hero.

$ means a number of hero.


Options for !!HO receiver

Options list Legend

D$

Disable all heroes of colour $ (-1 = current) to attack (enemy hero) or visit (allied hero) this hero. See Format E1.

E$

Enable all heroes of colour $ (See  Format E1) (-1 = current) to attack (enemy hero) or visit (allied hero) this hero.

H$

Set a hint for this hero to z variable. (See Format E1).

S

Disable all heroes to attack (enemy hero) or visit (allied hero) this hero.

R

Enable all heroes to attack (enemy hero) or visit (allied hero) this hero.


Options list for !!HO receiver
D$   Disable all heroes of colour $

E$    Enable all heroes of colour $

H$   Set a hint for this hero to z variable

S   Disable all heroes to attack

R   Enable all heroes to attack


Receiver !!HT

Options Legend

Lets you set the hint (right-click text) for all adventure map objects of a specific type and subtype.

!!HT$1/$2:XXXX

Sets hint for a type and subtype of objects.

   $1 - type [may be a variable]

   $2 - subtype (-1 = all) [may be a variable]

Comments:

First always a particular position of object hint is searched for.

If not found, the type and subtype of ANY (w,v,n) hint is searched for.

If none found, the type and ANY subtype (-1) hint is searched for.

Simple Example - setting hint text of all objects of the same type and subtype (no changing):

ZVSE

!#VRz100:S^Pointy Earsville^;

!#VRv25:S0;

!#HT98/1:V25/0/100;

This example changes the hint text of all Rampart towns on the map to "Pointy Earsville" at map start.

A more complex example, illustrating all three commands is shown below. Place this ERM code in an event on a test map and include three rows of the three kinds of mushroom buildings with four mushroom buildings per row:

ZVSE

!#HT63/18:V10/0/10;

!#VRz10:S^Init 63/18^;

!#HT63/18:V10/1/11;

!#VRz11:S^One 63/18^;

!#HT63/18:V10/2/12;

!#VRz12:S^Two 63/18^;

!#HT63/18:V10/3/13;

!#VRz13:S^Tree 63/18^;

!#VRv10:S0;

!?OB63/18;

!!VRv10:+1;

!#HT63/14:W10/0/20;

!#VRz20:S^Init 63/14^;

!#HT63/14:W10/1/21;

!#VRz21:S^One 63/14^;

!#HT63/14:W10/2/22;

!#VRz22:S^Two 63/14^;

!#HT63/14:W10/3/23;

!#VRz23:S^Tree 63/14^;

!#HT63/14:W10/4/24;

!#VRz24:S^Four 63/14^;

!#HT63/14:W10/5/25;

!#VRz25:S^Five 63/14^;

!?OB63/14;

!!IF:W-1;

!!VRw10:+1;

!#HT63/30:P0/30;

!#VRz30:S^Init 63/30^;

!#HT63/30:P1/31;

!#VRz31:S^One 63/30^;

!#HT63/30:P2/32;

!#VRz32:S^Two 63/30^;

!#HT63/30:P3/33;

!#VRz33:S^Tree 63/30^;

!#HT63/30:P4/34;

!#VRz34:S^Four 63/30^;

!#HT63/30:P5/35;

!#VRz35:S^Five 63/30^;

!?OB63/30;

!!PO998:Nd1;


Options for !!HT receiver

Options list Legend

P$1/$2

Hint referenced by PO:N number.

   $1 - position (0..15).If this number is equal to the number at the position of the object (Set with !!PO:N) then use Z variable ($3) as the hint text.

   $2 - index of Z variable (1..500) storing hint text. (0 = delete).

Comments:

Use this method when you want the object's hint text to change independently for each object of this type that is visited.

T$

Set a hint for all objects of type/subtype to z var $ (0-delete).

Comments:

You can set a hint for an artifact:

!!HT5/artnum:T$;

This hint will be used if only other type of hints not set.

V$1/$2/$3

Hint referenced by V variable.

   $1 - Index of V variable.

   $2 - Value (0..3). If V variable referenced with ($1) is equal to value of ($2) then use Z variable ($3) as the hint text.

   $3 - index of Z variable (1..500) storing hint text. (0 = delete).

Comments:

Use this method when you want the object's hint text to change when any hero visits the object.

W$1/$2/$3

Hint referenced by W variable.

   $1 - Index of W variable for current hero.

   $2 - If W variable of current hero referenced with ($1) is equal to value of ($2) then use Z variable ($3) as the hint text.

   $3 - index of Z variable (1..500) storing hint text. (0 = delete).

Comments:

Use this method when you want the object's hint text to change for each hero who has visited or not visited this type of object.


Options list for !!HT receiver
P$1/$2 Hint referenced by PO:N number

T$ Set a hint for all objects

V$1/$2/$3 Hint referenced by V variable

W$1/$2/$3 Hint referenced by W variable


Receiver !!IF

Options Legend

!!IF:XXXX

Management of conditional flags (1-1000), player questions (GRM), plus message and picture display.

Used for management of conditional flags, asking players yes/no type questions (Gamer Related Model), displaying messages and pictures, hero variable selection, extended dialog boxes and CMD setup.

* The first 10 of them are old SA (standalone ERM) flags.

* You can use Q and V command of IF receiver with index up to 1000. You also can use all index range in conditional check like ...&flag...

* Command A, R and S of IF receiver works only with first 10 flags as before in SA add-on.

* All triggers and receivers can depend on up to 16 different flags.

* Flag 1000 is set to "Is Gamer (not AI)" who turned on the Trigger. May be used in all receivers and trigger itself.

Note:

Since IF receiver involves, at some point, text messages, be aware that a string cannot contain the ; , ^ characters. Example:

!!IF:M^this is a wrong text ; it contains ^special elements^.^;

!!VRz567:S^wrong text ; it contains ^special elements^.^;

!!IF:M^this is a correct  text. It contains no "special elements".^;

Additional information for !!IF receiver

Message Handling

Inside ERM messages (M and Q commands of IF receiver) you can use special syntax:

"%%" -> "%"

"%V#" -> current value of # flag.

"%Vf"..."%Vt" -> current value of corresponding variable.

"%W1"..."%W100" -> current value of corresponding hero variable.

"%X1"..."%X16" -> current value of corresponding function parameter.

"%Y1"..."%Y100" -> current value of corresponding local variable.

"%Z1"..."%Z500" -> current value of corresponding string variable.

"%$macro$" -> macro name of corresponding variable

"%Dd" -> current day of week

"%Dw" -> current week

"%Dm" -> current month

"%Da" -> current day from beginning of the game

"%Gc" -> the color of current gamer in text

Lookup Command

Sometimes you will know the number of a monster, artifact, town building, secondary skill or spell, but won't know the name of it (especially true if it's generated randomly). In this situation, you can use the UN receiver's lookup command. This command lets you enter a number and get back the a text name that will be stored in a z variable and may be included in a message dialogue. For details on the lookup command, see the N command on the UN Receiver page.

Interpretation of value in IF:Q

The game interprets negative value for all resources as a -value/day. But. If you subtract another -100000, it will be interpreted as +value+100000.

So:

   !#IF:Q1/6/200/1^Message^; -> Gold: 200

   !#IF:Q1/6/-200/1^Message^; -> Gold: 200/day

   !#IF:Q1/6/-100200/1^Message^; -> Gold: -200

The same for money:

   !#IF:Q1/36/-100/1^Message^; -> 100/day

   !#IF:Q1/36/-100100/1^Message^; -> -100

And for monsters you can set their numbers:

subtype=Nums*65536+subtype.

   !#IF:Q1/21/327686/1^Message^; -> 5 Swordsmen 65536*5+6

   !#IF:Q1/21/65542/1^Message^; -> 1 Swordsman 65536*1+6

   !#IF:Q1/21/6/1^Message^; -> Swordsmen


Options for !!IF receiver

Options list Dialogue boxes Legend

B#/$1/$2

Use this command to set up or change a Single Image/Animation Extended Dialogue Box to be displayed with the IF:P command.

   # - number of dialogue (1..100);

   $1 - index of string variable that stores the name of an image (BMP, GIF or JPG) or AVI file;

   $2 - for AVI to repeat continuously (1) or not (0).

D#/$1...$15

Use this command to set up or change a Multipurpose Extended Dialogue Box to be displayed with the IF:E command.

   # - number of dialogue (1..100);

   ($=index of z variable that holds text to use);

   $1 - Title Text (White) at top of dialogue box;

   $2 - Right Legend (Yellow) above input box;

   $3 - Left Legend (Yellow) of 4 checkboxes;

   $4 - Pic/AVI 1 (left) File in Heroes3/Maps folder;

   $5 - Pic/AVI 2 - File in Heroes3/ Maps folder;

   $6 - Pic/AVI 3 - File in Heroes3/ Maps folder;

   $7 - Pic/AVI 4 (right) File in Heroes3/ Maps folder;

   $8 - Legend of Picture 1 (mouse-over hint);

   $9 - Legend of Picture 2 (mouse-over hint);

   $10 - Legend of Picture 3 (mouse-over hint);

   $11 - Legend of Picture 4 (mouse-over hint);

   $12 - Choice 1 (checkbox) - button text;

   $13 - Choice 2 (checkbox) - button text;

   $14 - Choice 3 (checkbox) - button text;

   $15 - Choice 4 (checkbox) - button text.

Comments:

If you use 0 or an empty parameter it means do not change. If you use a null string ^^ for a prompt it means no prompt. A full path name (up to 256 character) may be included for the picture files but remember that it starts in the MAPS directory so use ".." to go up one directory if required. e.g., ^../data/mypic.bmp^. Maximum picture size is 100*100 but may be less (if less, the picture will be centered automatically). Setup information will not be saved when game is saved, so always do setup immediately before using IF:E command.

E$1/$2

Use this command to display a Multipurpose Extended Dialogue box, previously set up with the IF:D (and also possibly IF:F) commands.

   $1 - an index of a v variable to store a selection;

   $2 - number of extended dialogue.

Comments:

Variable will receive 1,2,3,4 if one of the buttons was selected and -1 if none were selected (just exit). The text answer always (even if there was no prompt) will be stored in the z1 variable.

F$1/$2/$3/$4/$5/$6

Use this command to add hint text to checkboxes in a Multipurpose Extended Dialogue Box. This command is an extension to the IF:D command.

   #1 = number of dialog (1..100);

   $2 = hint for checkbox 1 - index of z variable;

   $3 = hint for checkbox 2 - index of z variable;

   $4 = hint for checkbox 3 - index of z variable;

   $5 = hint for checkbox 4 - index of z variable;

   $6 = enable Cancel/ESC button (1) or not (0).

Comments:

Setup information will not be saved when game is saved so always do setup immediately before using IF:E command.

G#1/.../#16

Set up Radio or Checkbox Dialogue (Up to 12 choices).

   #1 = 1 - Radio buttons (one choice),0 - Check boxes (multiple choice);

   #2 = Number of v var that receive a result;

   #3 = Initial state of buttons;

   #4 = Number of z var with a window header.

   #5 = Number of z var with a name of the first item, 0-do not show;

   #6 = Number of z var with a name of the second item, 0-do not show;

   ...

   #16 = Number of z var with a name of the twelve item, 0-do not show.

Comments:

State that received an stored is "one bit for one item".

  Item1=1,

  item2=2,

  item3=4,

  item4=8,

  item5=16...

So to set all items val=4095. To set item 2,4,5,8 and 10 val=2+8+16+128. All reset val=0.

M^TEXT^

Show the message (TEXT) on the screen IMMEDIATELY. The message (TEXT) may contain any symbols except the caret (^) and the semicolon (;).

See also:

Message Handling

M-1

Do not show the message on the screen.

M1/$

Set or get message text.

   $ - index of string variable.

P$

Use this command to display a Single Image/Animation Extended Dialogue Box, previously set up with the IF:B command.

   # - number of dialogue to display.

Q#^Text^

Ask the player a question (TEXT). The answer (Ok = 1, Cancel = 0) is put into conditional flag # (from 1 to 10). The message (TEXT) may contain any symbols except ^.

See also:

Interpretation of value in IF:Q

Message Handling

Q#1/#2/#3/#4^Text^

Show a message or request with one picture.

#1 - number of flag;

#2 - type of the picture;

#3 - subtype of the picture;

#4 - type of message,

    1 - message (FLAG #1 WILL NOT BE SET!!!),

    2 - request yes/no (stored to the flag),

    4 - message with no buttons (use this format with the !?CM Trigger for right-click messages and use a value of -1 for type and subtype if you don't want any picture displayed).

Note:

You must include the ^Text^ parameter or it will not work. If you don't want any text, use ^^.

See also:

Interpretation of value in IF:Q

Message Handling

Q#1/#2/#3/#4/#5/#6^Text^

Show a message or request with two pictures.

#1 - number of flag;

#2 - type of the picture 1;

#3 - subtype of the picture 1;

#4 - type of the picture 2;

#5 - subtype of the picture 2;

#6 - type of message,

   1 - message (FLAG #1 WILL NOT BE SET!!!),

   2 - request yes/no (stored to the flag),

   4 - message with no buttons (use this format with the !?CM Trigger for right-click messages and use a value of -1 for type and subtype if you don't want any picture displayed),

   7 - choose one of pictures (left=1, right=0).

Note:

You must include the ^Text^ parameter or it will not work. If you don't want any text, use ^^.

Example:

!!IF:Q1/3/100/2^Resource?^;

!!IF:Q1/4/10/1^Resource?^;

!!IF&1:Q1/10/3/27/10/7^Make your choice^;

!!IF&1:Q1/10/3/27/10/2^Make your choice^;

See also:

Interpretation of value in IF:Q

Message Handling

Q#1/#2/#3/#4/#5/#6/#7/#8^Text^

Show a message or request with three pictures.

#1 - number of flag;

#2 - type of the picture 1;

#3 - subtype of the picture 1;

#4 - type of the picture 2;

#5 - subtype of the picture 2;

#6 - type of the picture 3;

#7 - subtype of the picture 3;

#8 - type of message,

    1 - message (FLAG #1 WILL NOT BE SET!!!),

    2 - request yes/no (stored to the flag),

    4 - message with no buttons (use this format with the !?CM Trigger for right-click messages and use a value of -1 for type and subtype if you don't want any picture displayed).

Note:

You must include the ^Text^ parameter or it will not work. If you don't want any text, use ^^.

See also:

Interpretation of value in IF:Q

Message Handling

Q$/....

Equal to Q...^Text^ but ^Text^ is a string var with index = the last $.

See also:

Interpretation of value in IF:Q

Message Handling

V#1/#2

Set conditional flag #1 (from 1 to 1000) at once in the meaning #2 (1 or 0).

W$

Every hero has 100 variables.

Comments:

They are called w# (#=1...100).

They may be used everywhere when f...t variables.

You should set the hero you refer to by these vars: ($=1...155,-1=current).

Every time you apply W$ command, you will refer then to a particular hero's variables.

!!IF:W-1 refers to the current hero.

X$

Answer the gamer Sphinx question.

$ - number of question (-1 = random).

Comments:

This brings up the Sphinx question dialog box. All Questions and answers are taken from ZSphinx.txt file. If you have not the TxtEditor, you can use a CmdEditor to add something there. First column - question, second column - answer.

For now the exact coincidence of gamer answer with written one means correct. ERM Flag1 will be set to 1 if answer is correct and 0 if answer is wrong.

Condition Management of the first ten flags

AXXXX

Set all 10 flags at once. The line XXXX consists of 10 zeroes and ones.

Example:

A0100010000    - set all conditional flags into 0 but the second and six. At the beginning of game all the flags set into zero.

SXXXX

Set the pointed out of the ten flags. The line XXXX consists of 10 zeroes and ones.

Example:

S0100010000 set the second and the six into one, the rest are not changed.

RXXXX

Set off the pointed out flags. The line XXXX consist of 10 zeroes and ones.

Example:

R0100010000 set the second and six into zero, the rest are not changed.


Options list for !!IF receiver
B#/$1/$2 Preset up/change a CMD dialogue

D#/$1...$15 Preset up/change a CMD dialogue

E$1/$2 Ddisplay a Multipurpose Extended Dialogue box

F$1/.../$6 Add hint text to checkboxes in a Multipurpose Extended Dialogue Box

G#1/.../#16 Set up Radio or Checkbox Dialogue

M^TEXT^ Show the message on the screen IMMEDIATELY

M-1 Do not show the message on the screen

M1/$ Set or get message text

P$ Display a Single Image/Animation Extended Dialogue Box

Q#^Text^ Ask the player a question

Q#1/.../#4^Text^ Show a message or request with one picture

Q#1/.../#6^Text^ Show a message or request with two pictures

Q#1/.../#8^Text^ Show a message or request with three pictures

Q$/.... Ask the player a question

V#1/#2 Set conditional flag

W$ Particular hero's variables

X$ Answer the gamer Sphinx question

AXXXX Condition Management of the first 10 flags

SXXXX Condition Management of the first 10 flags

RXXXX Condition Management of the first 10 flags


Type and subtype of Pictures using the IF:Q command

	Type	Subtype
Resource	Type (0...6)	Quantity
Artifact	8	Number of artifact
Spell	9	Number of spell
Flag	10	Number of flag
Luck (positive)	11	+ of luck
Luck (neutral)	12	no matter
Luck (negative)	13	- of luck
Morale (positive)	14	+ of Morale
Morale (neutral)	15	no matter
Morale (negative)*	16	- of Morale
Experience	17	Quantity
Secondary Skill	20	Skill + level**
Monster	21	Type of monster
Buildings in Towns	22....30 By town type (Format T)	Type of building (Format U)
Primary skill	31...34	Quantity
Spell Points	35	Quantity
Money	36	Quantity

*Not supported in heroes.

** Note: secondary skill pictures start from 3 which is Basic Pathfinding and go up to 86 which is Expert First Aid. All secondary skill pictures also include the level (basic, advanced or expert).


Dialogue boxes

Dialogue boxes list

List and explanations of Dialogue Box commands (IF Receiver).

Introduction

Whenever you want to display a message on the screen, ask the player a question, display pictures or animations for the player or ask the player to select between different options or type some input (e.g., a name or the answer to a riddle), you will need to use a Dialogue Box.

Types of Dialogue Boxes

There are two main types of dialogue boxes that can be accessed through ERM. The first is the standard dialogue, which is the one you see in regular Heroes games. The second is the extended dialogue, which is used for displaying external picture and animation files, accepting typed input, and displaying options with checkboxes. Which one you use will depend on the type of information you wish to display. Both types may be used to display information only, or may be used to display a message or picture and ask for user input in one form or another, which may be as simple as choosing between clicking OK or clicking Cancel. The standard dialogue box is simpler to use than the extended dialogue box which requires an additional command or two to set up.

Using Standard Dialogue Boxes

There are basically only two commands used for standard dialogue boxes: M which is used for simple message display, and Q which is used for asking Yes/No type questions and also for displaying messages with pictures. In both cases there are format variations, depending on exactly what you want to do.

Example of displaying a simple message dialogue box with the M command:

!!IF:M^This is a simple message.^;

The above will display a dialogue box on the screen with "This is a simple message." (without the quotes) in white text, centered. At the bottom of the box will be a single OK button that the user must click (or press Enter) to continue playing.

Example of displaying a simple question with the Q command (no pictures):

!!IF:Q2^Special rules will modify this game. Would you like to choose them? (If not, one or two will be chosen randomly.)?^;

The above will display a dialogue box similar to the example above, and below it will be two buttons: OK and Cancel. Since the number 2 was put after the Q, this means that flag number 2 will be set to true if OK was clicked and will be set to false if Cancel was clicked. Any flag number may be chosen to store a dialogue box question response. See Flags and Variables for more information about conditional flags.

Example of displaying a message and picture (no question):

!!IF&1000:Q1/20/53/1^{Magic Water Mushroom}

The Magic Water Mushroom gives Expert Water Magic until the end of the week...

You inhale the spores of the magic mushroom...

You learn Expert Water Magic!^;

(Flag 1000 : Message won't appears if AI visits the object...)

Example of displaying a message and two pictures - player must click on the picture of choice before clicking the OK button:

!!IF&1000/-3:Q1/5/0/8/141/7^Would you like to play for

{Resources} or {Artifacts}?^;

There are more combinations and options with both commands as well. See the command syntax for M and Q for more details.

Using Extended Dialogue Boxes 1 - Multipurpose Dialogue

If you want to accept typed user input, let a user select from up to four checkboxes, and/or display up to four custom pictures or animations, you will need to use an extended dialogue box. In general, you'll need to store some text in z variables and then use either one or two setup commands, followed by the command that displays the dialogue box.  The IF:D and IF:F commands are used to set up a multipurpose extended dialogue box and IF:E is used to display it. Any combination of the following options may be combined in a multipurpose extended dialogue box:

1. Displaying Pictures: Unlike the standard dialogue box, the extended dialogue box cannot display internal pictures, but only pictures that are stored externally to the program in an appropriate directory and of a specified type and size. If you need to display an internal Heroes picture, you'll have to extract it or screen-capture it and save it as an external image file first. The directory and file path for custom pictures (up to four per dialogue box) can be up to 256 characters long and starts in the Heroes3\Maps directory. The pictures may be BMPs, GIFs or JPGs with a maximum size of 100 x 100 pixels. If an image is smaller than the maximum size, it will be centered in the space. If the image is larger, only a 100 x 100 pixel portion will be shown. For BMPs, the upper-left pixel will be interpreted as the transparent colour. For GIFs, see the example GIF (ZObj001.gif) that can be found in your Heroes III directory (Heroes3\erm_help\images\Castle\ZObj001.gif). You can mix and match the picture formats as you wish. The IF:D command is used to set up pictures for a multipurpose extended dialogue box.

Example1:

!!VRz10:S^The lands you travel through are mesmerizing.^;

!!VRz11:S^blue forest.jpg^;

!!VRz12:S^sparkling lake.bmp^;

!!VRz13:S^rainbow.gif^;

!!VRz14:S^mountains.jpg^;

!!VRz15:S^Murky Forest^;

!!VRz16:S^Crystal Lake^;

!!VRz17:S^Mystic Rainbow^;

!!VRz18:S^Misty Mountains^;

!!IF:D5/10/0/0/11/12/13/14/15/16/17/18/0/0/0/0;

!!IF:E1/5;

In the above example, z10 stores title text for the dialogue, z11..z14 store file names of images placed in the maps directory, and z15..z18 are the mouse-over hint text for each of the pictures. The dialogue box number we decide to use is 5 (first parameter), followed by the z variable index holding the title text (10), followed by two zeroes, indicating we're not using/changing the next two parameters. After that are the z variable indexes for the file names (11..14) and the z variable indexes for the hint text (15..18). The last four parameters are also unused in this example and so we fill them with zeroes.

2. Displaying an Animation: You can use the extended dialogue box to display an animation or movie clip in AVI format. An AVI animation can be displayed instead of any picture and may be combined with pictures (e.g., you could display two AVI animations, a JPG and a BMP in a single multipurpose extended dialogue). AVI animations must be stored in uncompressed format or they won't work. Like pictures, animations are also limited to 100 x 100 pixels. Again, IF:D is used to set up animations for a multipurpose extended dialogue box.

3. Checkboxes: If you want a player to have a choice between four (or fewer) options, you can use checkboxes. Above the checkboxes, you can put a title message (appearing in bold yellow). Each checkbox will have a text label identifying it, and can also have hint text (shows up on the bottom of the dialogue when you do a mouse-over of the checkbox). And although you can't put pictures on the checkboxes themselves, you can match the checkbox selections to pictures displayed above if you wish. When the dialogue first displays, no boxes are checked. The user can select only one checkbox; selecting another unchecks the previous selection. After the user clicks OK, you can check which checkbox was selected; the number will be stored in a v variable. Like picture and animation setup, IF:D is used to set up checkboxes and IF:F is used to add hint text (mouse-over text) to the checkboxes, if desired.

4. Text Input: If you want to get a typed response from a player, you can display an input box. Above the input box you can put a title message (appearing in bold yellow). The text entered by a player in an input box is stored in a string variable (z variable) and could be used to name a hero or town, replace hint text, appear on a sign, appear as part of another message, or could be checked to see if it correctly answers a riddle or question. You can also use input text in combination with the UN:N lookup command to do a kind of reverse-lookup and search for a matching artifact name, monster name, town building, or skill name. IF:D is used to set up text input.

5. Title Text: Title text (in white) that appears at the top of the dialogue box can be set with the IF:D command, and the yellow text for checkboxes can be used even if you don't use checkboxes in the dialogue.

6. Cancel Button: The IF:F command can be used to disable or enable the cancel button (and keyboard escape key) for a multipurpose extended dialogue box.

Example2:

!#IF:F1/z21/z22/z23/z24/0; Give hints and disable cancel button

Example3:

Here's the code:

!#VRz199:S^..\Data\Zvs\Cmp.res^;

!#VRz198:S^B21p^;

!#VRz10:S^Time to play^;

!#VRz11:S^Name yourself^;

!#VRz12:S^Choose your spell^;

!#VRz13:S^%Z199\21_001.BMP^;

!#VRz14:S^%Z199\21_002.BMP^;

!#VRz15:S^%Z199\21_003.BMP^;

!#VRz16:S^%Z199\21_004.BMP^;

!#VRz17:S^Bloodlust^;

!#VRz18:S^Bless^;

!#VRz19:S^Magic Arrow^;

!#VRz20:S^Slow^;

!#VRz21:S^Your hero will start with the Bloodlust spell^;

!#VRz22:S^Your hero will start with the Bless spell^;

!#VRz23:S^Your hero will start with the Magic Arrow spell^;

!#VRz24:S^Your hero will start with the Slow spell^;

!#IF:D1/z10/z11/z12/z13/z14/z15/z16/z17/z18/z19/z20/z17/z18/z19/z20;

!#IF:F1/z21/z22/z23/z24/0; Give hints and disable cancel button

!#IF:E100/1; The choice will be store in v100

!#VRz400:Sz1; your name

!#VRz400:H10; Check if the string is empty and Flag 10

!#VRz400&-10:S^Caneghem^; if the string is empty call the hero Caneghem

Using Extended Dialogue Boxes 2 - Single Image/Animation Dialogue

If you wish to display a single image (BMP, GIF or JPG) or a single AVI animation file, you can use the second type of extended dialogue box instead. This dialogue is simpler to set up than the multi-purpose dialogue (fewer parameters) and has the advantage that it can display an image or video of almost any size. The main disadvantage is that you can't include any text with the image or animation. When you call this dialogue, you get a simple message box, with the image or AVI centered and an OK button below. The command to set up this dialogue is IF:B and the command to display it is IF:P. There is, however, some overlap with the IF:D command (used to set up the multi-purpose extended dialogue box) -- if you use the IF:D command instead of IF:B, the first picture or AVI in the parameter list is the one that will be displayed with IF:P and additional pictures or animations will be ignored. If you use both IF:D and IF:B, whichever command occurs last before the IF:P command will be the one that sets the picture or animation to display.

Extended Dialogue 3: Radio or Checkbox Dialogue (Up to 12 choices)

Example:

!#VRz1:S^1111111111^;

!#VRz2:S^222222^;

!#VRz3:S^333333333333333^;

!#VRz4:S^4444444^;

!#VRz5:S^55555555555^;

!#VRz6:S^666666666666666^;

!#VRz7:S^7777777^;

!#VRz8:S^88888888^;

!#VRz9:S^999999999999^;

!#VRz10:S^AAAAAAAAAA^;

!#VRz11:S^BBBBBBBBBBBB^;

!#VRz12:S^CCCCCCCC^;

!#VRz25:S^Set you choice in forward order (all are set):^;

!#IF:G0/100/4095/25/1/2/3/4/5/6/7/8/9/10/11/12;

!#IF:M^Your choice is: %V100^;

!#VRz25:S^Set you choice in backward order (all are reset):^;

!#IF:G0/100/0/25/12/11/10/9/8/7/6/5/4/3/2/1;

!#IF:M^And now your choice is: %V100^;

!#VRz25:S^Set you choice for selected items:^;

!#IF:G0/100/4095/25/1/0/3/4/0/0/7/8/9/0/0/0;

!#IF:M^Your choice is: %V100^;

!#VRz25:S^Set you choice for RADIO Buttons:^;

!#IF:G1/100/8/25/1/2/3/4/5;

!#IF:M^Your choice is: %V100^;

Note:

Since IF receiver involves, at some point, text messages, be aware that a string cannot contain the ; , ^ characters.

Example:

!!IF:M^this is a wrong text ; it contains ^special elements^.^;

!!VRz567:S^wrong text ; it contains ^special elements^.^;

!!IF:M^this is a correct  text. It contains no "special elements".^;


Dialogue boxes list
Standard Dialogue

Extended Dialogue 1 - Multipurpose Dialogue

Extended Dialogue 2 - Single Image/Animation Dialogue

Extended Dialogue 3 - Radio or Checkbox Dialogue


List of all buildings

Used to check or modify the attributes of a town, including name, owner, available creatures and internal structures.

byte	bit in byte	building number	building name (town number), clear written if nothing
0	01	0	Mage guild 1
0	02	1	Mage guild 2
0	04	2	Mage guild 3
0	08	3	Mage guild 4
0	10	4	Mage guild 5
0	20	5	tavern
0	40	6	shipyard when it's present:))
0	80	7	fort
1	01	8	citadel
1	02	9	castle
1	04	10	village hall
1	08	11	town hall
1	10	12	city hall
1	20	13	capitol
1	40	14	marketplace
1	80	15	resource silo
2	01	16	blacksmith
2	02	17	lighthouse(0); mystic pond(1); artifact merchants(2,5,8); veil of darkness(4); escape tunnel(6); cage of warlords(7)
2	04	18	horde buildings for non-upgraded creatures: Griffins, dwarves, stone gargoyles, imps, skeletons, troglodytes, goblins, gnolls, pixies.
2	08	19	horde buildings for upgraded creatures Royal griffins, battle dwarves, obsidian gargoyles, familiars, skeleton warriors, infernal troglodytes, hobgoblins, gnoll marauders, sprites
2	10	20	---
2	20	21	stables(0); fountain of fortune(1); lookout tower(2); brimstone clouds(3); necromancy amplifier(4); mana vortex(5); freelancer's guild(6); glyphs of fear(7); magic university(8)
2	40	22	brotherhood of sword(0); dwarven treasury(1); library(2); castle gates(3); skeleton transformer(4); portal of summoning(5); ballista yard(6); blood obelisk(7)
2	80	23	wall of Knowledge.(2); order of fire(3); academy of battle scholars(5); hall of valhalla(6)
3	01	24	horde buildings for non-upgraded creatures: dendroid guards, hell hounds
3	02	25	horde buildings for upgraded creatures: Dendroid soldiers, Cerberi
3	04	26	Grail
3	08	27	---
3	10	28	---
3	20	29	---
3	40	30	dwelling 1
3	80	31	dwelling 2
4	01	32	dwelling 3
4	02	33	dwelling 4
4	04	34	dwelling 5
4	08	35	dwelling 6
4	10	36	dwelling 7
4	20	37	upgraded dwelling 1
4	40	38	upgraded dwelling 2
4	80	39	upgraded dwelling 3
5	01	40	upgraded dwelling 4
5	02	41	upgraded dwelling 5
5	04	42	upgraded dwelling 6
5	08	43	upgraded dwelling 7


Receiver !!LE

Options Legend

Used to modify the attributes of a local (placed) event in the specified position on the map.

•	!!LE#1/#2/#3:XXXX

   #1 = X;

   #2 = Y;

   #3 = Level.

•	!!LE$:XXXX

Coordinates are in v[$],v[$+1],v[$+2].

Comments:

If an Event was set to cancel after being visited and was visited already, you cannot bring it back to life. It is completely gone. So we recommend you always set it to be not cancelled and play with the enable/disable player command.

There is now a check to see if a local event being referenced with ERM exists. If it does, Flag 999 will be set to 0 and all commands executed.

If it does not exist, Flag 999 will be set to 1 and all LE commands skipped.


Options for !!LE receiver

Options list Legend

A#1/$2

Set/Check/Get artifact $2 (Format A1) in position #1 of the table of artifacts given by the event. You can only CHANGE the artifact present by another one. If there is no artifact in that position it will not be set.

C#1/$2/$3

Set/Check/Get a "gift" monster in position #1 (from 0 to 6) of type $2 (Format C) and number $3.

D#1/#2

Disable/Enable event for human.

Disable: #2 = 1;

Enable:  #2 = 0.

For gamer #1 (0...7) (Format E1).

E$

Set/Check/Get experience to $.

F#1/$2/$3/$4

Set/Check/Get four primary skills. (See Format PK).

G#1/$2/$3

Set/Check/Get the guardian monster in position #1 (from 0 to 6) of type $2 (Format C) and number $3.

Comments:

This only saves the guardians but does not turn them on.

I#

Disable/Enable event for AI.

Disable: # = 0;

Enable:  # = 1.

L#

Cancel (#=1) or do not cancel (#=0) event after first visit.

M^TEXT^

Set message text to TEXT. It may contain any symbols except ^ or the semicolon (;).

M#

Set message text to that of the timed event number #.

M-1

Do not show the message on the screen.

Mz#

Set/Get message text from string variable.

M1/$

M1/-1

Set and  get the string parameters.

You can use it when M command is used to set name/message.

   M1/$ - $ = index of string var;

   M1/-1 - disable (restore default) message.

Comments:

Now you can not only set but also get the string parameters. You can use it when M command is used to set name/message.

N#1/$2/$3

Set/Check/Get secondary skill $2 (Format SS), level $3 (0 = basic, 1 = advanced, 2 = expert) in position #1 of the table of secondary skill given by the event. You can only CHANGE the skill present for another one. If there is no skill in that position it will not be set.

O$

Set/Check/Get morale (from -3 to 3).

P$

Set/Check/Get spell points (may be negative).

R#1/$2

Set/Check/get the amount of resource #1 (Format R) to $2 (may be negative).

S#1/$2

Set/Check/Get spell

$2 (Format SP) in position #1 of the table of spells given by the event. You can only CHANGE the artifact present by another one. If there is no artifact in that position it will not be set.

U$

Set/Check/Get luck (from -3 to 3).

X#

Turn the guardians on if # is non-zero, otherwise turn them off.

The check for the presence of the guardians is not made. So it must be set by G#1/$2/$3 option or preset with the map editor.


Options list for !!LE receiver
A#1/$2 Set/Check/Get artifact

C#1/$2/$3 Set/Check/Get a "gift" monster

D#1/#2 Disable/Enable event for human

E$ Set/Check/Get experience

F#1/$2/$3/$4 Set/Check/Get four primary skills

G#1/$2/$3 Set/Check/Get the guardian monster

I# Disable/Enable event for AI

L# Cancel or do not cancel event after first visit

M^TEXT^ Set message text to TEXT

M# Set message text to that of the timed event

M-1 Do not show the message

Mz# Set/Get message text from string variable

M1/$ Set/Get the string parameters

N#1/$2/$3 Set/Check/Get secondary skill

O$ Set/Check/Get morale

P$ Set/Check/Get spell points

R#1/$2 Set/Check/get the amount of resource

S#1/$2 Set/Check/Get spell

U$ Set/Check/Get luck

X# Turn the guardians


Contacts

"New Life of Heroes" in WWW:

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

Mail to "New Life of Heroes":

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

New version of ERM Help (html version):

http://www.geocities.com/geo_gt/

ERM html-help author:

George Toganel geo_gt@rdslink.ro


Receiver !!MA

Options Monster Damage Ratios Legend

Used to modify all creatures of a given type.

!!MA:XXXX

Globally changes the characteristics of a monster type for all monsters on the map of that type.

All commands allow also to get and check values.

Notes:

You must not set cost of gold (resource number 6) to 0.

If you set more than one other resource (0...5) the only the first one will be used.

If you want to change a second resource (in addition to gold) from one to another, set the previous resource to 0.

Example:

C1/2/3 set Ore to 3 (gold+ore)

C1/2/0C1/0/5 set Wood to 5 and Ore to 0 (gold+wood)


Options for !!MA receiver

Options list Legend

O#/$

Monster # belongs to Castle $ type.

L#/$

Monster # is now considered a Level $ monster.

C#1/#2/$

Monster # Costs resource #2 to buy.

F#/$

Monster # has a Fight value of $.

I#/$

Monster # has an AI value of $.

G#/$

Monster # has a Grow rate of $.

R#/$

Monster # has a Grow H of $.

P#/$

Monster # has $ Hit Points.

S#/$

Monster # has a Speed of $.

A#/$

Monster # has an Attack of $.

D#/$

Monster # has a Defense of $.

M#/$

Monster # has a Damage Low of $.

E#/$

Monster # has a Damage High of $.

N#/$

Monster # has $ Number of Shots.

B#/$

Monster # with spell can cast it $ times per combat.

V#/$

Monster # has an Adventure Map Low of $.

H#/$

Monster # has an Adventure Map High of $.

U#/$

Monsters can be upgraded to any other monster at a hill fort (or hill fort dialogue box) or at any town where that monster could normally be upgraded.

Monster # will be upgraded to a monster $.

   $ = -2 - do not upgrade;

   $ = -1 - use the default upgrade.

Comments:

You can set a sequence to upgrade:

!#MA:U0/1U1/2U2/3U3/4.....

It looks funny and you can upgrade them all. If you set a circled sequence of the same level creatures, the player can choose the best creature set (town) to play with. You can use a loop (it's fast) to go through all creatures and set an upgrade for each (to the next) in sequence.

In a town, you can only upgrade what you could normally upgrade. So you could set Pikemen to be upgraded to any other creature but they can only be upgraded in a Castle town or at a hill fort. If you set Halberdiers to be upgraded to another creature, this will only work at a hill fort since there's no normal town upgrade allowed for them.

To make an upgrade cost nothing, change each monster's level to a value of 0 (level 1 monster) and then you have no cost at a hill fort.

X#/$

Set flags to $ for monster #. Use with BIG care $ Bits:

Bits	Nubers	Description
0x00000001	1	DOUBLE_WIDE - Takes 2 square
0x00000002	2	Fly
0x00000004	4	Shooter. If you give this ability to a non-shooter, you get several error messages along the lines of "missing resource." Presumably the graphic showing it shooting.
0x00000008	8	Eextended attack radius (2 square). That is, a breath weapon (depth not radius). This doesn't function when using a range ability, but works for a ranged unit when it hits an adjacent unit.
0x00000010	16	Alive
0x00000020	32	CATAPULT
0x00000040	64	SIEGE_WEAPON - cannot move
0x00000080	128	KING_1 - This is all 7th level creatures and neutral dragons that aren't KING_2 or KING_3.
0x00000100	256	KING_2 - Angels, Archangels, Devils, Archdevils.
0x00000200	512	KING_3 - Giants, Titans
0x00000400	1024	Immune to mind spell
0x00000800	2048	Monster: 35,74,75. This means "no obstacle penalty," since Archmages have that ability and Mages don't. This one seems a bit mystifying. 74 and 75 are Beholders and Evil Eyes and I don't recall them ever having a "no obstacle penalty" ability.
0x00001000	4096	No penalty in close combat
0x00002000	8192	NOT_USED
0x00004000	16384	IMMUNE_TO_FIRE_SPELLS
0x00008000	32768	Shoot twice. This also makes a non-range unit attack twice - Crusader, Wolf-Raider.
0x00010000	65536	No enemy retaliation. The Cerberus has this ability (in addition to Hydra etc.) However if you give a unit this ability, it will attack in all directions, not just forwards like the Cerberus. Also, you can have this ability but still allow retaliation; then the creature actually attacked will retaliate (the others won't).
0x00020000	131072	No moral penalty
0x00040000	262144	Undead
0x00080000	524288	Attack all enemies around
0x00100000	1048576	Extended radius of shooters. This is the Magog/Lich/Power Lich ability. You don't appear to be able to give a creature this ability. I assume since Magogs and Liches work differently, the program must check creature number.
0x80000000	2147483648	Dragon. This one screws you up in ERM because the same bit is used for signs. You can still use it though if you work out what the correct large negative number is. I assume all it affects is the Vial Of Dragon Blood. And this is used also for "Dragons" Hero's specialty (Mutares). See example *

* Example:

!?OB3/6/0;  there must be an archer in 3/6/0

!!IF:M^Set Archer to shoot twice^;

!!MA:X2/?i;

!!VRi:+32768;

!!MA:X2/i;


Options list for !!MA receiver
O#/$ Monster belongs to Castle

L#/$ Monster is considered a Level

C#1/#2/$ Monster Costs resource

F#/$ Monster has a Fight value

I#/$ Monster has an AI value

G#/$ Monster has a Grow rate

R#/$ Monster has a Grow

P#/$ Monster has Hit Points

S#/$ Monster has a Speed

A#/$ Monster has an Attack

D#/$ Monster has a Defense

M#/$ Monster has a Damage Low

E#/$ Monster has a Damage High

N#/$ Monster has a Shots

B#/$ Monster with spell can cast it $ times per combat

V#/$ Monster has an Adventure Map Low

H#/$ Monster has an Adventure Map High

U#/$ Monsters can be upgraded to any other monster

X#/$ Set flags


Monster Damage Ratios

Towns

This is mostly for Tim, due to the idea of +20% monster growth per combat round, but the statistics might be useful for other things, so I'm providing them for everybody.

The important thing to note is that any creature with a ratio smaller than 5:1 (greater 20% of health done in damage) will eventually finish a battle against itself. Any creature which allows retaliation will finish a battle with itself if the ratio is smaller than 10:1 (10%). Any creature with a larger ratio than 10:1 (5:1 if no retaliation) will most likely only finish an even battle with itself if there are several morale boosts. Any creature with a larger ratio than 20:1 (and there is one such- the faerie dragon, after magic is used up) will NEVER finish a battle.

Note that if the hero's defense is greater than the enemy offense, then the ratios get larger.

My personal opinion is that if it is reduced to 10% growth per round, and level 7+ creatures are excluded, then there should be no problem. Note that most ranged troops that have melee penalties have fairly high ratios if they run out of ammo.

All damages are considered by the average of the range, when the creature is attacking.

Ranged attacks assume no distance penalty.

(any) indicates the ratio does not change if upgraded.

percentages are the percentage of health that average damage does Only special abilities considered are multiple strike, charging and Lord of Thunder's lighting strike. (since the LoT lightning is a guaranteed hit, as opposed to the Thunderbird which does not always work).

Castle:

Pikeman	5:1	20%
Halberdier	4:1	25%
Archer (ranged)	4:1	25%
Archer (any, melee)	8:1	12.5%
Marksman (ranged)	2:1	50%
Griffin (any)	50:9	18%
Swordsman	14:3	21.4%
Crusader	35:17	48.6%
Monk (any, ranged)	30:11	37%
Monk (melee)	60:11	19%
Zealot (melee)	30:11	37%
Cavalier (normal)	5:1	20%
Cavalier (max. charge)	10:3	30%
Champion (normal)	40:9	22.5%
Champion (max. charge)	80:27	33.8%
Angel	4:1	25%
Archangel	5:1	20%
Supreme Archangel	20:3	15%

Dungeon:

Troglodyte	5:2	40%
Infernal Troglodyte	3:1	33.3%
Harpy (any)	28:5	17.9%
Beholder (any)	11:2	18.2%
Medusa	25:7	28%
Medusa Queen	30:7	23.3%
Minotaur (any)	25:8	32%
Manticore (any)	80:17	21.3%
Red Dragon	4:1	25%
Black Dragon	20:3	15%
Darkness Dragon	80:9	11.3%

Fortress:

Gnoll (any)	12:5	41.7%
Lizardman (range)	28:5	17.9%
Lizardman (melee)	56:5	8.9%
Lizard Warrior (range)	30:7	23.3%
Lizard Warrior (melee)	60:7	11.7%
Serpent Fly (any)	40:7	17.5%
Basilisk	35:8	22.9%
Greater Basilisk	5:1	20%
Gorgon (any)	5:1	20%
Wyvern	35:8	22.9%
Wyvern Monarch	7:2	28.6%
Hydra	5:1	20%
Chaos Hydra	50:7	14%
Hell Hydra	500:53	10.6%

Inferno:

Imp (any)	8:3	37.5%
Gog (any, ranged)	13:3	23.1%
Gog (any, melee)	26:3	11.5%
Hell Hound (any)	50:9	18%
Demon	35:8	22.9%
Horned Demon	5:1	20%
Pit Fiend (any)	3:1	33.3%
Efreeti (any)	9:2	22.2%
Devil	32:7	21.9%
Archdevil	40:7	17.5%
Antichrist	160:21	13.1%

Necropolis:

Skeleton (any)	3:1	33.3%
Walking Dead	6:1	16.7%
Zombie	8:1	12.5%
Wight (any)	9:2	22.2%
Vampire	60:13	21.7%
Vampire Lord	80:13	16.3%
Lich (ranged)	5:2	40%
Lich (melee)	10:2	20%
Power Lich (ranged)	40:13	32.5%
Power Lich (melee)	80:13	16.3%
Black Knight (any)	16:3	18.8%
Bone Dragon	4:1	25%
Ghost Dragon	16:3	18.8%
Blood Dragon	800:113	14.1%

Rampart:

Centaur	16:5	31.3%
Centaur Captain	4:1	25%
Dwarf (any)	20:3	15%
Wood Elf (ranged)	15:4	26.7%
Wood Elf (any, melee)	30:4	13.3%
Grand Elf (ranged)	15:8	53.3%
Pegasus (any)	30:7	23.3%
Dendroid Guard	55:12	21.8%
Dendroid Soldier	65:12	18.5%
Unicorn	9:2	22.2%
War Unicorn	11:2	18.2%
Green Dragon	4:1	25%
Gold Dragon	50:9	18%
Diamond Dragon	200:27	13.5%

Stronghold:

Goblin (any)	10:3	30%
Wolf Rider	10:3	30%
Wolf Raider	10:7	70%
Orc (ranged)	30:7	23.3%
Orc (melee)	60:7	11.7%
Orc Chieftain (ranged)	40:7	17.5%
Orc Chieftain (melee)	80:7	8.8%
Ogre	40:9	22.5%
Ogre Mage	20:3	15%
Roc (any)	60:13	21.7%
Cyclops (any, ranged)	35:9	25.7%
Cyclops (any, melee)	70:9	12.9%
Behemoth	4:1	25%
Ancient Behemoth	15:2	13.3%
Ghost Behemoth	10:1	10%

Tower:

Gremlin	8:3	37.5%
Master Gremlin (ranged)	8:3	37.5%
Master Gremlin (melee)	16:3	13.7%
Stone Gargoyle (any)	32:5	15.6%
Stone Golem	20:3	15%
Iron Golem	70:9	12.9%
Mage	25:8	32%
Archmage	15:4	26.7%
Genie (any)	80:29	36.3%
Naga	11:2	18.2%
Naga Queen	11:3	27.3%
Giant	3:1	33.3%
Titan	6:1	16.7%
Lord of Thunder (ranged)	40:9	22.5%
Lord of Thunder (melee)	240:31	12.9%

Conflux:

Pixie	2:1	50%
Sprite	3:2	66.7%
Air Elemental	5:1	20%
Storm Elemental (ranged)	5:1	20%
Storm Elemental (melee)	10:1	10%
Water Elemental	6:1	16.7%
Ice Elemental (ranged)	6:1	16.7%
Ice Elemental (melee)	12:1	8.3%
Fire Elemental (any)	7:1	14.3%
Earth Elemental	20:3	15%
Magma Elemental	5:1	20%
Psychic Elemental	5:1	20%
Magic Elemental	4:1	25%
Firebird	30:7	23.3%
Phoenix	40:7	17.5%
Sacred Phoenix	160:21	13.1%

SoD Neutrals:

Peasant	1:1	100%
Halfling (ranged)	2:1	50%
Halfling (melee)	4:1	25%
Rogue	10:3	30%
Boar	6:1	16.7%
Nomad	15:2	13.3%
Mummy	15:2	13.3%
Troll	16:5	31.3%
Sharpshooter (ranged)	5:3	60%
Sharpshooter (melee)	10:3	30%
Enchanter (ranged)	15:7	46.7%
Enchanter (melee)	30:7	23.3%
Gold Golem	50:9	18%
Diamond Golem	5:1	20%
Ballista	100:attack & artillary skill	attack skill% (minimum)
Other War machine	0%	---
Faerie Dragon (spell)	500: spell power 5 minimum 50 maximum 575	10% to 115%
Faerie Dragon (melee)	20:1	5%
Rust Dragon	15:1	6.7%
Crystal Dragon	320:27	8.4%
Azure Dragon	40:3	7.5%

WoG Neutrals:

Fire Messenger	140:31	22.1%
Earth Messenger	35:6	17.1%
Air Messenger	35:6	17.1%
Water Messenger	20:3	15%
Sharpshooter (any, ranged)	5:3	60%
Sharpshooter (any, melee)	10:3	30%
War Zealot	40:11	27.5%
Gorynych	50:7	14%
Nightmare	11:2	18.2%
Santa Gremlin (spell, 1 SG)	1:4	400%
Santa Gremlin (spell, small stack)	5:2	40%
Santa Gremlin (spell, large stack)	5:1	20%
Santa Gremlin (melee)	2:1	50%

SG Guard - as creature type, but cannot attack.


Monster Damage Ratios List
Castle

Dungeon

Fortress

Inferno

Necropolis

Rampart

Stronghold

Tower

Conflux

SoD Neutrals

WoG Neutrals


Receiver !!MC

Legend

!!MC@:SVar@

Set up macros. Use to assign a text name to a variable.

Applicable to variables f..t, v# or w#.

You can use a text name for variables. Applicable to f...t, v# or w# variables.

Notes:

First you should set up the macro in Instructions before first using of macro name:

!#MCv100:S@Var 100@;

Variable v100 has now a second name "Var 100". The length of a macro name is limited by 8 chars. You can use longer names but only first 8 characters will be used to find a variable by name.

You can change a macro name at any time if you set it not in an instruction but in a receiver.

Then you can use a macro name at any place where you can use a variable. It must be enclosed in '$' signs.

Example:

!!HE-1:P?$Var 100$/?v1000/0;

!!IF&$Var 100$=v1000/v100=5:...;

You can set a macro name for z# string variables.

Example:

!!IF:M^This is %$players$ and this is %$value$.^;

Macro name is inside $$ and has a % sign before.


Receiver !!MO

Options Legend

Used to modify the attributes of the monsters in the specified position.

•	!!MO#1/#2/#3:XXXX

The monsters in the specified position (affects monster at X, Y, Level coordinates).

•	!!MO#1/#2/#3/#4:XXXX

The monsters in the specified position (affects monster at X, Y, Level coordinates).

#4 parameter is dummy parameter used to disable check for monster at this location at map start up. Use this command with UN:I.

Comments:

Now also MO$1/$2/$3 and MO$1/$2/$3/1 are the same.

In both cases the presence of the Monster on a map at game start is not needed so this format is now redundant but still supported for compatibility.

•	!!MO$

New style for MO receiver - indexed.

This is coordinates are in v[$],v[$+1],v[$+2].

Comments:

Commands M, B and A may be used for monsters that are set up (message, resource or artifact bonus) when placed on the map.

You also cannot set the message and gift for them, but can quantity, aggression and so. Do not forget that you can make all set up when monster is placed already.

For all new placed monsters you can apply all commands.


Options for !!MO receiver

Options list Legend

A$

Set/Check/Get reward artifact to $. (Format A1)

B#1/$2

Set/Check/Get the amount of resource #1 (Format R) to $2 (may be negative).

G$

Set/Check/Get the number of monsters to $.

M^TEXT^

Set message text to TEXT.

The text's length must not exceed the original one. It may contain any symbols except ^ and semicolon.

M#

Set message text to that of the timed event number #.

M-1

Do not show the message on the screen.

Mz#

Set/Get message text from string variable.

M1/$

M1/-1

Set and  get the string parameters. You can use it when M command is used to set name/message.

   M1/$ - $=index of string var;

   M1/-1 - disable (restore default) message.

Now you can not only set but also get the string parameters. You can use it when M command is used to set name/message.

O#

Set/Check/Get the grow checkbox.

If # = 1 then the amount of monsters won't grow, if not 1, they will.

R$/#

Set/Check/Get the battle ability.

   $ is a level of aggression (get/check/set);

   # is a phantom parameter (it is not used but needed to distinguish a new syntax from old one), may keep any value.

Level of aggressions:

   0 - compliant;

   1...9 - gradation of aggression;

   10 - savage.

Old syntax: MO:R0 (compliant) or MO:R1 (savage).

Internal Heroes values:

   Savage	= 10;

   Hostile	= Random from 4 to 10;

   Aggressive	= Random from 1 to 10;

   Friendly	= Random from 1 to 7;

   Compliant	= 0.

U#

Set/Check/Get the escape ability.

If # = 1 then the monsters can't escape, if not 1, they can escape.


Options list for !!MO receiver
A$ Set/Check/Get reward artifact

B#1/$2 Set/Check/Get the amount of resource

G$ Set/Check/Get the number of monsters

M^TEXT^ Set message text to TEXT

M# Set message text to that of the timed event

M-1 Do not show the message

Mz# Set/Get message text from string variable

M1/$ Set and  get the string parameters

O# Set/Check/Get the grow checkbox

R$/# Set/Check/Get the battle ability

U# Set/Check/Get the escape ability


Format A1
List of Artifacts Numbers (Type 5)

Indexes	Artifacts
0	Spell book
1	Spell Scroll
2	Grail
3	Catapult
4	Ballista
5	Ammo Cart
6	First Aid Tent
7	Centaur Axe
8	Blackshard of the Dead Knight
9	Greater Gnoll's Flail
10	Ogre's Club of Havoc
11	Sword of Hellfire
12	Titan's Gladius
13	Shield of the Dwarven Lords
14	Shield of the Yawning Dead
15	Buckler of the Gnoll King
16	Targ of the Rampaging Ogre
17	Shield of the Damned
18	Sentinel's Shield
19	Helm of the Alabaster Unicorn
20	Skull Helmet
21	Helm of Chaos
22	Crown of the Supreme Magi
23	Hellstorm Helmet
24	Thunder Helmet
25	Breastplate of Petrified Wood
26	Rib Cage
27	Scales of the Greater Basilisk
28	Tunic of the Cyclops King
29	Breastplate of Brimstone
30	Titan's Cuirass
31	Armor of Wonder
32	Sandals of the Saint
33	Celestial Necklace of Bliss
34	Lion's Shield of Courage
35	Sword of Judgement
36	Helm of Heavenly Enlightenment
37	Quiet Eye of the Dragon
38	Red Dragon Flame Tongue
39	Dragon Scale Shield
40	Dragon Scale Armor
41	Dragonbone Greaves
42	Dragon Wing Tabard
43	Necklace of Dragonteeth
44	Crown of Dragontooth
45	Still Eye of the Dragon
46	Clover of Fortune
47	Cards of Prophecy
48	Ladybird of Luck
49	Badge of Courage
50	Crest of Valor
51	Glyph of Gallantry
52	Speculum
53	Spyglass
54	Amulet of the Undertaker
55	Vampire's Cowl
56	Dead Man's Boots
57	Garniture of Interference
58	Surcoat of Counterpoise
59	Boots of Polarity
60	Bow of Elven Cherrywood
61	Bowstring of the Unicorn's Mane
62	Angel Feather Arrows
63	Bird of Perception
64	Stoic Watchman
65	Emblem of Cognizance
66	Statesman's Medal
67	Diplomat's Ring
68	Ambassador's Sash
69	Ring of the Wayfarer
70	Equestrian's Gloves
71	Necklace of Ocean Guidance
72	Angel Wings
73	Charm of Mana
74	Talisman of Mana
75	Mystic Orb of Mana
76	Collar of Conjuring
77	Ring of Conjuring
78	Cape of Conjuring
79	Orb of the Firmament
80	Orb of Silt
81	Orb of Tempestuous Fire
82	Orb of Driving Rain
83	Recanter's Cloak
84	Spirit of Oppression
85	Hourglass of the Evil Hour
86	Tome of Fire Magic
87	Tome of Air Magic
88	Tome of Water Magic
89	Tome of Earth Magic
90	Boots of Levitation
91	Golden Bow
92	Sphere of Permanence
93	Orb of Vulnerability
94	Ring of Vitality
95	Ring of Life
96	Vial of Lifeblood
97	Necklace of Swiftness
98	Boots of Speed
99	Cape of Velocity
100	Pendant of Dispassion
101	Pendant of Second Sight
102	Pendant of Holiness
103	Pendant of Life
104	Pendant of Death
105	Pendant of Free Will
106	Pendant of Negativity
107	Pendant of Total Recall
108	Pendant of Courage
109	Everflowing Crystal Cloak
110	Ring of Infinite Gems
111	Everpouring Vial of Mercury
112	Inexhaustible Cart of Ore
113	Eversmoking Ring of Sulfur
114	Inexhaustible Cart of Lumber
115	Endless Sack of Gold
116	Endless Bag of Gold
117	Endless Purse of Gold
118	Legs of Legion
119	Loins of Legion
120	Torso of Legion
121	Arms of Legion
122	Head of Legion
123	Sea Captain's Hat
124	Spellbinder's Hat
125	Shackles of War
126	Orb of Inhibition
127	Vial of Dragon Blood
128	Armageddon's Blade
129	Angelic Alliance
130	Cloak of the Undead King
131	Elixir of Life
132	Armor of the Damned
133	Statue of Legion
134	Power of the Dragon Father
135	Titan's Thunder
136	Admiral's Hat
137	Bow of the Sharpshooter
138	Wizard's Well
139	Ring of the Magi
140	Cornucopia
141	Magic Wand (WOG)
142	Gold Tower Arrow (WOG)
143	Monster's Power (WOG)
144	Artifact Lock (Not artifacts -  internal use only)
145	Highlighted Slot (Not artifacts -  internal use only)
146	Axe of Smashing (Commander Artifact)
147	Mithril Mail (Commander Artifact)
148	Sword of Sharpness (Commander Artifact)
149	Helm of Immortality (Commander Artifact)
150	Pendant of Sorcery (Commander Artifact)
151	Boots of Haste (Commander Artifact)
152	Bow of Seeking (Commander Artifact)
153	Dragon Eye Ring (Commander Artifact)
154	Hardened Shield (Commander Artifact)
155	Slava's Ring of Power (Commander Artifact)


Format AD
List of Specialties

X5/2 - All creatures receive +2 speed. (Sir Mullich spec.)

X8/1 - Walking Darkness

X8/2 - Builder


Format AP
Position of the artifact

Index	Position
0	head
1	shoulders
2	neck
3	right hand
4	left hand
5	torso
6	right ring
7	left ring
8	feet
9	misc. slot 1
10	misc. slot 2
11	misc. slot 3
12	misc. slot 4
13	ballista (war machine 1)
14	ammo cart (war machine 2)
15	first aid tent (war machine 3)
16	catapult
17	spell book
18	misc. slot 5


Format P2
Position of the artifact with UN:A command

Index	Position
0	none (backpack only) eg. the Grail
1	head
2	shoulders
3	neck
4	right hand
5	left hand
6	torso
7	ring (either hand)
8	feet
9	misc. slot (any)
10	ballista (war machine 1)
11	ammo cart (war machine 2)
12	first aid tent (war machine 3)
13	catapult
14	spellbook


Format BG
Border Guards (Type 9),

Border Gates (Type 212)

and Keymaster's Tents (Type 10)

Index	Color
0	Light blue
1	Green
2	Red
3	Dark blue
4	Brown
5	Purple
6	White
7	Black


Format C
Creatures (Type 54)

Index	Creature
0	Pikeman
1	Halberdier
2	Archer
3	Marksman
4	Griffin
5	Royal Griffin
6	Swordsman
7	Crusader
8	Monk
9	Zealot
10	Cavalier
11	Champion
12	Angel
13	Archangel
14	Centaur
15	Centaur Captain
16	Dwarf
17	Battle Dwarf
18	Wood Elf
19	Grand Elf
20	Pegasus
21	Silver Pegasus
22	Dendroid Guard
23	Dendroid Soldier
24	Unicorn
25	War Unicorn
26	Green Dragon
27	Gold Dragon
28	Gremlin
29	Master Gremlin
30	Stone Gargoyle
31	Obsidian Gargoyle
32	Stone Golem
33	Iron Golem
34	Mage
35	Arch Mage
36	Genie
37	Master Genie
38	Naga
39	Naga Queen
40	Giant
41	Titan
42	Imp
43	Familiar
44	Gog
45	Magog
46	Hell Hound
47	Cerberus
48	Demon
49	Horned Demon
50	Pit Fiend
51	Pit Lord
52	Efreeti
53	Efreet Sultan
54	Devil
55	Arch Devil
56	Skeleton
57	Skeleton Warrior
58	Walking Dead
59	Zombie
60	Wight
61	Wraith
62	Vampire
63	Vampire Lord
64	Lich
65	Power Lich
66	Black Knight
67	Dread Knight
68	Bone Dragon
69	Ghost Dragon
70	Troglodyte
71	Infernal Troglodyte
72	Harpy
73	Harpy Hag
74	Beholder
75	Evil Eye
76	Medusa
77	Medusa Queen
78	Minotaur
79	Minotaur King
80	Manticore
81	Scorpicore
82	Red Dragon
83	Black Dragon
84	Goblin
85	Hobgoblin
86	Wolf Rider
87	Wolf Raider
88	Orc
89	Orc Chieftain
90	Ogre
91	Ogre Mage
92	Roc
93	Thunderbird
94	Cyclops
95	Cyclops King
96	Behemoth
97	Ancient Behemoth
98	Gnoll
99	Gnoll Marauder
100	Lizardman
101	Lizard Warrior
102	Gorgon
103	Mighty Gorgon
104	Serpent Fly
105	Dragon Fly
106	Basilisk
107	Greater Basilisk
108	Wyvern
109	Wyvern Monarch
110	Hydra
111	Chaos Hydra
112	Air Elemental
113	Earth Elemental
114	Fire Elemental
115	Water Elemental
116	Gold Golem
117	Diamond Golem
118	Pixie
119	Sprite
120	Psychic Elemental
121	Magic Elemental
122	NOT USED (1)
123	Ice Elemental
124	NOT USED (2)
125	Magma Elemental
126	NOT USED (3)
127	Storm Elemental
128	NOT USED (4)
129	Energy Elemental
130	Firebird
131	Phoenix
132	Azure Dragon
133	Crystal Dragon
134	Faerie Dragon
135	Rust Dragon
136	Enchanter
137	Sharpshooter
138	Halfling
139	Peasant
140	Boar
141	Mummy
142	Nomad
143	Rogue
144	Troll
145	Catapult (specialty X1)
146	Ballista (specialty X1)
147	First Aid Tent (specialty X1)
148	Ammo Cart (specialty X1)
149	Arrow Towers (specialty X1)
150	Supreme Archangel
151	Diamond Dragon
152	Lord of Thunder
153	Antichrist
154	Blood Dragon
155	Darkness Dragon
156	Ghost Behemoth
157	Hell Hydra
158	Sacred Phoenix
159	Ghost
160	Emissary of War
161	Emissary of Peace
162	Emissary of Mana
163	Emissary of Lore
164	Fire Messenger
165	Earth Messenger
166	Air Messenger
167	Water Messenger
168	Gorynych
169	War zealot
170	Arctic Sharpshooter
171	Lava Sharpshooter
172	Nightmare
173	Santa Gremlin
174	Paladin (1)
175	Hierophant (1)
176	Temple Guardian (1)
177	Succubus (1)
178	Soul Eater (1)
179	Brute (1)
180	Ogre Leader (1)
181	Shaman (1)
182	Astral Spirit (1)
183	Paladin (2)
184	Hierophant (2)
185	Temple Guardian (2)
186	Succubus (2)
187	Soul Eater (2)
188	Brute (2)
189	Ogre Leader (2)
190	Shaman (2)
191	Astral Spirit (2)


Format CB
Creature Banks (Type 16)

Index	Creature Bank
00	Cyclops Stockpile
01	Dwarven Treasury
02	Griffin Conservatory
03	Imp Cache
04	Medusa Stores
05	Naga Bank
06	Dragon Fly Hive
07	NOT USED
08	NOT USED
09	NOT USED
10	NOT USED
11	Hunting Lodge
12	Snow-covered Grotto
13	Palace of Martial Spirit (Emissaries of War)
14	Citadel of Pacification (Emissaries of Peace)
15	Monastery of Magicians (Emissaries of Mana)
16	Library of Legends (Emissaries of Lore)
17	Transylvanian Tavern
18	Home of the Bat
19	Lost Bottle
20	Grotto


Format CG
Creature Generators (Type 17)

Towns list

Castle

56 Guardhouse (Pikemen)

57 Archers' Tower (Archers)

25 Griffin Tower (Griffins)

58 Barracks (Swordsmen)

35 Monastery (Monks)

05 Training Grounds (Cavaliers)

08 Portal of Glory (Angels)

80 Portal of Splendor (Supreme Archangels)

Rampart

06 Centaur Stables (Centaurs)

12 Dwarf Cottage (Dwarves)

15 Homestead (Elves)

50 Enchanted Spring (Pegasi)

45 Dendroid Arches (Dendroid Guards)

51 Unicorn Glade (Unicorns) (Standard Version)

68 Unicorn Glade (Unicorns) (Small Version)

24 Dragon Cliffs (Green Dragons)

81 Dragon Peaks (Diamond Dragons)

Tower

43 Workshop (Gremlins)

17 Parapet (Stone Gargoyles)

Type 20. Subtype 01: Golem Factory (Stone, Iron, Gold, Diamond Golems)

31 Mage Tower (Mages)

18 Altar of Wishes (Genies)

36 Golden Pavilion (Nagas)

44 Cloud Temple (Giants)

82 Storm Temple (Lords of Thunder)

Inferno

29 Imp Crucible (Imps)

22 Hall of Sins (Gogs)

27 Kennels (Hell Hounds)

37 Demon Gate (Demons)

40 Hell Hole (Pit Fiends)

14 Fire Lake (Efreet)

10 Forsaken Palace (Devils)

83 Unholy Palace (Antichrists)

Necropolis

54 Cursed Temple (Skeletons)

55 Graveyard (Walking Dead)

48 Tomb of Souls (Wights)

53 Estate (Vampires)

52 Mausoleum (Liches)

03 Hall of Darkness (Black Knights)

04 Dragon Vault (Bone Dragons)

84 Spectral Vault (Blood Dragons)

Dungeon

46 Warren (Troglodytes)

26 Harpy Loft (Harpies)

02 Pillar of Eyes (Beholders)

33 Chapel of Stilled Voices (Medusas)

34 Labyrinth (Minotaurs)

32 Manticore Lair (Manticores)

41 Dragon Cave (Red Dragons)

85 Cave of Darkness (Darkness Dragons)

Stronghold

21 Goblin Barracks (Goblins)

19 Wolf Pen (Wolf Riders)

39 Orc Tower (Orcs)

38 Ogre Fort (Ogres)

42 Cliff Nest (Rocs)

09 Cyclops Cave (Cyclops)

01 Behemoth Crag (Behemoths)

86 Behemoth Tomb (Ghost Behemoths)

Fortress

20 Gnoll Hut (Gnolls)

30 Lizard Den (Lizardmen)

11 Serpent Fly Hive (Serpent Flies)

00 Basilisk Pit (Basilisks)

23 Gorgon Lair (Gorgons)

49 Wyvern Nest (Wyverns)

28 Hydra Pond (Hydras)

87 Chaos Pool (Hell Hydras)

Conflux

59 Magic Lantern (Pixies)

Type 20. Subtype 00: Elemental Conflux (Air, Earth, Fire, Water Elementals)

07 Air Elemental Conflux (Air Elementals)

69 Altar of Air (Air Elementals)

47 Water Elemental Conflux (Water Elementals)

72 Altar of Water (Water Elementals)

16 Fire Elementals Conflux (Fire Elementals)

71 Altar of Fire (Fire Elementals)

13 Earth Elemental Conflux (Earth Elementals)

70 Altar of Earth (Earth Elementals)

60 Altar of Thought (Psychic Elementals)

61 Pyre (Firebirds)

88 Spirit Pyre (Sacred Phoenixes)

Neutral Dwellings

74 Hovel (Peasants)

73 Thatched Hut (Halflings)

75 Boar Glen (Boars)

78 Rogue Cavern (Rogues)

77 Nomad Tent (Nomads)

76 Tomb of Curses (Mummies)

67 Treetop Tower (Sharpshooters)

79 Troll Bridge (Trolls)

66 Enchanter's Hollow (Enchanters)

64 Magic Forest (Faerie Dragons)

65 Sulfurous Lair (Rust Dragons)

63 Crystal Cavern (Crystal Dragons)

62 Frozen Cliffs (Azure Dragons)

New Neutral Dwellings

89 Rock Covered Position (Lava Sharpshooters)

90 Snow Covered Position (Arctic Sharpshooters)

91 Vast Cavern (Gorynyches)

92 Dream Horse-shoe (Nightmares)

93 Natural Calamity (Earth, Air Fire, Water Messengers)

94 Lost Friary (War Zealots)

95 Snowman (Santa Gremlins)


Format CG Towns list
Castle

Rampart

Tower

Inferno

Necropolis

Dungeon

Stronghold

Fortress

Conflux

Neutral Dwellings

New Neutral Dwellings


Format CO
Combination Artifact Numbers

(For UN:A command only)

Index	Artifact
0	Angelic Alliance
1	Cloak of the Undead King
2	Elixir of Life
3	Armor of the Damned
4	Statue of Legion
5	Power of the Dragon Father
6	Titan's Thunder
7	Admiral's Hat
8	Bow of the Sharpshooter
9	Wizard's Well
10	Ring of the Magi
11	Cornucopia


Format E
The colours of the players (bits)

Each color is coded by one bit. The colours:

Index	Color
1	red
2	blue
4	tan
8	green
16	orange
32	purple
64	teal
128	pink

For example, blue, green and purple would be 2+8+32=42.


Format E1
The colours of the players

Index	Color
-1	neutral if not specified otherwise
0	red
1	blue
2	tan
3	green
4	orange
5	purple
6	teal
7	pink


Format H
List of Heroes' ID's (Type 34)

Heroes list

Index	Hero
Knights

0	Orrin
1	Valeska
2	Edric
3	Sylvia
4	Lord Haart
5	Sorsha
6	Christian
7	Tyris
Clerics

8	Rion
9	Adela
10	Cuthbert
11	Adelaide
12	Ingham
13	Sanya
14	Loynis
15	Caitlin
Rangers

16	Mephala
17	Ufretin
18	Jenova
19	Ryland
20	Thorgrim
21	Ivor
22	Clancy
23	Kyrre
Druids

24	Coronius
25	Uland
26	Elleshar
27	Gem
28	Malcom
29	Melodia
30	Alagar
31	Aeris
Alchemists

32	Piquedram
33	Thane
34	Josephine
35	Neela
36	Torosar
37	Fafner
38	Rissa
39	Iona
Wizards

40	Astral
41	Halon
42	Serena
43	Daremyth
44	Theodorus
45	Solmyr
46	Cyra
47	Aine
Demoniacs

48	Fiona
49	Rashka
50	Marius
51	Ignatius
52	Octavia
53	Calh
54	Pyre
55	Nymus
Heretics

56	Ayden
57	Xyron
58	Axsis
59	Olema
60	Calid
61	Ash
62	Zydar
63	Xarfax
Death Knights

64	Straker
65	Vokial
66	Moandor
67	Charna
68	Tamika
69	Isra
70	Clavius
71	Galthran
Necromancers

72	Septienna
73	Aislinn
74	Sandro
75	Nimbus
76	Thant
77	Xsi
78	Vidomina
79	Nagash
Overlords

80	Lorelei
81	Arlach
82	Dace
83	Ajit
84	Damacon
85	Gunnar
86	Synca
87	Shakti
Warlocks

88	Alamar
89	Jaegar
90	Malekith
91	Jeddite
92	Geon
93	Deemer
94	Sephinroth
95	Darkstorn
Barbarians

96	Yog
97	Gurnisson
98	Jabarkas
99	Shiva
100	Gretchin
101	Krellion
102	Crag Hack
103	Tyraxor
Battle Mages

104	Gird
105	Vey
106	Dessa
107	Terek
108	Zubin
109	Gundula
110	Oris
111	Saurug
Beastmasters

112	Bron
113	Drakon
114	Wystan
115	Tazar
116	Alkin
117	Korbac
118	Gerwulf
119	Broghild
Witches

120	Mirlanda
121	Rosic
122	Voy
123	Verdish
124	Merist
125	Styg
126	Andra
127	Tiva
Planeswalkers

128	Pasis
129	Thunar
130	Ignissa
131	Lacus
132	Monere
133	Erdamon
134	Fiur
135	Kalt
Elementalists

136	Luna
137	Brissa
138	Ciele
139	Labetha
140	Inteus
141	Aenain
142	Gelare
143	Grindan
Extension Heroes

144	Sir Mullich
145	Adrienne
146	Catherine
147	Dracon
148	Gelu
149	Kilgor
150	Lord Haart
151	Mutare
152	Roland
153	Mutare Drake
154	Boragus
155	Xeron


Format H Heroes list
Knights

Clerics

Rangers

Druids

Alchemists

Wizards

Demoniacs

Heretics

Death Knights

Necromancers

Overlords

Warlocks

Barbarians

Battle Mages

Beastmasters

Witches

Planeswalkers

Elementalists

Extension Heroes


Format HC
Hero Classes

Index	Hero Classes
0	Knight
1	Cleric
2	Ranger
3	Druid
4	Alchemist
5	Wizard
6	Demoniac
7	Heretic
8	Death Knight
9	Necromancer
10	Warlock
11	Overlord
12	Barbarian
13	Battle Mage
14	Beastmaster
15	Witch
16	Planeswalker
17	Elementalist


Format HL
Hero/Commander Experience Levels

Level	Experience needed
1	none
2	1000
3	2000
4	3200
5	4600
6	6200
7	8000
8	10000
9	12200
10	14700
11	17500
12	20600
13	24320
14	28784
15	34140
16	40567
17	48279
18	57533
19	68637
20	81961
21	97949
22	117134
23	140156
24	167782
25	200933
26	240714
27	288451
28	345735
29	414475
30	496963
31	595948
32	714730
33	857268
34	1028313
35	1233567
36	1479871
37	1775435
38	2130111
39	2555722
40	3066455
41	3679334
42	4414788
43	5297332
44	6356384
45	7627246
46	9152280
47	10982320
48	13178368
49	15813625
50	18975933
51	22770702
52	27324424
53	32788890
54	39346249
55	47215079
56	56657675
57	67988790
58	81586128
59	97902933
60	117483099
61	140979298
62	169174736
63	203009261
64	243610691
65	292332407
66	350798466
67	420957736
68	505148860
69	606178208
70	727413425
71	872895685
72	1047474397
73	1256968851
74	1508362195
75	1810034207
76	ghost level
77	ghost level
78	ghost level
79	ghost level
80	ghost level
81	ghost level
82	ghost level
83	ghost level
84	ghost level
85	ghost level
86	ghost level
87	ghost level
88	ghost level
89	2073739175
Note: At level 75, if you level up, you'll gain a lot of levels at once up to 89 as a bonus. If you are at level 89 and level up it will show you a level 0.

Note: Commanders use the same type of experience and level upgrade as the Hero, so the same Format can be used as reference.


Format OB
List and Type of objects

Index	Object
0	<none>
1	<none>
2	Altar of Sacrifice
3	Anchor Point
4	Arena
5	Artifact [0-143 - Format A1]
6	Pandora's Box
7	Black Market
8	Boat
9	Borderguard [0-7 - Format BG]
10	Keymaster's Tent [0-7 - Format BG]
11	Buoy
12	Campfire
13	Cartographer
14	Swan Pond
15	Cover of Darkness
16	Creature Bank [0-20 - Format CB]
17	Creature Generator 1 [0-95 - Format CG]
18	Creature Generator 2
19	Creature Generator 3
20	Creature Generator 4 [0-1 - Format CG]
21	Cursed Ground
22	Corpse
23	Marletto Tower
24	Derelict Ship
25	Dragon Utopia
26	Event
27	Eye of the Magi
28	Faerie Ring
29	Flotsam
30	Fountain of Fortune
31	Fountain of Youth
32	Garden of Revelation
33	Garrison [0 = ordinary, 1 = antimagic]
34	Hero [0-155 - Format H]
35	Hill Fort
36	Grail
37	Hut of the Magi
38	Idol of Fortune
39	Lean To
40	<blank>
41	Library of Enlightenment
42	Lighthouse
43	Monolith One Way Entrance [0 - 7 - Format M1]
44	Monolith One Way Exit [0 - 7 - Format M1]
45	Monolith Two Way [0 - 7 - Format M2]
46	Magic Plains
47	School of Magic
48	Magic Spring
49	Magic Well
50	<blank>
51	Mercenary Camp
52	Mermaid
53	Mine [0 - 7 - Format MI]
54	Monster [0 - 173 - Format C]
55	Mystical Garden
56	Oasis
57	Obelisk
58	Redwood Observatory
59	Ocean Bottle
60	Pillar of Fire
61	Star Axis
62	Prison
63	Pyramid [0 - 51 - Castle Editor Objects]
64	Rally Flag
65	Random Artifact
66	Random Treasure Artifact
67	Random Minor Artifact
68	Random Major Artifact
69	Random Relic
70	Random Hero
71	Random Monster
72	Random Monster 1
73	Random Monster 2
74	Random Monster 3
75	Random Monster 4
76	Random Resource
77	Random Town
78	Refugee Camp
79	Resource [0 - 7 - Format R]
80	Sanctuary
81	Scholar
82	Sea Chest
83	Seer's Hut
84	Crypt
85	Shipwreck
86	Shipwreck Survivor
87	Shipyard
88	Shrine of Magic Incantation
89	Shrine of Magic Gesture
90	Shrine of Magic Thought
91	Sign
92	Sirens
93	Spell Scroll [0 - 69 - Format SP]
94	Stables
95	Tavern
96	Temple
97	Den of Thieves
98	Town [0 - 8 - Format T]
99	Trading Post
100	Learning Stone
101	Treasure Chest
102	Tree of Knowledge
103	Subterranean Gate
104	University
105	Wagon
106	War Machine Factory
107	School of War
108	Warrior's Tomb
109	Water Wheel
110	Watering Hole
111	Whirlpool
112	Windmill
113	Witch Hut [0 - 27 - Format SS]
114	Brush
115	Bush
116	Cactus
117	Canyon
118	Crater
119	Dead Vegetation
120	Flowers
121	Frozen Lake
122	Hedge
123	Hill
124	Hole
125	Kelp
126	Lake
127	Lava Flow
128	Lava Lake
129	Mushrooms
130	Log
131	Mandrake
132	Moss
133	Mound
134	Mountain
135	Oak Trees
136	Outcropping
137	Pine Trees
138	Plant
143	River Delta
147	Rock
148	Sand Dune
149	Sand Pit
150	Shrub
151	Skull
152	Stalagmite
153	Stump
154	Tar Pit
155	Trees
156	Vine
157	Volcanic Vent
158	Volcano
159	Willow Trees
160	Yucca Trees
161	Reef
162	Random Monster 5
163	Random Monster 6
164	Random Monster 7
165	Brush
166	Bush
167	Cactus
168	Canyon
169	Crater
170	Dead Vegetation
171	Flowers
172	Frozen Lake
173	Hedge
174	Hill
175	Hole
176	Kelp
177	Lake
178	Lava Flow
179	Lava Lake
180	Mushrooms
181	Log
182	Mandrake
183	Moss
184	Mound
185	Mountain
186	Oak Trees
187	Outcropping
188	Pine Trees
189	Plant
190	River Delta
191	Rock
192	Sand Dune
193	Sand Pit
194	Shrub
195	Skull
196	Stalagmite
197	Stump
198	Tar Pit
199	Trees
200	Vine
201	Volcanic Vent
202	Volcano
203	Willow Trees
204	Yucca Trees
205	Reef
206	Desert Hills
207	Dirt Hills
208	Grass Hills
209	Rough Hills
210	Subterranean Rocks
211	Swamp Foliage
212	Border Gate [0-7 - Format BG]
213	Freelancer's Guild
214	Hero Placeholder
215	Quest Guard
216	Random Dwelling
217	<none>
218	<none>
219	Garrison
220	Mine
221	Trading Post
222	Clover Field
223	Cursed Ground
224	Evil Fog
225	Favourable Winds
226	Fiery Fields
227	Holy Ground
228	Lucid Pools
229	Magic Clouds
230	Magic Plains
231	Rocklands


Format M1
One-Way Monoliths

(Entrance is Type 43)

(Exit is Type 44)

Index	Object
0	Blue (starfield)
1	Red (white vortex)
2	Yellow (gold/brown)
3	"4" (yellow glowing)
4	"5" (New Style: purple/white swirl)
5	"6" (New Style: yellow glow spots)
6	"7" (New Style: red spiral)
7	"8" (New Style: white glow sphere)


Format M2
Two-Way Monoliths (Type 45)

Index	Object
0	Green (lightning)
1	Orange (bubbles)
2	Purple (ripples)
3	"4" (brownish)
4	"5" (New Style: green energy)
5	"6" (New Style: exploding line)
6	"7" (New Style: glowing sphere)
7	"8" (New Style: whirling shape)
7	"8" (WoG: snow portal)


Format MI
Mines (Type 53)

Index	Object
0	Sawmill
1	Alchemist's Lab
2	Ore Pit
3	Sulfur Dune
4	Crystal Cavern
5	Gem Pond
6	Gold Mine
7	Abandoned Mine


Format PK
List of Primary Skills

Index	Skill
0	Attack
1	Defense
2	Power Skill
3	Knowledge


Format R
List of Resources (Type 79)

Index	Skill
0	Wood
1	Mercury
2	Ore
3	Sulfur
4	Crystal
5	Gems
6	Gold
7	Mithril


Format SP
List of Spells by numerical order

(Scrolls are Type 93)

Index	Spell
Adventure Spells

0	Summon Boat
1	Scuttle Boat
2	Visions
3	View Earth
4	Disguise
5	View Air
6	Fly
7	Water Walk
8	Dimension Door
9	Town Portal
Combat Spells

10	Quicksand
11	Land Mine
12	Force Field
13	Fire Wall
14	Earthquake
15	Magic Arrow
16	Ice Bolt
17	Lightning Bolt
18	Implosion
19	Chain Lightning
20	Frost Ring
21	Fireball
22	Inferno
23	Meteor Shower
24	Death Ripple
25	Destroy Undead
26	Armageddon
27	Shield
28	Air Shield
29	fire Shield
30	Protection from Air
31	Protection from Fire
32	Protection from Water
33	Protection from Earth
34	Anti-Magic
35	Dispel
36	Magic Mirror
37	Cure
38	Resurrection
39	Animate Dead
40	Sacrifice
41	Bless
42	Curse
43	Bloodlust
44	Precision
45	Weakness
46	Stone Skin
47	Disrupting Ray
48	Prayer
49	Mirth
50	Sorrow
51	Fortune
52	Misfortune
53	Haste
54	Slow
55	Slayer
56	Frenzy
57	Titan's Lightning Bolt
58	Counterstrike
59	Berserk
60	Hypnotize
61	Forgetfulness
62	Blind
63	Teleport
64	Remove Obstacle
65	Clone
66	Fire Elemental
67	Earth Elemental
68	Water Elemental
69	Air Elemental


Format SS
List of Secondary Skills

Index	Skill
0	Pathfinding
1	Archery
2	Logistics
3	Scouting
4	Diplomacy
5	Navigation
6	Leadership
7	Wisdom
8	Mysticism
9	Luck
10	Ballistics
11	Eagle Eye
12	Necromancy
13	Estates
14	Fire Magic
15	Air Magic
16	Water Magic
17	Earth Magic
18	Scholar
19	Tactics
20	Artillery
21	Learning
22	Offence
23	Armorer
24	Intelligence
25	Sorcery
26	Resistance
27	First Aid


Format SQ
List of Secondary Skills

with IF:Q Command

Index	Skill
3	Basic Pathfinding
4	Advanced Pathfinding
5	Expert Pathfinding
6	Basic Archery
7	Advanced Archery
8	Expert Archery
9	Basic Logistics
10	Advanced Logistics
11	Expert Logistics
12	Basic Scouting
13	Advanced Scouting
14	Expert Scouting
15	Basic Diplomacy
16	Advanced Diplomacy
17	Expert Diplomacy
18	Basic Navigation
19	Advanced Navigation
20	Expert Navigation
21	Basic Leadership
22	Advanced Leadership
23	Expert Leadership
24	Basic Wisdom
25	Advanced Wisdom
26	Expert Wisdom
27	Basic Mysticism
28	Advanced Mysticism
29	Expert Mysticism
30	Basic Luck
31	Advanced Luck
32	Expert Luck
33	Basic Ballistics
34	Advanced Ballistics
35	Expert Ballistics
36	Basic Eagle Eye
37	Advanced Eagle Eye
38	Expert Eagle Eye
39	Basic Necromancy
40	Advanced Necromancy
41	Expert Necromancy
42	Basic Estates
43	Advanced Estates
44	Expert Estates
45	Basic Fire Magic
46	Advanced Fire Magic
47	Expert Fire Magic
48	Basic Air Magic
49	Advanced Air Magic
50	Expert Air Magic
51	Basic Water Magic
52	Advanced Water Magic
53	Expert Water Magic
54	Basic Earth Magic
55	Advanced Earth Magic
56	Expert Earth Magic
57	Basic Scholar
58	Advanced Scholar
59	Expert Scholar
60	Basic Tactics
61	Advanced Tactics
62	Expert Tactics
63	Basic Artillery
64	Advanced Artillery
65	Expert Artillery
66	Basic Learning
67	Advanced Learning
68	Expert Learning
69	Basic Offence
70	Advanced Offence
71	Expert Offence
72	Basic Armorer
73	Advanced Armorer
74	Expert Armorer
75	Basic Intelligence
76	Advanced Intelligence
77	Expert Intelligence
78	Basic Sorcery
79	Advanced Sorcery
80	Expert Sorcery
81	Basic Resistance
82	Advanced Resistance
83	Expert Resistance
84	Basic First Aid
85	Advanced First Aid
86	Expert First Aid


Format T
Town Types (Type 98)

Index	Town
0	Castle
1	Rampart
2	Tower
3	Inferno
4	Necropolis
5	Dungeon
6	Stronghold
7	Fortress
8	Conflux


Format TR
Terrain Types

Index	Terrain
00	Dirt
01	Sand
02	Grass
03	Snow
04	Swamp
05	Rough
06	Subterranean
07	Lava
08	Water
09	Rock


Format U
Town Buildings

Buildings list

Buildings common to all towns

Index	Building
0	Town Hall
1	City Hall
2	Capitol
3	Fort
4	Citadel
5	Castle
6	Tavern
7	Blacksmith
8	Marketplace
9	Resource Silo

Some numbers of buildings also coincide. They are placed in the table for everyone cities for convenience.

Castle

10	NOT USED
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	Mage Guild level 4
15	NOT USED
16	Shipyard
17	Colossus
18	Lighthouse
19	Brotherhood of the Sword
20	Stables
21	NOT USED
22	Guardhouse
23	Upg. Guardhouse
24	NOT USED
25	Archers' Tower
26	Upg. Archers' Tower
27	NOT USED
28	Griffin Tower
29	Upg. Griffin Tower
30	Griffin Bastion
31	Barracks
32	Upg. Barracks
33	NOT USED
34	Monastery
35	Upg. Monastery
36	NOT USED
37	Training Grounds
38	Upg. Training Grounds
39	Portal of Glory
40	Upg. Portal of Glory
Rampart

10	NOT USED
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	Mage Guild level 4
15	Mage Guild level 5
16	NOT USED
17	Spirit Guardian
18	Mystic Pond
19	Fountain of Fortune
20	Treasure
21	NOT USED
22	Centaur Stables
23	Upg. Centaur Stables
24	NOT USED
25	Dwarf Cottage
26	Upg. Dwarf Cottage
27	Miner's Guild
28	Homestead
29	Upg. Homestead
30	NOT USED
31	Enchanted Spring
32	Upg. Enchanted Spring
33	NOT USED
34	Dendroid Arches
35	Upg. Dendroid Arches
36	Dendroid Saplings
37	Unicorn Glade
38	Upg. Unicorn Glade
39	Dragon Cliffs
40	Dragon Cliffs
Tower

10	Artifact Merchants
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	Mage Guild level 4
15	Mage Guild level 5
16	NOT USED
17	Skyship
18	Library
19	Wall of Knowledge
20	Lookout Tower
21	NOT USED
22	Workshop
23	Upg. Workshop
24	NOT USED
25	Parapet
26	Upg. Parapet
27	Sculptor's Wings
28	Golem Factory
29	Upg. Golem Factory
30	NOT USED
31	Mage Tower
32	Upg. Mage Tower
33	NOT USED
34	Altar of Wishes
35	Upg. Altar of Wishes
36	NOT USED
37	Golden Pavilion
38	Upg. Golden Pavilion
39	Cloud Temple
40	Upg. Cloud Temple
Inferno

10	NOT USED
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	Mage Guild level 4
15	Mage Guild level 5
16	NOT USED
17	Deity of Fire
18	Brimstone Storm clouds
19	Castle Gate
20	Order of Fire
21	NOT USED
22	Imp Crucible
23	Upg. Imp Crucible
24	Birthing Pools
25	Hall of Sins
26	Upg. Hall of Sins
27	NOT USED
28	Kennels
29	Upg. Kennels
30	Cages
31	Demon Gate
32	Upg. Demon Gate
33	NOT USED
34	Hell Hole
35	Upg. Hell Hole
36	NOT USED
37	Fire Lake
38	Upg. Fire Lake
39	Forsaken Palace
40	Upg. Forsaken Palace
Necropolis

10	NOT USED
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	Mage Guild level 4
15	Mage Guild level 5
16	Shipyard
17	Soul Prison
18	Cover of Darkness
19	Necromancy amplifier
20	Skeleton Transformer
21	NOT USED
22	Cursed Temple
23	Upg. Cursed Temple
24	Unearthed Graves
25	Graveyard
26	Upg. Graveyard
27	NOT USED
28	Tomb of Souls
29	Upg. Tomb of Souls
30	NOT USED
31	Estate
32	Upg. Estate
33	NOT USED
34	Mausoleum
35	Upg. Mausoleum
36	NOT USED
37	Hall of Darkness
38	Upg. Hall of Darkness
39	Dragon Vault
40	Upg. Dragon Vault
Dungeon

10	Artifact Merchants
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	Mage Guild level 4
15	Mage Guild level 5
16	NOT USED
17	Guardian of Earth
18	Mana Vortex
19	Portal of Summoning
20	Battle Scholar Academy
21	NOT USED
22	Warren
23	Upg. Warren
24	Mushroom Rings
25	Harpy Loft
26	Upg. Harpy Loft
27	NOT USED
28	Pillar of Eyes
29	Upg. Pillar of Eyes
30	NOT USED
31	Stilled Voices
32	Upg. Stilled Voices
33	NOT USED
34	Labyrinth
35	Upg. Labyrinth
36	NOT USED
37	Manticore Lair
38	Upg. Manticore Lair
39	Dragon Cave
40	Upg. Dragon Cave
Stronghold

10	NOT USED
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	NOT USED
15	NOT USED
16	NOT USED
17	Warlord's Monument
18	Escape Tunnel
19	???
20	Ballista Yard
21	Hall of Valhala
22	Goblin Barracks
23	Upg. Goblin Barracks
24	Mess Hall
25	Wolf Pen
26	Upg. Wolf Pen
27	NOT USED
28	Orc Tower
29	Upg. Orc Tower
30	NOT USED
31	Ogre Fort
32	Upg. Ogre Fort
33	NOT USED
34	Cliff Nest
35	Upg. Cliff Nest
36	NOT USED
37	Cyclops Cave
38	Upg. Cyclops Cave
39	Behemoth Lair
40	Upg. Behemoth Lair
Fortress

10	NOT USED
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	NOT USED
15	NOT USED
16	Shipyard
17	Carnivorous Plant
18	Cage of Warlords
19	Glyphs of Fear
20	Blood Obelisk
21	NOT USED
22	Gnoll Hut
23	Upg. Gnoll Hut
24	Captain's Quarters
25	Lizard Den
26	Upg. Lizard Den
27	NOT USED
28	Serpent Fly Hive
29	Upg. Serpent Fly Hive
30	NOT USED
31	Basilisk Pit
32	Upg. Basilisk Pit
33	NOT USED
34	Gorgon Lair
35	Upg. Gorgon Lair
36	NOT USED
37	Wyvern Nest
38	Upg. Wyvern Nest
39	Hydra Pond
40	Upg. Hydra Pond
Conflux

10	Artifact Merchants
11	Mage Guild level 1
12	Mage Guild level 2
13	Mage Guild level 3
14	Mage Guild level 4
15	Mage Guild level 5
16	Shipyard
17	Aurora Borealis
18	Magic University
19	NOT USED
20	NOT USED
21	NOT USED
22	Magic Lantern
23	Upg. Magic Lantern
24	Garden of Life
25	Altar of Air
26	Upg. Altar of Air
27	NOT USED
28	Altar of Water
29	Upg. Altar of Water
30	NOT USED
31	Altar of Fire
32	Upg. Altar of Fire
33	NOT USED
34	Altar of Earth
35	Upg. Altar of Earth
36	NOT USED
37	Altar of Thought
38	Upg. Altar of Thought
39	Pyre
40	Upg. Pyre

If you will build level "N" of Magic Guild  the level "N-1" will be also built.


Receiver !!OB

Options Legend

!!OB#1/#2/#3:XXXX

Generic object receiver used to enable/disable and set the type and other general characteristics of an object.

   #1 - X,

   #2 - Y,

   #3 - Level.

Used to modify the attributes of an object at the specified position. The generic object receiver is used to enable/disable and set generic attributes while the specific object receivers may be used to change object-specific settings (e.g., the type and number of resources given by a windmill).

Comments:

For OB receiver you can set/check/get the type of objects, subtype and control word (complex object depended format). That is enough to make a duplicate of any objects not for view but for nature.

When an object is disabled on the map, ERM receivers for the corresponding object will still be executed in any case of attempt to visit the object. Disabling only disables the normal function of that object.

Now you can not only set but also get the string parameters. You can use it when M command is used to set name/message.

Example:

!!IFv10:S5;

!!SG4/3/0:M1/v10; set sign message to string var z[v10] or z5

!!SG4/3/0:M1/?z10; get current sign message to z10 string var

Be careful: don't use OB command with an object with 2 entrances (yellow square). When you place an object, it will set up only first right bottom entrance square that will be met. Then you should manually copy a control word from that square to all other yellow squares of this object.

Q -

How to check if the AI visits an object?

A -

When any hero visits an object the AI flag is stored in flag1000. Flag 1000 is set to True for a human player and False for the AI. So you can use it like this:

!?OB...;

!!IF&1000:M^Player^;

!!IF&-1000:M^AI^;


Options for !!OB receiver

Options list Legend

B

Remove a description hint for an object.

C$

Set/check/get control word of object.

D#

Disable to gamer of # color (see Format E1) to use object.

E#

Enable to gamer of # color (see Format E1) to use object.

H$

Replace a hint (right-click text) for any object. Set the message to z variable value ($ = z variable index number).

M$1/$2/$3

This command can disable many messages and questions for objects at any time:

   $1 - Owner for whom (-1 for all). (see Format E1);

   $2 - Disabling (1) next message of this object;

   $3 - next state of $2 after message virtually or really appears.

This is not a real disabling, this is AUTO answering (mostly "No"). All messages that appears with ERM IF receiver will be shown as usual.

Example:

!!OB1/2/0:M-1/1/0; - next visitor of any colour won't get the message / request or in other words it will seems as though gamer answer "No", or pushes the button. This need a test. I can improve a syntax, just think it over.

R

Enable to ALL gamers to use object.

S

Disable to ALL gamers to use object.

T$

Set/check/get type of object  (see Format OB).

U$

Set/check/get subtype of object  (see Format OB).


Options list for !!OB receiver
B Remove a description hint for an object

C$ Set/check/get control word of object

D# Disable to gamer to use object

E# Enable to gamer to use object

H$ Replace a hint  for any object

M$1/$2/$3 Disable many messages and questions for objects at any time

R Enable to ALL gamers to use object

S Disable to ALL gamers to use object

T$ Set/check/get type of object

U$ Set/check/get subtype of object


Receiver !!OW

Options Legend

!!OW:XXXX

These are commands that apply to a specific player.

Used for commands that apply to specific players such as resources, teams, number of heroes controlled and time a hero can live without a town.

If you want to give or take money from a player rather than setting it to a completely new number, use a relative syntax:

!!OW../6/d100;  to give 100

!!OW../6/d-100; to take 100 (do not get below 0)


Options for !!OW receiver

Options list Legend

A#/$

Get/Check/(Set) active hero.

   # - Owner (0...7, -1 = current);

   $ - Hero number (0...155, -1 = not chosen) (See Format H).

C?$

Get/Check current player.

   $ = get or check current player (will return 0..7 - see Format E1).

Comments:

You can only get or check, but not set the value. e.g.: !!OW:C?i;.

D#1/#2

Set the number of days that a player remains in the game after losing his or her last town.

1. #1 = gamer number (see Format E1) or current (-1);

   #2 = days to be gone (0...127) or live forever (128..254).

If you set 128..254, the gamer will not get a message with a countdown until he captures at least one town and then loses his last one. 255 sets the standard default of 7 days.

2. #1 = -2 - sets the default to to be gone (standard default is 7);

   #2 = days (ex: 0...127), (128..255) all players will stay alive forever.

If you set 128..254, the gamer will get an initial message saying he must capture a town within a week but no more following that.

If you set 255, the gamer will get this message every day.

If you capture a town and then lose your last town, the default set by using -2 will remain in effect.

G$1/$2

Check if a player IS a player that is sitting before the PC screen.

Multiplayer command

   $1 = Player (color).  (see Format E1)

   $2 = Check the Player (1 = yes, it is me; 0 = no, this is another human player).

Comments:

This is important for multiplayer only. The point is that there are more than one human player and we have to know whether a player is a human here (1) or there (0). Of course, the main syntax is check or get the value, but you can also set it (though we did not try it :-)

For AI this is always 0.

Flag 999 set to 1 if current player (when trigger worked out) is a player "here" and 0 if he is at other PC.

AI also has it always at 0. If flag 999 set, you can be sure that this is human and he is here. Flag 999 is working for all triggers.

H#1/$2/#3

Calculate and get numbers of heroes.

   $1 = owner (-1=current). See Format E1;

   $2 = start index of v variables to store info.

      v[$2] = number of heroes.

      v[$2+1] = number of first hero.

      v[$2+2] = number of second hero.

   #3  is an index of a hero the owner has.

      = 0 - store number of all heroes the owner has in v[#2]

      > 0 - index, store the number of a hero the owner has to v[#2] if there is no hero with index, the v[#2] is not changed.There is NO check or get syntax!

Example:

!!OW:H1/99/0; store a number of heroes the Blue player has to v99

!!OW:H1/100/1; store the number of the first hero the Blue player has to v100

!!OW:H1/100/2; store the number of the first hero the Blue player has to v100

!!OW:H1/100/3; store the number of the first hero the Blue player has to v100

!!OW:H1/100/4; store the number of the first hero the Blue player has to v100

I#1/$2

Set/check/get AI.

   #1 = Color (see Format E1);

   $2 = Controller,

      1 - AI,

      0 - Human.

Additional syntax:

I#1/$1/$2

   #1 = owner (see Format E1);

   $1 = AI/human;

   $2 = Player killed (1) or alive (0).

K#1/#2/$

Set/check/get the state of a keymaster tent.

    #1 = Owner (-1=current,0...7) (See Format E1);

    #2 = Keymaster number (0...7) (See Format BG);

    $ = Visited (1) or not (0).

Example:

!!OW:K3/4/1;

!!OW:K3/4/?v123;

N#1/$2

Check/get/(set) active town.

    #1 = owner (0...7, -1 = current);

    $2 = Town number (0...47, -1 = not chosen).

R#1/#2/$3

Set/check/get a resource.

    #1 = Owner (See Format E1);

    #2 = Resource type (See Format R);

    $3 = Resource value.

You can use a set style Ri/3/1000 or R3/j/d500... or get style Rj/5/?n.

In the latter case, the current value of the resource is not changed.

Owner may be -1 which means the current player R-1/.../...

R#1/7/$3

Set/check/get Mithril resource.

   #1 = Owner (See Format E1);

   #2 = Mithril;

   $3 = Quantity of Mithril.

T#1/$2

Set/Check/Get Alliance Team.

$1 = Color (See Format E1);

$2 = Team (0-6).

Set/check/get $2 Team for $1 Color (changes alliances).

Please note that if owner is neutral (value for object owner is -1), there is no need to get alliance team.

If however you do so, the resulted team number is shown as 0 (which in most cases is the same alliance number for human red player).

To check if owner of i.e. a castle is neutral use see CA Receiver.

V#1/$1/$2

Set/Get/Check heroes available to hire in tavern.

   #1 = owner (See Format E1);

   $1 = left hero to hire in a tavern (-1 = none);

   $2 = right hero to hire in a tavern (-1 = none).

Comments:

We cannot guarantee that all will work fine if you set one hero for several players (and as a second copy for one player). Hero that is set to be hired in a tavern will be temporary set as disabled one.

W#1/$1

Check/get/(set) number of towns owner controls (shown in town list).

   #1 - Owner (0...7,-1=current) (see Format E1);

   $1 - Number of Towns (0...47).

W#1/#2/$1

Check/get/(set) number of number of owner's town in the list.

   #1 - Owner (0...7,-1=current) (see Format E1);

   #2 - Town's number in the player's list (0...47);

   $1 - Town's number on the map  (0...47).


Options list for !!OW receiver
A#/$ Get/Check/Set active hero

C?$ Get/Check current player

D#1/#2 Set the number of days that a player remains in the game after losing his or her last town

G$1/$2 Check if a player IS a player that is sitting before the PC screen

H#1/$2/#3 Calculate and get numbers of heroes

I#1/$2 (I#/$1/$2) Set/check/get AI

K#1/#2/$ Set/check/get the state of a keymaster tent

N#1/$2Check/get/(set) active town

R#1/#2/$3 Set/check/get a resource

R#1/7/$3 Set/check/get Mithril resource

T#1/$2 Set/Check/get Alliance Team

V#/$1/$2Set/Get/Check heroes available to hire in tavern

W#/$Check/get/(set) number of towns owner controls (shown in town list)

W#1/#2/$3Check/get/(set) number of number of owner's town in the list


Buildings list (U Format)
Buildings common to all towns

Castle

Rampart

Tower

Inferno

Necropolis

Dungeon

Stronghold

Fortress

Conflux


Blessings and Curses Table

Curses	Image	Explanations and settings
1. Blinding.		Hero cannot explore anything around. Type=1.
2. One hero's slot occupied by a lock.		One hero's slot occupied by a lock. Type=2. Value=number of slot (-1=any).
3. No diplomacy.		No one monster will join the hero. Type=3.
4. Money loss.		Owner loses money daily. Type=4. Value=amount of gold to lose.
5. Resource bonus.		Get additional resources daily. Crystal, Gems, Mercury, Sulfur. Type=5. Value=amount of resources to get.
6. Loss of mana points daily.		Loss of mana points daily. Type=6. Value=points to lose.
7. Add of mana points daily.		Add of mana points daily. Type=7. Value=points to add.
8. Set scouting radius to 2.		Set scouting radius to 2. Type=8.
9. Add experience daily.		Add experience daily. Type=9. Value=exp to add.
10. Slow.		Slow. Type=10. Value=movements to lose.
11. not yet.
12. not yet.
13. not yet.
14. not yet.
15. Resource bonus.		Get additional resources daily. Wood. Type=15. Value=amount of resources to get.
16. Resource bonus.		Get additional resources daily. Ore. Type=16. Value=amount of resources to get.
17. Resource bonus.		Get additional resources daily. Gems. Type=17. Value=amount of resources to get.
18. Resource bonus.		Get additional resources daily. Mercury. Type=18. Value=amount of resources to get.
19. Resource bonus.		Get additional resources daily. Sulfur. Type=19. Value=amount of resources to get.
20. Resource bonus.		Get additional resources daily. Crystal. Type=20. Value=amount of resources to get.
21. Resource bonus.		Get additional resources daily. Gold. Type=21. Value=amount of resources to get.
22...63. Cannot visit an object on the map.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
23.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
24.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
25.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
26.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
27.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
28.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
29.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
30.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
31.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
32.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
33.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
34.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
35.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
36.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
37.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
38.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
39.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
40.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
41.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
42.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
43.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
44.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
45.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
46.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
47.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
48.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
49.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
50.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
51.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
52.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
53.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
54.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
55.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
56.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
57.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
58.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
59.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
60.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
61.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
62.		Cannot visit an object on the map. Type=22...63. The picture shows the object that cannot be visited.
63.		Not yet working.
64. Resource bonus.		Get additional resources daily. Wood, Ore. Type=64. Value=amount of resources.
65. Speed up.		Increase Hero's movement. Type=65. Value=movements to add.


Receiver !!PO

Options Additional information Legend

!!PO#1/#2/#3:XXXX

Used to set up or check information on any square of the map. Sets/checks the square at X, Y, Level coordinates.

!!PO$:XXXX

Alternative method to above. Uses indirect reference:

x=v[$], y=v[$+1], l=v[$+2]

Used to set up information for any square on the map. This receiver may be very useful if you want to control a number of heroes or players who visited any object last (for bonuses and such). Except for calculate, ALL of the categories (options) are for convenience only; they can ALL be used for any numbers and are simply a way to store information about a map location for later use.

Example:

!?OB63/3; for every *broken tower* on the map x=v998, y=v999, l=v1000

!!FU100:P; call function 100

!?FU100; function 100

!!HE-1:O?y1N?y2; y1=owner,y2=number

!!OB998:T?y3U?y4; y3=type of object,y4=subtype

!!PO998:Hy2Oy1Ty3Sy4; set owner, last visited hero, type and subtype of object

This way you may calculate all objects of particular type.

!!PO0/0/0:C63/3/0/-1/-1;

Now v1 has a number of objects type 63 and subtype 3 that was last visited by Orin (0) no matter what is his owner.


Options for !!PO receiver

Options list Legend

B#/$

Set/check/get a big integer value (-2147483648...2147483647).

You can use up to 2 values.

   # - index of the value to set (0...1),

   $ - value to set/check/get.

C$1/$2/$3/$4/$5

Calculate all objects.

   $1=type (-1=no matter);

   $2=subtype (-1=no matter);

   $3=hero (-1=no matter);

   $4=owner (-1=no matter);

   $5=user defined number (-1=no matter).

Result will be stored in v1.

H$

Set/check/get hero number (0...255).

O$

Set/check/get owner (-8...8).

N$

Set/check/get custom defined number (0...15).

T$

Set/check/get type of object (or any number) (0...255).

S$

Set/check/get subtype of object (or any number) (0...255).

V#/$

Set/check/get an integer value (-32768...32767).

You can use up to 4 values.

   # - index of the value to set (0...3),

   $ - value to set/check/get.

Comments:

All integer values in the ERM are big so if you store one with a command like this !!PO...:V1/y4; the value of y4 will be truncated in the internal PO storage (y4 itself remains unchanged), so you should make sure you have a correct value before setting this.


Options list for !!PO receiver
B#/$ Set/check/get a big integer value

C$1/$2/$3/$4/$5 Calculate all objects

H$ Set/check/get hero number

O$ Set/check/get owner

N$ Set/check/get custom defined

T$ Set/check/get type of object

S$ Set/check/get subtype of object

V#/$ Set/check/get an integer value


Additional information for !!PO receiver

A Little Explanation - Extract from mail By Timothy and Slava

Okay, first: you're referring to things in a way that's new to me. At least that's what it looks like.

!?OB63/3; for every *broken tower* on the map

x=v998, y=v999, l=v1000

In this example you use 63/3 as parameters. Before I left, the only way was with an X, Y, Level reference. So how do these new parameters work and what exactly do they mean? Is that object # and subtype? How does that work exactly?

Here is full description.

Trigger OB may have 3 styles:

   1. !?OB$1/$2/$3

   2. !?OB$1/$2

   3. !?OB$

Style 1: $1=X, $2=Y and $3=Level

Style 2: $1=Type of object and $2=Subtype (-1=all subtypes)

Style 3: $ =Type of object (subtype=-1)

If style 2 and style 1 or 3 fit the case, first will be executed all triggers of style 2 then style 1 or 3. Style 1 and style 3 will be executed as soon as found in script. Then when trigger of style 2 works out it will store the real position of the object in v[998]=X, v[999]=Y, v[1000]=Level. By the way these coordinates are stored for any triggers and receivers.

IMPORTANT: For all receivers (not only for OB) that must have a position of an object you can use a indexed position variables.

Example:

!!OB5/3/1:...

We can use also:

!!OB10:... 10 is an index of v vars that keep a position v10=X, v11=Y,

v12=Level

or

!!OBv11:... v11 keeps an index, so v[v11]=X, v[v11+1]=Y, v[v11+2]=Level

So here is a style of this type of receiver:

!!XX$:...

Style : XX - name of receiver

$= number of v var that keeps X, then Y and L values

v[$]=X, v[$+1]=Y, v[$+2]=Level

And why and what is x=v998 etc? Are these the variable locations that store the X, Y coordinates when using this reference in this manner? That's what it looks like (I think).

Yes.

Please pay attention to the next receiver !!PO:

You can use it to set up information for any square on the map.

Commands:

 H$ - set/check/get hero number (0...255)

What value is supposed to be returned if there's no hero there? 0? Or -1?

Well, this is not an actual hero number, this is just a place where you CAN store and then check/get/change a hero number. But you can use this in any way you want (this may be not a Hero at all).

O$ - set/check/get owner (-8...8)

Same question as above, what value if no owner and what are the negative numbers for?

Same answer :-) This is just a place to store something for this square. I propose it to use for a color (maybe + for bonus and - for penalty). But you can story there whatever you want.

N$ - set/check/get custom defined number (0...15) What do these represent exactly?

Absolutely any number.

T$ - set/check/get type of object (or any number) (0...255) What's returned if no object?

This is not a real object type. Again you can set it to any number and then use it.

S$ - set/check/get subtype of object (or any number) (0...255) What if there are no subtypes (or no object)?

The same.

C$1/$2/$3/$4/$5 - calculate all objects

What do you mean "calculate all objects"? Are you determining the number of them on the map somehow or what?

It goes over all map and find *fit* numbers that was set by you before. To delete a parameter from check (it may be any), use -1. So C1/2/0/-1/-1 means to calculate all squares where you set object type to 1, subtype to 2, hero number to 3 and all other values do not matter.

$1=type (-1=no matter)

$2=subtype (-1=no matter)

$3=hero (-1=no matter)

$4=owner (-1=no matter)

$5=user defined number (-1=no matter)

Result will be stored in v1

Syntax:

!!POx/y/l:... - direct reference

!!PO$:... - indirect reference

x=v[$], y=v[$+1], l=v[$+2]

Comments:

This receiver may be very useful if you want to control a number of hero or player who visited any object last (for bonuses and such).

Example:

!?OB63/3; for every *broken tower* on the map

x=v998, y=v999, l=v1000

!!FU100:P; call function 100

When does this happen? At the start when the map is first loaded? I'm not quite sure I understand.

It happens ONLY when you use a receiver for set values and get values. At map start for all squares Hero number set to 255, Owner set to -1 and other parameters set to 0.

!?FU100; function 100

!!HE-1:O?y1N?y2; y1=owner,y2=number

Okay...so, let's see... This gets the current hero's owner and hero # and stores them in y1 and y2.

!!OB998:T?y3U?y4; y3=type of object,y4=subtype

Here you're referencing something with 998? What is that #? It's not an X, Y, Level coordinate and it's not a standard object # and subtype is it? So what is it?

Right, because !?OB... set v998, v999 and v1000 to actual position of object.

Hmm... and then you're storing the object type and subtype in variables...that part makes sense at least.

!!PO998:Hy2Oy1Ty3Sy4; set owner, last visited hero, type and subtype of object. Still not sure what 998 refers to. So...you're setting all these? For what purpose? (See, I told you I'm confused by this!)

This way you may calculate all objects of particular type.

!!PO0/0/0:C63/3/0/-1/-1;

Now v1 has a number of objects type 63 and subtype 3 that was last visited by Orin (0) no matter what is his owner.


Receiver !!QW

Options Legend

!!QW:XXXX

Quest log controller.

Lets you add, remove or change an entry in the new Quest Log (Papyrus). This log is in addition to the standard Quest Log and does not replace it.

To access this log, a player must click on the Quest Log button in the Hero window. First the Papyrus log will appear (unless blank) and then by clicking the OK button, the standard Quest Log will appear after. The Adventure Map Quest Log button only brings up the standard Quest Log.

Comments:

You can use the quest log for any purpose, not just quests. It could be a diary that records interesting places the hero visits. Or you could use it to give a player hints at specific or random intervals or locations. It could even be used for humorous purposes if you wish to put little jokes in to make the player giggle.


Options list for !!QW receiver
A#1/#2/#3/$4 Add, change or remove an entry in the new Papyrus quest log


Options for !!QW receiver

Options list Legend

A#1/#2/#3/$4

Lets you add, change, or remove an entry in the new Papyrus quest log.

   #1 - a unique number you set for the the particular quest (set only);

   #2 - Hero number (See Format H),

      -1 = Current,

      -2 = Any (all heroes). Set only;

   #3 - Owner (See {Format E1}),

      -1 = Current,

      -2 = Any (all colors) Set only;

   $4 - index for Z variable containing quest text,

      -1 = Delete this quest (set/check/get).

Comments:

You can use a combination of #2=-2 and #3=-2:

#2=-2 and #3=owner - all heroes of this owner have this quest.

#2=hero and #3=-2 - this hero of any owner (if rehired) has this quest.

Quest text may be formatted.


Receiver !!TM

Options Legend

!!TM#:XXXX

This is for setting up timed ERM events.

   # = timer number (1-100).

This is the ERM equivalent for time events. It may be used to repeat any ERM code at regular intervals (or only once) and to start and stop at a specified time.

The TM receiver is used in conjunction with the TM Trigger (!?TM$), where $ from 1 to 100 is the number of the timer.

Comments:

•	Be careful if you enable one timer for several colours. If one of the timer receivers shows a message, you can get it twice or more times.

•	This command is almost always used as an instruction to set up the timer, rather than a  receiver (although it could be used as a receiver).

The TM Timer will not activate properly on the very first day when a map is played, so if you want ERM code (receivers) to do something on the very first day, it is better to link them to something else such as a local event or a day 1 general (timed) event.

Example:

We want to create a new object with ERM code. This object can only be visited once each week. How do we proceed?

In the object's code you can set a flag so that once it has been visited, it can't be visited again.

!#TM1:S1/999/7/player; timer will be called on every Day 1

!?TM1;

!!... Here you can reset the flag for the object so that it can be visited once again.


Options for !!TM receiver

Options list Legend

D$

Disable player colour $ to receive this timer. See Format E1.

E$

Enable player colour $ to receive this timer. See Format E1.

S$1/$2/$3/$4

Set/check/get timer set.

   $1 = the first day (activating);

   $2 = the last day;

   $3 = the interval (in days) of happening;

   $4 = colours to whom it will be applied (one bit is one colour, see Format E).

Example:

13=8+4+1 will set for Red, Brown and Green (0 will disable all colours).


Options list for !!TM receiver
D$  Disable player colour $ to receive this timer

E$  Enable player colour $ to receive this timer

S$1/$2/$3/$4  Set/check/get timer set


Receiver !!TR

Options Additional information Legend

!!TRx/y/l:XXXX

Set a Terrain type or change passability of a square at the specified X, Y, Level location.

Used to set terrain types or change passability of a square.


Options for !!TR receiver

Options list Terrain Types and Subtypes Legend

T$1/$2/.../$8

Set/check/get a terrain type.

   $1 - type of land;

   $2 - subtype of land;

   $3 - type of river;

   $4 - subtype of river;

   $5 - type of road;

   $6 - subtype of road;

   $7 - type of mirror (not yet);

   $8 - ??? (not yet).

V$

Set/check/get a visibility of a square (one bit - one color).

Comments:

This is similar to the UN:S and UN:H but for individual squares and you can check or get the value. Also, monsters have sight (1 hex)and this can be enabled or disabled -- they have a bit value number of 256.

P$

Set/check/get a passability of the square (red square).

   $ = 1 means passable;

   $ = 0 means not passable.

E$

Mark the square as an object entrance (yellow trigger square).

   $ = 0 means yellow trigger;

   $ = 1 means  no yellow trigger (1).


Options list for !!TR receiver
T$1/.../$8 Set/check/get a terrain type

V$ Set/check/get a visibility of a square

P$ Set/check/get a passability of the square

E$ Mark the square as an object entrance


Terrain Types and Subtypes

Content

1. Terrain types:

00		Dirt
01		Sand
02		Grass
03		Snow
04		Swamp
05		Rough
06		Subterranean
07		Lava
08		Water
09		Rock

2. Terrain subtypes:

Dirt		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-43	0...
	1...
	2...
	3...
	4...
Sand		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-23	0...
	1...
	2...
Grass		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-78	0...
	1...
	2...
	3...
	4...
	5...
	6...
	7...
Snow		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-78	0...
	1...
	2...
	3...
	4...
	5...
	6...
	7...
Swamp		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-78	0...
	1...
	2...
	3...
	4...
	5...
	6...
	7...
Rough		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-78	0...
	1...
	2...
	3...
	4...
	5...
	6...
	7...
Subterranean

		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-78	0...
	1...
	2...
	3...
	4...
	5...
	6...
	7...
Lava		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-78	0...
	1...
	2...
	3...
	4...
	5...
	6...
	7...
Water		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-33	0...
	1...
	2...
	3...
Rock		...0	...1	...2	...3	...4	...5	...6	...7	...8	...9
0-47	0...
	1...
	2...
	3...
	4...

3. River Types:

01	Clear
02	Icy
03	Muddy
04	Lava

4. River Configurations:

00, 01, 02, 03 - 4 styles of segment	+---+   ¦.+-¦   +---+
04 - segment:	+---+   ¦-+-¦   +---+
05, 06 - 2 styles of segment:	+---+   ¦---¦   +---+
07, 08 - 2 styles of segment:	+---+   ¦.¦-¦   +---+
09, 0A - 2 styles of segment:	+---+   ¦.¦.¦   +---+
0B, 0C - 2 styles of segment:	+---+   ¦---¦   +---+

5. Road Types:

01	Dirt
02	Gravel
03	Cobblestone

6. Road Configurations:

00,01,02,03,04,05 - 6 styles of segment:	+---+  ¦.+-¦  +---+
06, 07 - 2 styles of segment:	+---+  ¦.¦-¦  +---+
08, 09 - 2 styles of segment:	+---+  ¦---¦  +---+
0A, 0B - 2 styles of segment:	+---+  ¦.¦.¦  +---+
0C, 0D - 2 styles of segment:	+---+  ¦---¦  +---+
0E - segment	+---+  ¦.¦.¦  +---+
0F - segment	+---+  ¦.--¦  +---+
10 - segment	+---+  ¦-+-¦  +---+

7. Mirror Types

Bits: 76543210

--CcBbAa ('-' means no matter)

a - vertical mirror for land type (not for all land types)

A - horizontal mirror for land type (not for all land types)

b - vertical mirror for river type

B - horizontal mirror for river type

c - vertical mirror for road type

C - horizontal mirror for road type

More Explanations about mirror type

Say, this is:

This will be shown if you use mirror=0

Then set first bit (mirror=1). This will mirror the square vertical to:

Or set second bit (mirror=2). This will mirror the square horizontal to:

Or set both bit (mirror=3[2+1]). This will mirror the square h and v to:

The same about mirroring the river and road.

River h mirror=4

River v mirror=8

River both mirror=12[8+4]

Road h mirror=16

Road v mirror=32

Road both mirror=48[32+16]

You can combine all mirroring.

Say square mirror h, river mirror v and road mirror h and v mirror= 57[1+8+16+32]

8. Bit mask of accessability

mt: bit mask of accessability

Bits: 76543210

???E???P ('?' means no info)

P - passability

E - enrtance

These bits may be set individually by TR:P and TR:E commands.


Terrain Types and Subtypes - Content
Terrain types

Terrain subtypes

River Types

River Configurations

Road Types

Road Configurations

Mirror Types

Bit mask of accessability


Receiver !!UN

Options Additional Information Legend

!!UN:XXXX

Universal commands. These commands relate to changes on the heroes map.

Used for universal commands that make changes to the map and/or game.


Options for !!UN receiver

Options list Legend

A#/$

Set/check/get artifact enabling to appear on the map.

   # - artifact number (Format A1);

   $ - variable to set/get or check value,

      1 - artifact disabled,

      0 - artifact enabled.

A#1/#2/$

Get/check an artifacts info.

   #1 - Artifact number (Format A1);

   #2 - Type of info,

       =  1 - Cost,

       =  2 - Position on body (Format P2),

       =  3 - Type (artifact class: see below),

       =  4 - Number of combo artifact (Format CO),

       =  5 - Part of combo artifact (Format CO),

       =  8 - Gives spell or not,

       =  9 - Artifact name,

       = 10 - Artifact description;

   $ - Value.

Comments:

1.Cost: This value appears to be 1/5th the purchase price of an artifact from town Artifact Merchant if you possess no additional marketplaces. The Grail and new WoG artifacts all have an initial value of 0.

2. Position on body: If you place an artifact in an incorrect position with ERM it will still function the same way. For example, you can set Sandals of the Saint to work in the head slot instead of feet and when you equip them on your head, you get all the statistic bonuses (and lose them when you take the sandals off).

If a hero has an artifact already equipped and you change the position of that artifact type with ERM, the artifact will be left there (fully functioning) until you remove it; at that point you simply can't reequip it at that position.

3. Type: This value sets the class of artifact - no class, which includes spell books, war machines and the Grail (1), treasure (2), minor (4), major (8) or relic (16), which also includes combo artifacts and the three new WoG artifacts. Other values could probably be set as a way of making a type of custom class.

4. Number of Combo Artifact: Each combination artifact has a number that identifies it. The first one, Angelic Alliance, is number 0 and the last one, Cornucopia, is number 11. Non-Combo artifacts have a value of -1.

5. Part of a Combo Artifact: If the artifact is one that makes up a combo artifact, it will have the combo artifact number here. For any artifact that isn't part of a combo (including combo artifacts themselves), it will have a value of -1 instead.

8. Gives spell: This is set to 0 for most artifacts and 1 for artifacts like tomes, Spellbinders Hat, Sea Captain's Hat -- basically anything that gives you an additional spell. There's currently no way of checking which spells are added, however, short of comparing all spells a hero knows before and after picking up the artifact, nor any way to set the spell given by the artifact.

Setting this value to 0 (if it's normally 1) stops you getting the spells from the artifact. This is a neat way to disable these types of artifacts but still let them appear on the map and be equipped -- good for making artifacts with new abilities but not the old ones.

9. Artifact Name: This lets you set a new name for the artifact. $ is the index number of a z variable in which you've stored a new name for the artifact. A value of 0 restores the original name. A neat trick is to change the name and description of an artifact just prior to displaying it in a dialogue box -- this lets you make use of any of the artifact pictures for other display purposes.

10. Artifact Description: This lets you set a new description for the artifact. $ is the index number of a z variable  in which you've stored a new description for the artifact. A value of 0 restores the original description.

B

Remove a description/hint for an object.

B#/$

Set operation or new chests and Mithrill.

   # - Type,

      0 - Mithrill,

      1...4 - new chests;

   $ - Operation (0-standard,1-advanced);

The new Chests:

 Type 101 Subtype 1

 Type 101 Subtype 2

 Type 101 Subtype 3

 Type 101 Subtype 4

 Type 101 Subtype 5

 Type 101 Subtype 6

The new ressource:

 Mithrill, Type 79 Subtype 7

Comments:

For all new chests (type 101, subtype 1...4) standard operation means a standard Treasure Chest. Extended gives nothing to a visiting Hero (assumed that all is defined through the ERM). In both cases, the chest will disapear after being taken.

For Mithrill (type 79, subtype 7) standard operation means that when you (or AI) pick it up, you will have one of random type of resource (except wood or ore) and quantity that is set up for the stack in the map editor (for gold will be *100). Extended operation means that Mithrill will be added to to Mithrill stock of the player and you can check and set it with

UN:R#/7/$.

Both works for human or AI. AI treat Mithrill as a gold when decide to pick it up or not.

C$1/$2/$3

Set/get/check memory.

   $1 - memory address;

   $2 - 1,2,3 or 4 - size of data in bytes;

   $3 - data.

D#1/#2/#3

Make a square of water passable for hero.

   #1 - X;

   #2 - Y;

   #3 - Level.

Comment:

The square is impassable for boat.

D#1/#2/#3/$

Additional syntax for D commands: Place/remove path (logs) over water.

$ means place (1) or remove (0) passability.

E#1/#2/#3

Check where to place an object.

   #1 - X;

   #2 - Y;

   #3 - Level.

We added the check if the place is available to place a one square object.

Receiver UN, command E#1/#2/#3 in form Ex/y/l.

As a result the flag 1 will be set to YES (1) if available. It does not mean that you cannot use this command to check if the place is ready to place a bigger object (more than 1x1). But you should check at least a *accessible point* (the enter or the yellow square in the editor). The entrance must not be overlapped each other.

F$1/$2/$3/$4/$5

Provoke a fire (if possible).

   $1 - X;

   $2 - Y;

   $3 - Level;

   $4 - dX;

   $5 - dY.

Comments:

I just wanted to check out the Fire-function. I used this script. There are only Oak Trees, no stones, mountains or anything else. So, the ERM-help says "when it`s possible", but when is it?

This is possible only for one object now. Go to the map editor -> castle section -> the latest element.

If you place this tree on the map, it starts to fire as you could see this with Gorynych's town.

We want to have more objects like this (more trees) but we have no ready. We can make a dynamic animation like burning trees, flooding and anything else. All is ready but we have no objects.

G0/#1/#2/$3

Set secondary skill text.

   #1 - is a skill number (0...27);

   #2 - is a type of text (0...3),

         0 = name of skill,

         1 = basic level description,

         2 = advanced level description,

         3 = expert level description;

   $3 - is a number of z vars (1...1000) or 0,

         0 = means to restore original text.

Comments:

All is similar to artifacts.

You should set z vars to correspondent text (you can use only global z vars z1...z1000).

Then set the the text.

If you change the text in this used z var - it will immediately appear as a new text for this skill. So do not use this var for other tasks.

Example:

!#VRz10:S^My new Name^;

!#VRz11:S^My new Basic Description^;

!$LE7/5/0;

!!UN:G0/2/0/10;

!!UN:G0/2/1/11;

!$LE8/5/0;

!!UN:G0/2/1/0;

It will set the Logistic skill name and description to the new texts if you visit a local event at 7/5/0. The description of the basic level of the Logistic vill be restored if you visit a local event at 8/5/0.

G1/#1/#2/$

Change Monster names.

   #1 - Number of Monster;

   #2 - Type of text,

         0 = Singular name,

         1 = Plural name,

         2 = Specialty text;

   $ - z variable (or its number) that keep the new text,

         0 = means restore original.

G2/#1/#2/#3

Let you set the text and picture for hero specialities.

   #1 - number of hero;

   #2 - set,

         2 - if description text,

         3 - if picture;

   #3 - is:

         - z variable index (0 to restore) if #2=2,

         - number of the picture (0-155) if #2=3.

The pictures match the current hero specialty pictures so for example, if you wanted a picture of gems, you could use 111 (Saurug's specialty) for the picture number. In the future, additional specialty pictures will be added.

H#1/#2/#3/#4/#5

Hide part of the map (round area).

   #1 - X;

   #2 - Y;

   #3 - Level;

   #4 - Owner;

   #5 - Radius.

I$1/$2/$3/$4/$5

Place an object.

   $1 - X;

   $2 - Y;

   $3 - Level;

   $4 - Type of object (see Format OB);

   $5 - Subtype of object.

This command is very powerful but must be used cautiously. Some objects will appear properly set up. Others must be set up using their specific object receiver or in some cases the generic !!OB receiver, and still others will not work at all and may make the game unstable. See below for a detailed list.

I$1/$2/$3/$4/$5/$6

Additional syntax for placing objects:

   $6 - Redraw,

        1 - Redraw immediately (slower),

        0 - Does not redraw (faster).

Comments:

For all previous syntaxes the screen will be redrawn.

I#1/#2/#3/#4/#5/#6/#7/#8

Advanced syntax for placing objects:

   #1 - X;

   #2 - Y;

   #3 - Level;

   #4 - Type of object (see Format OB);

   #5 - Subtype of object;

   #6 - Type of object (see Format OB);

   #7 - Subtype of object;

   #8 - Terrain (see Format T);

This means that there will be placed an object type/subtype but it will look like object type2/subtype2.

J0/#/$

Disable spells.

   # - number of spell 0...69;

   $ - enabled/disabled:

       0 = Enabled,

       1 = Disabled,

Comments:

This disabling only works for mage guilds and pyramids, but you can check the value set here and use in any ERM script. Since mage guild and pyramid spells are set at the start of a map (before it fully loads), it makes sense to use this command in an instruction or in a function called from an instruction.

There is another internal structure that is changing when shrines are being placed (every placed shrine marks a corresponding spell as disabled), so for shrines, this disabling will not work. However, you could set a disabled spell and then disable it in the shrine with a shrine receiver after checking the value with this command.

K#/$

Set up *new week* property.

   K1/$ - disable ($=1) all *week of ...* (monster +5, Imp*2) or enable ($=0) as usual;

   K2/$ - set up the message of new week to string variable $.

Note:

It wont disable weeks/months generated by Deities of Fire- imps/familiars will get extra growth and be spawned all over the map regardless.

L#1/#2/#3/#4

Move a view to the position.

   #1 - X;

   #2 - Y;

   #3 - Level;

   #4 - delay after (1000 is a second?).

Comments:

It work like Eye of the Magi but do not open a view.

L#1/#2/$

Set/check/get Obelisk visited.

   #1 - player number (-2,-1,0...7),

      -2 = to all,

      -1 = to current;

   #2 - Obelisk index (-1,0...47),

      -1 = to all;

   $ - Obelisk visited (1) or not (0).

M#/$

Set new "Month of the" properties.

M0 - original behavior;

M1 - disable weeks of monster*2 and all/2;

M2/$ - set up a week of $ monster (monster*2);

M3 - set up a week of plague (all/2).

 * 2nd parameter ($) only applies to M2.

Note:

It wont disable weeks/months generated by Deities of Fire- imps/familiars will get extra growth and be spawned all over the map regardless.

N#/$

Name Lookup.

This command lets you get the name of an artifact, spell, building, monster or secondary skill by specifying its number and assign it a z string variable so you can use it in a message.

   N0/z var index/$; - name of artifact ($=number);

   N1/z var index/$; - name of spell name ($=number);

   N2/z var index/$1/$2; - name of building ($2) inside town type ($1);

   N3/z var index/$1/$2; - name of monster ($1) in singular ($2=0) or plural ($2=1);

   N4/z var index/$; - name of secondary skill ($=number).

Example:

!#UN:N0/z100/5;

!#UN:N1/z101/6;

!#UN:N2/102/7/1;

!#UN:N3/103/8/0;

!#UN:N3/104/8/1;

!#IF:M^=%Z100=%Z101=%Z102=%Z103=%Z104=^;

O$1/$2/$3

Delete an object.

   $1 - X;

   $2 - Y;

   $3 - Level.

Comments:

In both cases X, Y and Level mean a right down corner of the object.

O$1/$2/$3/h

Additional syntax to delete an object.

Delete object at X/Y/Level and a description/hint (if was set).

   h = 1 - delete description/hint;

   h = 0 - do not delete.

For the style O$1/$2/$3 description/hint will not be deleted (h = 0).

P$

Set behaviour for lvl8 dwellings.

   $ = 1 - standard behaviour for lvl8 dwellings ( = 0 - as usual).

Comments:

Standard behaviour means that the level 8 dwelling will function like any other dwelling in the game, so you must visit it each week to recruit level 8 creatures there and they won't appear in the upgraded level 7 dwelling for the associated town.

P#/$

Set WOG options.

   # - Number of option;

   $ - Option state.

Parameters values:

•	# = 0 and $ = Lvl8 dwelling SoD (1) or WoG (0) [doubling for !!UN:P$];

•	# = 1 and $ = Towers Experience SoD (1) or WoG (0);

•	# = 2 and $ = Leave Monsters on the map SoD (1) or WoG (0);

•	# = 3 and $ = Disable Commanders (1) or Enable Commanders (0). Now if a map has internal scripts and does not have !#UN:P3/# command, the map is running in WoG 3.56 environment (without Commanders and all). But if the map has this command (no matter !#UN:P3/0 or !#UN:P3/1), the map is treated as a new one and runs in WoG 3.57 environment (so all hard coded WoG features are taken from WoGification setup or installed by !#UN:P instructions). This will fix the problem with impossibility to enable Commanders with !#UN:P3/0 instructions unless used in the timer trigger section.

•	# = 4 and $ = Disable Town Demolition by a player (1) or Enable Town Demolition by a player (0);

•	# = 5 and $ = WoGify: random maps and maps beginning "wogify_" (0), all WoG format maps (1), all Heroes 3 maps of any format (2);

•	# = 6 and $ = Heroes start with Commanders (0) or they must be hired (1);

•	# = 7 - Dwelling accumulation enabling /disabling. New hardcoded flag to make all external dwellings accumulate creatures every week. You can turn it on !#UN:P7/1; or off !#UN:P7/0; (default).

  $ = 0 - creature dwellings reset start of each week,

  $ = 1 - creature dwellings accumulate unpurchased creatures from week-to-week;

•	# = 8 - Guards accumulation enabling/disabling. New hardcoded flag to make all external dwelling guards accumulate creatures every week. You can turn it on !#UN:P8/1; or off !#UN:P8/0; (default).

  $ = 0 - creature dwellings with guards keep the same number of guards,

  $ = 1 - creature dwellings with guards accumulate undefeated guards from week-to-week.

Comments:

Both WoGified and Non-WoGified WoG maps with no scripts will use the WoGify Options selected for enabling or disabling the features above.

Non-WoGified WoG maps with scripts will have Commanders disabled by default. To enable them, you must use !!UN:P3/0 after the map has started. Putting this command into an instruction (!#UN:P3/0) will NOT enable Commanders on these maps.

To set Commanders so they must be hired at a town for 100 gold instead of heroes automatically starting with them, you must use UN:P6/1 before the UN:P3/0 command. You can put this all into one line as:

!!UN:P6/1 P3/0; if you wish.

Q#

Win or lose the game for CURRENT player.

   # = 0 to lose the game;

   # = 1 to win.

R#

Redraw the screen.

   # = 1 - redraw map, heroes screen and chosen hero screen (all at right side).

   # = 2 - redraw status line with resources.

R3/#

Redraw the hero Screen inside CM2 Trigger.

This command only works in a CM2 trigger while the hero screen is displayed. Trying to use it elsewhere will cause a game crash. You can redraw the screen with every mouse click if you need to update it. e.g. if you change a hero's skills or picture while the hero screen is displayed.

   # is a hero number (-1 = current).

S#1/#2/#3/#4/#5

Open (show) part of the map (round area).

   #1 - X;

   #2 - Y;

   #3 - L;

   #4 - Owner;

   #5 - Radius.

T#1/#2/#3/$

Set a type of monster to hire in towns.

   #1 - type of a town (0...8);

   #2 - dwelling level (0...7);

   #3 - basic (0) or upgraded (1);

   $ - type of monster to hire.

Comments:

- It works only in Towns and for AI as well. You can set it with !#UN. Do not forget that you can "force" AI to prefer hiring of one monster to another by setting "AI Value" parameter for monster by !!(#)MA:I.

- Additional resources supposed to be only for level 7 dwelling.

U#1/#2/?$1

Calculate all objects on the map.

   #1 - type of object;

   #2 - subtype of object (-1 = any);

   $1 - number of objects of type #1, subtype #2 (check or get syntax only).

Example:

U54/i/?n

n now have a number of objects type 54 and subtype i.

U#1/#2/#3/#4

Get coordinate of object.

   #1 - type of object;

   #2 - subtype of object (-1 = any);

   #3 - number of object (1...full numbers);

   #4 - v var to store the coords: v[#4]=X, v[#4+1]=Y, v[#4+2]=Level.

Example:

U54/i/3/324; v324,v325 and v326 now keep coordinates of object type 54, subtype i and number 3

Comments:

All objects are calculated:

1) left to right.

2) up to down.

3) ground to undeground.

V?$1/?$2

Gets the version of WoG and ERM being used.

   $1 - version of WoG (now 352 as 3.52);

   $2 - version of ERM (now 210 as 2.10).

Comments:

You can only get or check but not set the values:

e.g., !!UN:V?i/?j;

Recommendation:

Use the instruction !#UN:V to check a version and then display a message for the player at the start of the map that they have an older version of the Addon. This is better then them getting half way through the map before finding out they can't finish it.

V?$1/?$2/?$3/?$4/?$5

Gets the version of WoG and ERM being used, additional syntax.

   $1 - Get or check the WoG version;

   $2 - Get or check the ERM version;

   $3 - Get or check "one or more humans" in the game,

      = 1 for one human,

      = 2 for more than one human;

   $4 - Get or check "one or more PCs" in the game,

      = 0 for one PC (no net),

      = 1 for more than one PC (net);

   $5 - Get or check type of the game,

      = 0 - Single Player,

      = 1 - IPX,

      = 2 - TCP/IP,

      = 3 - Hot Seat,

      = 4 - Direct Connect,

      = 5 - Modem.

W#1/#2/#3/#4/#5

Make a "line" of water passable for hero.

   #1 - X1;

   #2 - Y1;

   #3 - X2;

   #4 - Y2;

   #5 - Level.

Comment:

This line is impassable for a boat. This is a line so be careful when using it.

W#X1/#Y1/#X2/#Y2/#L/#1

Additional syntax for W in UN receiver. Place/remove path (logs) over water.

   $ means place (1) or remove (0).

X?$1/?$2

Get a size of map.

   $1 will receive the size of the map (X=Y);

   $2 will be 0 if you have one level and 1 if you have two levels.

You can only GET or CHECK values but not SET them.

Example:

!#UN:X?i/?j;

!#VRz1:S^only one level^; !#VRz1&j=1:S^two levels^;

!#IF:M^Map is X=%Vi by Y=%Vi and has %Z1.^;


Options list for !!UN receiver
A#/$Set/check/get artifact enabling to appear on the map

A#1/#2/$ Get/check an artifacts info

B Remove a description/hint for an object

B#/$ Set operation or new chests and Mithrill

C$1/$2/$3 Set/get/check memory

D#1/#2/#3 Make a square of water passable for hero

E#1/#2/#3 Check where to place an object

F$1/.../$5 Provoke a fire

G0/#1/#2/$3 Set secondary skill text

G1/#1/#2/$ Change Monster names

G2/#1/#2/#3 Set the text and picture for hero specialities

H#1/.../#5 Hide part of the map

I$1/.../$5 Place an object

J0/#/$ Disable spells

K#/$ Set up *new week* property

L#1/#2/#3/#4 Move a view to the position

L#1/#2/$ Set/check/get Obelisk visited

M#/$ Set new "Month of the" properties

N[0,1,2,3,4]/z Name Lookup

O$1/$2/$3 Delete an object

P$ Set behaviour for lvl8 dwellings

P#/$ Set WOG options

Q# Win or lose the game for CURRENT player

R# Redraw the screen

R3/# Redraw the hero Screen inside CM2 Trigger

S#1/.../#5 Open (show) part of the map

T#1/#2/#3/$ Set a type of monster to hire in towns

U#1/#2/($1) Calculate all objects on the map

U#1/#2/#3/#4 Get coordinate of object

V?$1/.../?$5 Gets the version of WoG and ERM being used

W#1/.../#5 Make a "line" of water passable for hero

X?$1/?$2 Get a size of map


Additional information for !!UN receiver

Comments list

Placing Objects

These objects should work correctly without additional set up.

Many may be customized with a specific object receiver if desired.

Artifacts (type=5, subtype=0-143) - Receiver: !!AR

Boats (type=8, subtype=0-2)

Creature Generators (type=17, subtype=0-88 and 20, subtype=?) - Receiver: !!DW

Garrison (type=33, subtype=0 for standard, =1 for anti-magic) - Receiver: !!GR

Grail (type=36, subtype=0)

Lighthouse (type=42, subtype=0-7 for player colours or -1 for neutral)  - Receiver: !!MN (same as for mines)

Marletto Tower (type=23, subtype=0)

Monolith Two Way (type=45, subtype=0-7)

Mine (type=53, subtype=0-7) - Receiver: !!MN

Monster (type=54, subtype=0-144) - Receiver: !!MO

Ocean Bottle (type=59, subtype=0) - Receiver: !!SG (same as for signs)

Redwood Observatory (type=58, subtype=0)

Resource (type=79, subtype=0-6) - Receiver: !!AR (same as for artifacts)

Sanctuary (type=80, subtype=0)

Shipyard (type=87, subtype=0-7 for player colours or -1 for neutral)  - Receiver: !!SY

Sign (type=91, subtype=0) - Receiver: !!SG

Spell Scroll (type=93, subtype=0-69) - Receiver: !!AR

Town (type=98, subtype=0-8) - Receiver: !!CA

University (type=104, subtype=0) - Receiver: !!UR

Witch Hut (type=113, subtype=0-27) - Receiver: !!WH

These objects will probably need additional set up with their specific object receiver to work correctly:

Campfire (type=12, subtype=0) - Receiver: !!FR

Corpse (skeleton) (type=22, subtype=0) - Receiver: !!SK

Event (type=25, subtype=0) - Receiver: !!LE - if placed with I option, this event will initially be set as enabled to all players and will not be cancelled after the first visit.

Lean To (type=39, subtype=0) - Receiver: !!LN

Learning Stone (type=100, subtype=0) - Receiver: !!ST

Magic Shrine (type=88,89,90, subtype=0) - Receiver: !!SR

Magic Spring (type=48, subtype=0) - Receiver: !!SP

Mystical Garden (type=55, subtype=0) - Receiver: !!GD

Obelisk (type=57, subtype=0) - Receiver: !!MT

Scholar (type=81, subtype=0) - Receiver: !!SC

Swan Pond (type=14, subtype=0) - Receiver: !!SW

Treasure Chest (type=101, subtype=0) - Receiver: !!CH

Tree of Knowledge (type=102, subtype=0) - Receiver: !!KT

Wagon (type=105, subtype=0) - Receiver: !!WG

Warrior's Tomb (type=108, subtype=0) - Receiver: !!WT

Water Wheel (type=109, subtype=0) - Receiver: !!WM

Windmill (type=112, subtype=0) - Receiver: !!ML

These objects will NOT work properly and may possibly cause game instabilities, map crashes or other problems if placed:

Pandora's Box (type=6)

Hero (type=34)

Prison (type=62)

Seer's Hut (type=83)

Quest Guard (type=215)

Other Objects

Some other objects not listed above (aside from rocks, trees, etc.) may need to be set up with the generic object command; you can try changing their control number so as not to duplicate an existing object of the same type, but this is by no means guaranteed to work. Also, some objects not listed may actually work fine with no set up required--but they have not been tested yet. Proceed at your own risk.

About deleting objects

There are several tables for every object on the map. And cross reference links not always exist. Usually the Heroes use a way to find for positions. When you delete an object, some tables still are the same (keep info about deleted object). If then you add a new object of the same type at the same place, the new info is also added to those tables. But then when the game need to get info about this new object, it starts to search it in the table by position. Obviously, that the info for the first (deleted) object will be found first. This is not very good :-( Good that we know it now. And Donald's proposition to set up an old object before deletion look fine. I still recommend both set up an old object, delete it, place a new one and set it up again :-)

Remember that this problem is possible for objects of the same type and not every type.


List of coments for !!UN receiver
Placing Objects

Other Objects

About deleting objects


Receiver !!VR

Options Legend

!!VR@:XXXX

Management of variables.

Used for managing variables (setting, comparing and doing math with them). Check the bottom of this section for notes on comparing game parameters and variables. Please also look at the {Flags and Variables section.} Some information is redundant but understanding Variable and Flag management is essential.

All numeric variables are integer variables and have a range of -2147483647...+2147483647

   a not yet used

   b not yet used

   c stores today value (game active day number)

   d adds or subtracts values from variables

   e1..e100 Function floating point variables

   'f' through 't': Standard variables (former known as quick variables)

   v1 through v10000: Standard variables

   w1 through w100: Hero variables

   z1 to z1000: String variables

   x1 through x16: Function parameters

   y1 through y100: Function local variables

   z-1 through z-10: Function local string variables

You can use conditional flags as usual.

Example1:

!!VRv10&5/-3:S15;

Example 2:

!!VRv10:Sc; [v10 stores the game active day number]

How to check a variable?

Usage:

- to set value of the variables use "?VarName". May be used everywhere that you can use a comparison operation (<,=,>).

- to use value of the variable use "VarName" instead of a number.

Example1:

!!IF&v100=v1000/v100=5:...;

!!HE-1:P?v100/?v1000/0;

Example2:

!?LE3/3/0;

!!HE3/3/0:P?i/?j/?k; // store current position (3,3,0) in i,j and k

!!HE3/3/0:P7/5/0; // jump to 7,5,0

!!HE7/5/0:Pi/j/k; // jump back to i,j,k (3,3,0)

Here is the example of VR usage:

!!VRi:S10+90:5-3;

!!IF:M^Variable i=%Vi.^;

In a result you will get the message: "Variable i=17."

To compare the game parameter to a particular value you can use the following way: ...[compare operator] value... The result of comparing is stored to Condition Flag 1. You can use its value for further ERM

Instructions and Example:

!!GE100:F5	Set first day to 5 for Time event (standard syntax)
!!GE100:F=5	Check if first day is 5 and set Cond.Flag1 (CF1)
!!GE100:F<>5	Check if first day is NOT 5 and set Cond.Flag1 (CF1)
!!GE100:F><5	The same as above
!!GE100:F>5	Check if first day is greater than 5 and set CF1
!!GE100:F>=5	Check if first day is greater or equal to 5 and set CF1
!!GE100:F=>5	The same as above
!!GE100:F<5	Check if first day is below than 5 and set CF1
!!GE100:F<=5	Check if first day is below or equal to 5 and set CF1
!!GE100:F=<5	The same as above

How to use a Hero's W variables:

To use the w variables, you first have to use an !!IF command to specify which hero they will apply to (use -1 for current hero). Once you've done this command, you don't have to use it again until you switch to another hero (or if you don't know in advance which hero it will apply to). Use this command before setting, testing, or checking a w variable. So if you wanted to use w variables with hero #147 (Dracon), the command would be:  !!IF:W147;

Then you could set the w1 variable in exactly the same way that you would set any other variable (see example below).

You have 1 object and 1 event. If the hero has visited the object, the event will

recognize it.

Okay, let's say the object is a Magic Well located at x=10,y=15,level=0.

Let's say the event is located at x=27,y=18,level=0.

ZVSE

!?OB10/15/0;

!!IF:W-1;

!!VRw1:S1;

!?LE27/18/0;

!!IF:W-1;

!!IF&w1=0:M^Perhaps you should visit the Magic Well to the west for I desire water!^;

!!IF&w1=1:M^You have brought me water from the Magic Well! I will reward you!^;

How can I get the actual day?

It is easy.

!!VRv123:Sc;

Modifier 'c' work the same way as 'd' but add "the current day".

You can add current day to any other value.

!!HE-1:Fcd/c/1/2;

Add to attack of a hero current day, set defense to current day.

Tips on generating random numbers

Let's say you want to generate a number from 1-100, but not 42, 81, or 99.

That's 3 missing numbers, so generate a random number from 1 to 97. Then if it's 42 or greater add 1. Then if it's 81 or greater add 1. Then if it's 99 or greater add 1. You now have a random number, with equal probability for each result, that's 1-100, but not 42, 81, or 99.

You can obviously exclude a range at a time and so on. It takes one line per exclusion, which is what your recursive method takes. Only it's faster and not recursive.

- So if you want a number from 1-100 excluding 10-19 and 73, you generate a number from 1-89, then if it's 10 or greater add 10, then if it's 73 or greater add 1.

- Let's use the same method to generate a number from 1-10, but not 6. So we generate a number from 1-9, and if it's 6 or greater, add 1.

Number from 1-9 -

  1 2 3 4 5 6 7 8 9

If 6 or greater add 1 -

  1 2 3 4 5 7 8 9 10

Each number has the same odds.


Options for !!VR receiver

Options list Legend

Commands with variable

C$1/$2/.../$16

Set/check v vars.

   $ - v variables that is first in sequence;

   $1 - set/check a first ($) v variable;

   $2 - set/check a second ($+1) v variable;

   $3 - set/check a third ($+2) v variable;

...

!!VR$:C$1/$2/$3... up to 16 parameters.

Example:

!!VRv123:C23/v15/?i/y4;

Result:

v123=23, v124=v15, i=v125, v126=y4

Example by Donald:

Remember we have the VR:C command to define tables; it's a much cleaner way to do stuff like look up a spell number. So for example:

!!VRv600:C0/3/5/15/27/31/32/35/37/41/42/43/46/53/54; [table of 1st level spell numbers]

!!VRy1:S600 R14; [random # 600-614]

!!VRvx16:Svy1; [now vx16 is a random 1st level spell #]

Rx

Generate a random value from 0 to x (including) and ADD this to the current value.

Example:

!!VRi:R25... will generate a random value from 0 to x (including) and ADD this to the current value.

S#

Set var @ to # (now and below # may be another var by name).

T$

Generate a random value from 0 to $ and add this to the current value of the variable.

Random valor based on time value. Better to use it.

Comment:

Also, for those of you using VR:T to generate random numbers: if you generate more than one number at once, they'll all be the same. So use VR:R in those situations. T is a time based command. And if they both meet at one command line it is too little delay between them and as a result the values are the same.

Comparaison of variable

&$

  AND:

  1 and 1 = 1

  0 and 1 = 0

  1 and 0 = 0

  0 and 0 = 0

|$

  OR:

  1 or 1 = 1

  0 or 1 = 1

  1 or 0 = 1

  0 or 0 = 0

X$

  XOR:

  1 xor 1 = 0

  1 xor 0 = 1

  0 xor 1 = 1

  0 xor 0 = 0

Example:

   OR:      AND:      XOR:

  1100      1100      1100

  1010      1010      1010

  ----      ----      ----

  1110      1000      0110

Comments:

!(!|?|#)XX&c1/c2/c3|c4/c5/c6:...;

Full condition is: (c1 AND c2 AND c3) OR c4 OR c5 OR c6.

- OR section may be alone or only after AND section;

- if there is only OR section, full condition will be true if at least one OR condition is TRUE;

- there may be up to 16 AND conditions and up to 16 OR conditions.

Arithmetic operation with variables

+#

Add # to the var.

-#

Subtract # to the var.

Example:

!!VRi:-1; subtract -1 from i.

*#

Multiply the var by #.

:#

Divide the var by # (do not div by zero - you will get an error msg).

%#

Set the var to the reminder from division by #.

Commands with string variable

!!VRz#

We have string variables: z1...z500. Here is all changes for using string variables.

H#

Check whether a z variable keeps empty string or not.

# is a number of flag to store the result,

  =1 if there is a text,

  =0 if string is empty.

All signs like Space, NewLine, CridgeReturn, Tabulation are skipped and treaten as a NO characters.

Example:

!!VRz100:S^Hello!^;

!!VRz101:S^^;

!!VRz102:S^ ^;

!!VRz100:H300; flag300=1

!!VRz101:H301; flag301=0

!!VRz102:H302; flag302=0

S^TEXT^

Set current string variable to ^TEXT^ (text may be formatted).

S#

Copy string variable # to current string variable.

Show variable inside string or message

%Vf...%Vt

Show *quick* variable.

%V1...%V1000

Show common variable.

%W1...%W100

Show hero's variable.

%X1...%X16

Show parameter.

%F1...%F1000

Show an ERM flag value.

%Y1...%Y100

Show local variable.

Concatenation of string

+#

Concatenate string variable # with current string (add to the end).

+^TEXT^

Concatenate string variable # with current string (add to the end, text may be formatted).


Options list for !!VR receiver
Commands with variable

Comparaison of variable

Arithmetic operation with variables

Commands with string variable

Show variable inside string or message

Concatenation of string


Lessons list
Creating a *Creature Bank*

Making a *Magical Singing Rock*


Miscellaneous object receivers

Objects list

Many of the map objects have their own specific receivers that can be used to change, set up or check or store (in variables) their properties. No check for the object's existence is made at map startup, but one is made when the command is executed. When you see the "Number" of the object, that means that you can set the number of this object from 0 to 31. This number is used when hero visits the object as a check value (visited/not).

Comments:

In most cases it is inadvisable to try to set up objects using an immediate instruction (!#) at map startup rather than using a standard receiver that follows a trigger. This is because these object setup commands often don't work as immediate instructions, or worse, will cause the map to crash.

Now you can not only set but also get the string parameters. You can use it when M command is used to set name/message.

Example:

!!IFv10:S5;

!!SG4/3/0:M1/v10; set sign message to string var z[v10] or z5

!!SG4/3/0:M1/?z10; get current sign message to z10 string var

Be careful: don't use OB command with an object with 2 entrance (yellow case).

When you place an object, it will set up only first right bottom entrance square that will be met. Then you should manually copy a control word from that square to all other yellow squares of this object.

How I check if AI visit objects?

When any hero visits an object the AI flag is stored in flag1000. So you can use it like here:

!?OB...;

!!IF&1000:M^Player^;

!!IF&-1000:M^AI^;

!!MN#1/#2/#3:XXXX

Mine  at X, Y, Level (#1, #2, #3) coordinates. Mines are Types 53 and 220.

Options:

•	O$ - Set/check an owner,

     0...7 = See Format E1,

     -2 = current player,

     -1 = nobody's.

•	O$/1 - the same as MN:O$ but without redrawing.

•	R$ - Set/check produced resource type (0...6). See Format R.

•	R$/1 - the same as MN:R$ but without redrawing.

•	M#1/$2/$3 - Change/check guards,

   #1 - Number of slot (0...7),

   $2 - Monsters type (-1 means free slot). See Format C,

   $3 - Number of Monsters.

Comments:

You can't set guards on a mine that doesn't have an owner unless the mine is an abandoned mine.

Note:

If someone wishes to loop through all mines, (s)he should use the "no redraw" option, or else the loop will take longer than other, comparable loops (for example, a loop through all heroes).

!!SC#1/#2/#3:XXXX

Scholar  at X, Y, Level (#1, #2, #3) coordinates. Scholars are Type 81.

Options:

•	T$ - Type of bonus,

     0 = primary skill,

     1 = secondary skill,

     2 = spell.

•	P$ - Primary skill index. See Format PK.

•	S$ - Secondary skill index. See Format SS.

•	L$ - Spell index. See Format SP.

!!CH#1/#2/#3:XXXX

Treasure Chest  at X, Y, Level (#1, #2, #3) coordinates. Treasure Chests are Type 101.

Options:

•	S$ - Type of bonus,

     1 = Artifact,

     0 = Gold / Experience.

•	A$ - Artifact number (Format A1).

•	B$ - Bonus as gold/experience to $, $ may be 0...15,

     gold = $*500,

     experience = $*500-500.

If $ = 0, that means that you get 0 gold and -500 exp.

As you can see, you can give a hero up to 7500 gold or 7000 exp.

!!WT#1/#2/#3:XXXX

Warrior's Tomb at X, Y, Level (#1, #2, #3) coordinates. Warrior's Tombs are Type 108.

Options:

•	A$ - Artifact number (Format A1);

•	S$ - has artifact=1 or not=0.

!!KT#1/#2/#3:XXXX

Tree of Knowledge at X, Y, Level (#1, #2, #3) coordinates. Trees of Knowledge are Type 102.

Options:

•	S$ - Type of tree:

     = 0 (Free),

     = 1 (2000 gold),

     = 2 (10 gems);

•	N$ - Number of the Knowledge Tree (0...31).

!!FR#1/#2/#3:XXXX

Campfire at X, Y, Level (#1, #2, #3) coordinates. Campfires are Type 12.

Options:

•	B$1/$2 - Bonus,

         $1 - Bonus type (Format R),

         $2 - Bonus value.

Comments:

Campfires always have a resource as well as gold. So if the value of $2 is 5, it will have 5 of the resource ($1) and 500 gold.

!!LN#1/#2/#3:XXXX

Lean To at X, Y, Level (#1, #2, #3) coordinates. The Lean To is Type 38.

Options:

•	B$1/$2 - Bonus,

         $1 - Bonus type (Format R),

         $2 - Bonus value;

•	N$ - Number of the Lean To (0...31).

!!ST#1/#2/#3:XXXX

Learning Stone at X, Y, Level (#1, #2, #3) coordinates. Learning Stones are Type 100.

Options:

•	N$  - Number of the Learning Stone (0...31).

!!WG#1/#2/#3:XXXX

Wagon at X, Y, Level (#1, #2, #3) coordinates. Wagons are Type 105.

Options:

•	S$ - Has or not bonus,

     = 1 - yes,

     = 0 - no;

•	B$ - Bonus is artifact or resource,

     = 1 - artifact,

     = 0 - resource;

•	A$ - Artifact number, see Format A1;

•	R$1/$2 - Resource type and value,

         $1 - type,

         $2 - value, see Format R.

!!SK#1/#2/#3:XXXX

Skeleton (Corpse) at X, Y, Level (#1, #2, #3) coordinates. Skeletons are Type 22.

Options:

•	A$ - Artifact number, see Format A1;

•	N$  - Number of the Skeleton (0...31);

•	S$ - Has or not artifact,

     = 1 - yes,

     = 0 - no.

!!SP#1/#2/#3:XXXX

Magic Spring at X, Y, Level (#1, #2, #3) coordinates. Magic Springs are Type 48.

Options:

•	S$ - Loaded or empty,

     = 1 - yes,

     = 0 - no;

•	N$  - Number of the Magic Spring (0...31).

!!WM#1/#2/#3:XXXX

Water Wheel  at X, Y, Level (#1, #2, #3) coordinates. Water Wheels are Type 109.

Options:

•	B$ - Gold value.

!!SW#1/#2/#3:XXXX

Swan Pond at X, Y, Level (#1, #2, #3) coordinates. Swan Ponds are Type 14.

Options:

•	B$ - Value of luck 1...3;

•	N$  - Number of the Lake (0...31).

!!MT#1/#2/#3:XXXX

Obelisk at X, Y, Level (#1, #2, #3) coordinates. Obelisks are Type 57.

•	N$ - Number of the Obelisk (0...31).

!!GD#1/#2/#3:XXXX

Mystical Garden at X, Y, Level (#1, #2, #3) coordinates. Mystical Gardens are Type 55.

Options:

•	B$ - Type of resource [usually = 5]. See Format R;

•	T$  - Bonus type is resource=1 or gold=0;

•	N$ - Number of the Mystical Garden (0...31).

!!ML#1/#2/#3:XXXX

Windmill at X, Y, Level (#1, #2, #3) coordinates. Windmills are Type 112.

Options:

•	B$1/$2 - Resource type and value, see Format R,

         $1 - type,

         $2 - value.

!!DW#1/#2/#3:XXXX

Monster dwelling at X, Y, Level (#1, #2, #3) coordinates. Monster Dwellings are Types 17 and 20, see Format CG.

Options:

•	M#1/$2/$3 - set the monster to hire,

   #1 = Slot (0...3) - you can hire up to 4 different monsters at one dwelling,

   #2 = Type of the monster (-1 = disable this slot), see Format C,

   #3 = Number to hire;

•	G#1/$2/$3  - set the monster as a Guard,

   #1 = Slot (0...6),

   #2 = Type of the monster (-1=no monster there), see Format C,

   #3  = Number of Monsters;

•	O$ - Set up an owner (-1 = nobody's).

!!WH#1/#2/#3:XXXX

Witch Hut at X, Y, Level (#1, #2, #3) coordinates, Witch Huts are Type 113.

Options:

•	S$ - set/check/get the skill to 0...27 (Format SS).

!!SY#1/#2/#3:XXXX

Shipyard at X, Y, Level (#1, #2, #3) coordinates. Shipyards are Type 87.

Options:

•	O$ - Set/check/get the owner (0...7,-1). See Format E1;

•	P$1/$2 - Set the point on the map where the boat will be placed if you buy it. By default this is x+1 and y+1 from right bottom corner of the shipyard. You can place it not only on water. If the point is out of the map, you cannot buy a boat.

!!GR#1/#2/#3:XXXX

Garrison at X, Y, Level (#1, #2, #3) coordinates. Garrisons are Types 33 and 219.

Options:

•	O$ - Set/check/get the owner (0...7,-1), see Format E1;

•	G#1/#2/#3 - Set/check/get the monster as a Guard,

    #1  = Slot (0...6),

    #2  = Type of the monster (-1=no monster there), see Format C,

    #3  = Number of Monsters;

•	F$ - Set/check/get if you can delete the guards,

     1 = no,

     0 = yes.

!!SR#1/#2/#3:XXXX

Magic shrine at X, Y, Level (#1, #2, #3) coordinates. Magic Shrines are Types 88, 89 and 90.

Options:

•	S$ - Set/get/check the spell number (see Format SP) for any kind of Shrine.

!!UR#1/#2/#3:XXXX

University at X, Y, Level (#1, #2, #3) coordinates. Universities are Type 104.

Options:

•	S$1/$2/$3/$4 - are the skills that will be offered, see Format SS.

You can now place a new university correctly with the UN:I command and set the skills offered with the UR receiver.

!!SG#1/#2/#3:XXXX

Sign or bottle at X, Y, Level (#1, #2, #3) coordinates. Signs are Type 91. Bottles are Type 59.

Options:

•	M#, M^...^ - set any message;

•	M-1 - Restore the default message. When placed on the map the message is any from default list.


Miscellaneous objects list
!!MN Object "Mine"

!!SC Object "Scholar"

!!CH Object "Treasure Chest"

!!WT Object "Warrior's Tomb"

!!KT Object "Tree of Knowledge"

!!FR Object "Campfire"

!!LN Object "Lean To"

!!ST Object "Learning Stone"

!!WG Object "Wagon"

!!SK Object "Skeleton (Corpse)"

!!SP Object "Magic Spring"

!!WM Object "Water Wheel"

!!SW Object "Swan Pond"

!!MT Object "Obelisk"

!!GD Object "Mystical Garden"

!!ML Object "Windmill"

!!DW Object "Monster dwelling"

!!WH Object "Witch Hut"

!!SY Object "Shipyard"

!!GR Object "Garrison"

!!SR Object "Magic shrine"

!!UR Object "University"

!!SG Object "Sign / bottle"


Receivers list legend
 - Main receivers & instructions

 - Miscellaneous objects receivers & instructions


Triggers list legend
 - Main triggers

 - Post-visit triggers


Formats list legend
 - Standart Formats

 - Additional Formats


Additional objects: Types and Subtypes

Def Name	Object	Type	Subtype
AVXprmd0.def		63	0
ZH4Obj01.def		63	1
ZH4Obj02.def		63	2
ZObj001.def		63	3
ZObj002.def		63	4
ZObj003.def		63	5
ZObj004.def		63	6
ZObj005.def		63	7
ZObj006.def		63	8
ZObj007.def		63	9
ZSphnx10.def		63	10
ZSphnx11.def		63	11
ZSphnx12.def		63	12
ZSphnx13.def		63	13
ZObj008.def		63	14
ZObj009.def		63	15
ZObj010.def		63	16
ZObj011.def		63	17
ZObj012.def		63	18
ZObj013.def		63	19
ZObj014.def		63	20
ZObj015.def		63	21
ZObj016.def		63	22
ZObj017.def		63	23
ZObj018.def		63	24
ZObj019.def		63	25
ZObj020.def		63	26
ZObj021.def		63	27
ZObj022.def		63	28
ZObj023.def		63	29
ZObj024.def		63	30
ZObj025.def		63	31
ZObj026.def		63	32
ZObj027.def		63	33
ZObj028.def		63	34
ZObj029.def		63	35
ZObj030.def		63	36
ZObj031.def		63	37
ZObj032.def		63	38
ZObj033.def		63	39
ZObj034.def		63	40
ZObj035.def		63	41
ZObj036.def		63	42
ZObj037.def		63	43
ZObj038.def		63	44
ZObj039.def		63	45
ZObj040.def		63	46
ZObj041.def		63	47
ZObj042.def		63	48
ZObj043.def		63	49
Skull.def		63	50
AVXMKTT0.def		63	51
Zart1.def		63	52
Zwork1.def		63	53
Zmark1.def		63	54
Zyzop1.def		63	55
Zyzop2.def		63	56
Zcave1.def		63	57
Zcave2.def		63	58
Zcave3.def		63	59
Zcave4.def		63	60
Zcave5.def		63	61
Ztower1.def		63	62
Zobja.def		63	63
Zobjb.def		63	64
Zobjc.def		63	65


Background picture for the battle

Index	Picture
-1	default
1	sand/shore
2	sand/mesas
3	dirt/birches
4	dirt/hills
5	dirt/pines
6	grass/hills
7	grass/pines
8	lava
9	magic plains
10	snow/mountains
11	snow/trees
12	subterranean
13	swamp/trees
14	fiery fields
15	rocklands
16	magic clouds
17	lucid pools
18	holy ground
19	clover field
20	evil fog
21	"favorable winds" text on magic plains background
22	cursed ground
23	rough
24	ship to ship
25	ship


Content of Flags and variables
Flags

Variables


Trigger !?AE

Legend

Equip/Unequip artifact triggers.

!?AE0 - take off an artifact;

!?AE1 - put on an artifact.

These triggers are used to check if an artifact is being equipped or unequipped by a hero. The triggers occur when a player equips or unequips an artifact and also when an artifact is picked up and automatically equipped.

These triggers may be useful for making custom-scripted artifacts that add or subtract primary or secondary skills.

The current Hero (!!HE-1) is a Hero-owner.

v998 keeps an artifact number.

v999 keeps a position (slot) number.

Comments:

It does not work for backpack.

If you change one artifact to another, it produces some extra triggers call. Here it is:

     1. AE0 (prev)

     2. AE1 (prev)

     3. AE0 (prev)

     4. AE1 (new)

     5. AE0 (new)

     6. AE1 (new)

If you take an artifact from a backpack and a slot that this artifact may be placed is busy, you will get the next sequence for every slot this artifact may be placed:

     1. AE0 (prev)

     2. AE1 (prev)

So be careful and do not count that if a specific artifact is not taken off, you will not have AE0 trigger switched for this art.


Receiver !!AI

Options Legend

!!AI:XXXX

Set destination points for AI heroes to move to.

The AI receiver gives you a measure of control over AI movement. You can use it to influence or even force AI heroes to move to certain map locations.

Depending on the value you set, the AI may deviate along the way to pick up treasures, attack weaker monsters or heroes, claim mines or even take over a castle. Even using a maximum importance value, the AI can't ALWAYS be controlled if circumstances weigh heavily against it moving in a certain direction (e.g., it has 500 phoenixes, has lost its last town and there is an undefended castle nearby), but usually it can be counted on.

One possible use of this receiver is to set up a sequence of way points so that an AI hero will patrol in a fixed pattern. Another more devious use is to reset the destination points each turn or each time a hero movement trigger is called, linking them to the position of a player's hero. This will cause an AI hero to pursue the player's hero relentlessly.


Options for !!AI receiver

Options list Legend

S#1/#2/#3/$1/$2/$3/$4/$5

Set up new destination point.

   #1 - Number of the hero (See Format H). (-1=any);

   #2 - Owner of the hero (Format E1) (-1=any);

   #3 - Sequence Number (in the sequence of destination points);

   $1 - X position;

   $2 - Y position;

   $3 - map Level;

   $4 - Value is an Importance value for the AI:

            5000000 - very important,

            500000 - valuable;

   $5 - Flags. Value means:

            0 = no flag set,

            1 = start with this position first,

            2 = do not delete the position after arriving,

            3 = start with this position and do not delete the position after arriving.

Comments:

1. The sequence works this way.

If you set destination points with seqnums:

2,4,5,6,88,99

and set flag 1 for seqnum 6, the hero will run the next points:

6,88,99,2,4,5

and then if some of them have "do not delete" flag (example 88,4,5),

the hero will run to:

88,4,5,88,4,5,88,4,5...

2. You can set any owner (-1) and this mean that the hero will run the destination point whoever owns the hero.

3. You can set any hero (-1) and this means that all heroes of the owner will run to destination points.

4. If the last position is also the first position and is set to not delete after arriving, a phantom clone of the hero may appear on the map. If you need to make a patrol circuit, you can avoid this by setting an extra position one square over from the start position as the end position instead.

5. If a specific hero isn't specified and there are multiple destination points, the first AI hero will move towards the first one. After that hero's movement is done, the second hero will continue where it left off, perhaps moving towards the next destination point. For this reason, it's often a good idea to specify a specific hero to avoid too much chaos.

D#1/#2/#3

Delete a destination point.

   #1 - Number of the hero. (Format H) (-1=any);

   #2 - Owner of the hero (Format E1) (-1=any);

   #3 - Number of a sequence of destination points,

   # = -1, delete all points in sequence for this hero and owner.


Options list for !!AI receiver
S#1/#2/#3/$1/.../$5 Set up new destination point

D#1/#2/#3 Delete a destination point for the AI


Receiver !!CO

Options Legend

This receiver lets you set, check and change many aspects of Commanders through ERM.

!!CO$:XXXX

  $ = -2 apply to all Commanders;

  $ = -1 apply to current Commander (for current hero);

  $ >= 0 apply to specific Commander.

Every Commander has the same number that a hero-owner.

See also: !?CO Trigger.


Options for !!CO receiver

Options list Legend

A

Artifacts. [Not supported yet]

B#/$1/$2

Special Bonus.

   # - Type of set,

         0 - All spec bonuses at once,

         1 - One specific special bonus,

         2 - All spec bonuses disabling at once,

         3 - One specific spec bonus disabling;

B0/$

Special Bonus : all spec bonuses at once.

   $ - mask as a sum of (bit dependent):

         0 - AT+DF bonus bit value is 1,

         1 - AT+HP bonus bit value is 2,

         2 - AT+DM bonus bit value is 4,

         3 - AT+MP bonus bit value is 8,

         4 - AT+SP bonus bit value is 16,

         5 - DF+HP bonus bit value is 32,

         6 - DF+DM bonus bit value is 64,

         7 - DF+MP bonus bit value is 128,

         8 - DF+SP bonus bit value is 256,

         9 - HP+DM bonus bit value is 512,

         10 - HP+MP bonus bit value is 1024,

         11 - HP+SP bonus bit value is 2048,

         12 - DM+MP bonus bit value is 4096,

         13 - DM+SP bonus bit value is 8192,

         14 - MP+SP bonus bit value is 16384.

   bit=1 if has and 0 if not.

B1/$1/$2

Special Bonus : One specific special bonus.

   $1 - number of bonus (0...14);

   $2 - has(1) or not(0).

B2/$

Special Bonus : All specific bonuses disabling at once.

   $ - mask as a sum of (bit dependent):

bit=1 if may have and 0 if not.

B3/$1/$2

Special Bonus : One specific spec bonus disabling.

   $1 - number of bonus (0...14);

   $2 - may have(1) or not(0).

Comments:

You may apply any command to all Commanders but only to set values. For every specific Commander you can set/check/get as usual.

D$

Dead/Alive Commanders.

   1 - Dead,

   0 - Alive.

E$

Enable(1)/disable(0) Commander(s).

   1 - Enable,

   0 - Disable.

H$

Owner Hero's type. See Format E.

N$

Set/get the name of Commander. You can set or get the name of Commander.

   $ - Number of z vars (1...1000,-1...-10).

You can change z vars after the usage (the name is copied inside Commander structure).

You cannot use this command for all Commanders.

P#/$

Commander statistics.

   # - type of statistics,

         0 - Attack,

         1 - Defense,

         2 - Hit Points,

         3 - Damage,

         4 - Magic Power,

         5 - Speed,

         6 - Magic Resistance;

   $ - value.

P$

Set/check/get the "Custom Primary Skill Control".

   $ = 0 - Disabled;

   $ = 1 - Custom control enabled.

If you set it to 1 (yes), the primary skill will not change with Commander improvement, they will stay as you set them. It applied only to the basic values, so if you have one of the basic skill improved, it will add the value to the primary skill you set. If it is 0, the HP and DM primary value will grow automatically with Commander levels.

S#/$

Commander basic skills level.

   # - Type of the basic skill,

         0 - Attack,

         1 - Defense,

         2 - Hit Points,

         3 - Damage,

         4 - Magic Power,

         5 - Speed,

         6 - Magic Resistance;

   $ - Value.

(Magic Resistance usually has the same level Magic Power, but you can change this; but they will grow both simultaneously)

T$

Commander type (0...8). See Format CC.

X#/$

Commander experience.

   # - type of experience,

         0 - Hero's Exp taken as a basic for the next level,

         1 - Current Commander exp,

         2 - Current Commander Level.


Options list for !!CO receiver
A Artifacts

B#/$1/$2 Special Bonus

B0/$ Special Bonus : all spec bonuses at once

B1/$1/$2 Special Bonus : One specific special bonus

B2/$ Special Bonus : All specific bonuses disabling at once

B3/$1/$2 Special Bonus : One specific spec bonus disabling

D$ Dead/Alive Commanders

E$ Enable/Disable Commander

H$ Owner Hero's type

N$ Set/get the name of Commander

P#/$ Commander statistics

P$ Set/check/get the "Custom Primary Skill Control"

S#/$ Commander basic skills level

T$ Commander type

X#/$ Commander experience


Legend for Receivers and Triggers
XXXX - Options

$ - Value can be stored in a variable

?$ - Value can be read but not set

# - Value can be only be set, but not read


Receiver !!MW

Options Legend

!!MW#:XXXX

   # is a number of Wandering Monster.

Used to enable/disable interaction with wandering monsters.

Comments:

WM has a radius 20 for searching (or as set with A4 command). At the start of every turn, WM decide where to move/attack. But he will make a real move/attack at a turn of a player that is an owner of a hero/town to move to.

Example:

ZVSE

!#TM1:S1/1/1/2;

!?TM1;

!!MW:P4/8/0/9/?v100; !!IF:M^v100:%V100^;

!!MWv100:A2/0/0/0A3/1/1/0/1/1/0;

!!MW:P1/8/0/10/?v110; !!IF:M^v110:%V110^;

!!MWv110:A2/10/10/0A3/1/1/1/0/1/0;

!?MW0;

!!IF:M^MW0:%V997^;

!?MW1;

!!IF:M^MW1:%V997^;


Options for !!MW receiver

Options list Legend

A1/x/y/l

Get/check/set (jump) a Wandering Monsters to x/y/l position.

A2/x/y/l

Get/check/set a destination point for WM.

Comments:

For WM that searches for hero x means a number of hero to search.

A3/$1/$2/$3/$4/$5/$6/$7

Manage Wandering Monsters.

   $1 - get/check/set a flag: to call !?MW0 or not when reaches a destination point/before attacking a searched Hero;

   $2 - get/check/set a flag: to call !?MW1 or not when monster is killed (when a WM is killed it has no more a number and this number may be set for another monster when created);

   $3 - get/check/set a flag: go to a destination point;

   $4 - get/check/set a flag: search for a specific hero;

   $5 - get/check/set a flag: Stand still after reached point/hero or for a free monster. For now a monster, that reached a destination point or caught, attacked and killed a searched for Hero, becomes a free monster. If you set this flag, you will force it to stand still until get new command. For free WM this means the same - stand still;

   $6 - set/check/get a flag: search for a specific player (color);

This flag used only for free WM. If it is set, the destination x coordinate should keep a color of player. If it is not -1 (all colors), this free WM will search for heroes and towns of this current player only;

   $7 - set/check/get a flag: move over land and/or water;

If you set it to 0 (default), it will go over the land only. If you set it to 1, it will go over water only. If you set it to 2, it will go over land and water;

A4/#

Get/check/set a radius (#) for searching (default is 20).

Cx/y/l/?$

Check for a WM at a specified position.

   x/y/l - the location to check for a wandering monster;

   var $ that receives the number of a WM (1...) or 0 if there is no WM at that position.

E?$

Check for existence of this WM number #.

   1 = If there is a WM number # otherwise $=0.

Mx/y/l/?$

Make an ordinary monster a WM.

   x/y/l - the location of existing ordinary monster;

   var $ receive a number of WM (this monster become WM).

If var $ gets a value 0 (the same as for MW:P command), that means that WM was not created by any reason.

Comments:

You can also set up monster through MO receiver (by position) after generating a WM with !!MW:P.

Px/y/l/#/?$

Set (generate) a monster at position.

      # - monster type (Format C);

      $ - receives a number of MW (to operate later).

Comments:

For this command # a number of MW is not needed (it is not known yet).


Options list for !!MW receiver
A1/x/y/l Get/check/set a Wandering Monsters to position

A2/x/y/l Get/check/set a destination point for WM

A3/$1/.../$7 Manage Wandering Monsters

A4/# Get/check/set a radius for searching

Cx/y/l/?$ Check for a WM at a specified position

E?$ Check for existence of this WM number

Mx/y/l/?$ Make an ordinary monster a WM

Px/y/l/#/?$ Set a monster at position


Trigger !?CO

Legend

!?CO#

Commander control.

•	 !?CO0	is called before opening the Commander Dialog;

•	 !?CO1	is called after closing the Commander Dialog;

•	 !?CO2	is called after buying a Commander in a Town;

•	 !?CO3	is called after reviving a Commander in a Town.

Flag 1000 set to 1 only if the owner of the hero is a human player who sits before the screen.

Flag 999 as usual shows whether this turn is a human player who sits before the screen.

You can use !!HE-1:... to get the current hero info and !!CO-1:...to get current Commander info.

Vars v998, v999, v1000 as usual shows the position of the current hero on the map.

See also: !!CO Receiver.


Trigger !?IP

Legend

!?IP#

Multiplayer support.

If one player's hero attacks another player's hero, there will be the next sequence:

a) !?BA0 trigger for "A"(attacker) player switches;

b) !?IP0 trigger switches for "A" player;

c) data transferred to "D"(defender) player:

- "A" player's Hero info;

- "A" player's Hero Commander info (completely);

- v vars set v9001-v10000;

- all potentially changed monster statistics;

d) all sent data received at "D" player side;

e) !?IP1 trigger switches for "D" player;

f) !?BA0 trigger switches for "D" player.

Now the battle takes place.

If "A" player wins, no WoG data transferred.

if "D" player wins, there will be the next sequence:

a) "A" player goes to wait until "D" player gains levels;

b) "D" player's Hero and Commander gain levels;

c) !?IP2 trigger switches for "D" player;

d) data transferred tp "A" player:

- "D" player's Hero sec. skills (all 28), level and exp.;

- "D" player's Hero Commander info (completely);

- v vars set v9001-v10000;

e) !?BA1 trigger switches for "D" player;

f) "A" player goes from waiting until "D" player gains levels;

g) all sent data received at "A" player side;

h) !?IP3 trigger switches for "A" player;

i) !?BA1 trigger switches for "A" player.

As you can see, monsters, heroes and Commanders statistics should be identical now. As a side effect I can say that 10 sec. skills for Hero is a multiplayer safe rule. All 28 sec. skills transfered in both directions if needed.


Receiver !!VC

Options Legend

!#VC:XXXX

Variable Control.

Used to log flags, variables, timers, functions(FU) and loops(DO) used in the script . It can save the log to an external file: ERMVarsUsed.LOG for further use.

Attention:

This receiver should be used as an instruction (!#VC:...) syntax otherwise it does not make sense.

Comments:

Please note that the logging and saving to file operations are lauched only when the ERM compiler executes these commands, this meaning during the wogification process of the map, before day 1. So you still have to launch the game and start a map in order to log your variables, functions and so on, from your script(s).

You have to allways use B and E in pairs.You can use B and E command more than one time to control different parts of script. The effect will be summed up.

Example1: The v10 and v12 variabless will be logged, and v11 skipped:

!#VC:CB; clear list, start logging

!!VRv10:...; using variable v10

!#VC:E; stop logging

!!VRv11:...; using variable v11

!#VC:B; start logging

!!VRv12:...; using variable v12

!#VC:EWC; stop logging, writing log to ERMVarsUsed.LOG file, clear list

As you have seen above, it is indicated to clear the list (C) before starting to log the first time, and when finished with all log operations.

You can also use more than one Y and N sections.

Example2:

!#VC:CB;

!!VRv10:...;

!!VRv11:...;

!#VC:Y;

!!VRv11:...;

!!VRv12:...;

!#VC:N;

!!VRv12:...;

!!VRv14:...;

!#VC:Y;

!!VRv14:...;

!#VC:N;

!!VRv13:...;

!#VC:EWC;

The next vars will be signed as cross referenced: v11 and v14;

and not cross-referenced: v10,v12,v13

(v12 is not cross-referenced because it was not used before checking).

The VC instruction allows you to log these types of elements:

1. flags : 1...1000

2. v vars: v1...v10000

3. w vars: w1...w100

4. z vars: z1...z1000

All marked with:

- 'p' if used as a parameter;

- '&' if used in & condition section;

- '|' if used in | condition section;

- '*' if cross-referenced;

5. Timers: TM1...TM100

- marked with 't' if a trigger was found;

- marked with 'r' if a receiver or instruction was found.

6. Functions/Loops: FU1...FU30000, DO1...DO30000

- marked with 't' if a trigger (function definition) was found;

- marked with 'r' if a receiver or instruction (function call) was found;

- marked with 'd' if a receiver or instruction (cycle call) was found.

Also, VC cannot log an indirect referenced vars like this:

!!VRvx10:...

The index of v var is unknown here at loading time because x10 is undefined at that point.

This means that if you want to be sure that a script (that is not created by you), you logged elements from, does not use indirect referenced variables, you have to check it manualy, line for line. To avoid such a work in the future,the proposition is to initialize all variables that you may use in your script like this:

!#VR...:S0;

at the top of the script, to be sure that this var will be logged.

You can log vars from several script files. Say, you can put !#VC:CB; in script00.erm file and !#VC:EWC; to script40.erm and you will get the complete list of vars in all script files from 0 to 40.

The log file is created at map loading and called as "ERMVarsUsed.log". If such file exists, it will be completely overwritten.

We recommend to use Y and N section to check your own script for vars/timers/functions that are used in your script and in other scripts.

For this you should set a number for your script file to higher than any other scripts, log vars in all scripts and use Y and N section in your script file.

Example3:

You have scripts number 0,1,2,3,4,5...50 and want to check your script for cross-reference with them.

1. Number your script as script99.erm (condition: 99 > 50).

2. Add "start logging" in the beginning of the first script file (script00.erm):

!#VC:CB;

3. Add "start cross-reference checking" in the beginning of your script file (script99.erm):

!#VC:Y;

4. Add "stop cross-reference checking" in the end of your script file (script99.erm):

!#VC:N;

5. Add "stop logging and write" in the end of your script file (script99.erm):

!#VC:EWC;

Now, if your script uses variables/triggers/functions that were used in the scripts 0...50, all of them will be marked in the log file with '*'.

If you want to make the same for your internal map scripts, assume scripts number as a day of Timed Events and do the same.


Options for !!VC receiver

Options list Legend

B

Start logging used ERM variables.

C

Clear the list of used ERM variables.

E

Stop logging used ERM variables.

N

Stop a cross-reference checking section.

Y

Start a cross-reference checking section.

W

Write log to "ERMVarsUsed.log" file.


Options list for !!VC receiver
B Start logging used ERM variables

C Clear the list of used ERM variables

E Stop logging used ERM variables

N Stop a cross-reference checking section

Y Start a cross-reference checking section

W Write log to "ERMVarsUsed.log" file


List of the claimed

WoGify Scripts for Wake of Gods 3.57f and 3.58 (Updated May 1, 2003)

Timers, Functions, Macros and Dialogs used, Variables and Flags used permanently:

(Temporary variables also shown in parenthesis as well as in a separate list below)

Normal Variables (v1-v10000):

(v1-v10), v11-v12, (v13-v14), (v24-v34), v40-v41, (v50-v54), (v76), v88-v93, (v94-v95), v100 (v101-v111), v119-v142, (v143), v144-v147, v160-v200, v205, v210-v247, v249, v250-v257, v266-v284, v295-v299, (v300-v308), v310-v312, v346, (v360-v370), v371-v373, v381-v386, v388-v389, v400-v422, v425-v444, (v451-v469), v490-v492, v508, v510-v559, (v564-v571), v572-v590, v592-v599, (v600-v739), v700-v761, v777, v850-v882, (v900-v916), (v920-v934), v950-v966, v975-v976, (v997-v1000), v1200-v1210, (v1211), v1212-v1214, v1218-v1257, v1260-v1265, v1300-v1327, v1332-v1335, v1340-v1357, v1500, v1600-v1983, v2100-v2107, v2110-v2112, v2200-v2208, v7000-v7010, v7020-v7053, v7080-v7087, v7183, v7185-v7197, v9001, v9300

Strings (z1-z1000):

(z1-z9), z10-z21, (z22-z44), (z47-z61), (z78-z90), z100-z103, z119-z140, (z141-z142), z143 z160-z166, z190-z199, z201-z205, z210-z231, z241, (z242-z248), z250-z265, z266-z269, (z270-z279), z280-z299, (z300-z303), (z310-z319), (z326-z331), z332-z354, (z360-z366), z368-z383, (z390-z393), z400-z406, z410-z428, z430-z444, z450-z454, z469, (z470-z472), (z480-z492), z493-z495, z698, z700-z706, z710-z728, z732-z752, z800-z841

ERT Z Variables

116000-116037, 127000-127003, 128000-128076, 134001-134025, 135000-135177, 136000-136058

Hero Variables (w1-w100):

w1-w14, w20-w32, w38, w41-w42, w45, w46, v49, w51-w59, w61-w78, w80-w84, w90-w94

Functions (1-30000):

FU1-FU2, FU10-FU11, FU18, FU20-FU24, FU100, FU141-FU147, FU160-FU161, FU180-FU184, FU200-FU301,

FU451, FU491-FU493, FU599-FU611, FU620-FU627, FU631, FU640-FU641, FU643-FU661, FU670-FU686, FU690-FU726, FU730-FU815, FU820-FU869, FU950, FU1000, FU1100-FU1110, FU1400-FU1409, FU2400-FU2406, FU2826, FU3610-FU3618, FU3620-FU3630, FU3633-FU3638, FU3724-FU3733, FU4850, FU5000-FU5037, FU5200-FU5211, FU5219-FU5229, FU5244-FU5253, FU5260-FU5262, FU5300-FU5309, FU6664-FU6670, FU7000-FU7025, FU7060-FU7066, FU7070-FU7073, FU7795-FU7824, FU8000, FU8150-FU8168, FU8170-FU8186, FU8200-FU8227, FU10799-FU10815, FU10850-FU10862, FU10900-FU10910, FU13500-FU13507, FU14000, FU18001-FU18009, FU19000

Timers (1-100):

TM10-TM11, TM13-TM14, TM16, TM18-TM19, TM28, TM30-TM31, TM34, TM38, TM41-TM42, TM48, TM50-TM51, TM57-TM58, TM61-TM64, TM74-TM80, TM82, TM84-TM85 TM90, TM98-TM99

Flags (1-1000):

(1-10), 21, 27, 32-33, 49, 56-57, 70-72, 75-77, 130-133, 140, 145-147, 160-162, 170-172, 209, 211-212, 266-271, 298-299, (400-408), 409-410, 412, 428-433, 490, 600-603, 784-791, 870-874, 902-907, (1000)

Macros:

$xpos$, $ypos$, $lpos$, $hpower$, $apower$, $hsex$, $hnumber$, $aknow$, $hcolour$, $aname$, $hrname$, $hisher$, @hsex@, @slevel@, @pgold@, @sicon@, @cday@, @skillnum@, @pithnum@, @skname@,  @hname@, @he-she@, @man-woman@, @pithy@

Dialogs (1-100):

1, 3, 11, 14, 20-21, 30-32, 88, 100

ERM WoG Option Numbers: 0-8, [9-10 reserved for hard coded options], 11-24, 26-56, [57-99 reserved for new scripts], 101-148, 150-169

Temporary variables and flags (may also be used by other scripts):

v1-v10, v13-v14, v24-v34, v50-v54, v76, v94-v95, v101-v111, v143, v300-v308, v360-v370, v451-v469, v564-v571, v600-v739, v900-v916, v920-v934, (v998-v1000), v12117, z1-z9, z22-z44, z47-z61, z78-z90, z141-z142, z242-z248, z270-z279, z300-z303, z310-z319, z326-z331, z360-z366, z390-z393, z470-z472, z480-z492 (x1-x16), i-n

Flags: 1-10, 400-408, (1000)

--------> WOGIFY (script00.erm)

Author: Donald

ERM WoG Option Numbers: 132-133, 137-143, 165

Object Used: none, although many are replaced with object for use by other scripts and chest and external dwelling values may be modified

** Variables Used: v508, v600-v705, v950-v966

** Flags Used: 9,870 (used by Anders' Mithril script section]

** Functions Used: FU670-FU686, FU5209

** Timers Used: TM19, TM79

--------> MAP RULES (script01.erm)

Author: Donald

ERM WoG Option Numbers: 101, 111-130

Object Used: none, although several are used as trigger squares for rogues

** Variables Used: z280-z299, z326-z328, z332-z354, v1-v4, v549-v559, v564-v579, v600-v602, v610-v639, v700-v739, v1219, v1262

** Flags Used: 1-3

** Functions Used: FU690-FU726

** Timers Used: TM84

** Variables w46, v549-v559, v572-v579, z280-z299, and z332-z354 must not be modified by other programs!

--------> ARTIFACT BOOST (script02.erm)

Author: Donald

ERM WoG Option Numbers: 102

Object Used: the following artifacts are enhanced: Bird of Percention (63), Pendant of Life (103), Pendant of Death (104), Targ of the Rampaging Ogre (16), Dead Man's Boots (56), Pendant of Total Recall (107), Emblem of Cognizance (65), Stoic Watchman (64), Pendant of Second Sight (101), Pendant of Holiness (102), Boots of Polarity (59), Garniture of Interference (57), Pendant of Dispassion (100), Pendant of Free Will (105), Diplomat's Ring (67), Surcoat of Counterpoise (58),

Orb of Vulnerability (93), Sphere of Permanence (92), Statesman's Medal (66), Orb of Inhibition (126)

** Variables Used: v600-v628, v630-v631, v640-v648, z326-z331, z410-z428, i-l

** Flags Used: 1, 2, 5

** z410-z428 must not be modified by other programs!

** The other variables may be used elsewhere but will be trashed by this code.

** Functions Used: 599-609

** Timers Used: 85

--------> SECONDARY SKILLS BOOST (script03.erm)

Author: Donald

ERM WoG Option Numbers: 103

Object Used: none

** Variables Used: v580-v589, v900-v916, v920-v934, z270-z279, z310-z319, z390-z393, z470-z472, z430-z431

** Flags Used: 2, 270-271

** v580-v589 and z430-z431 must not be modified elsewhere!

** Flags 270-271 are shared with other scripts that use Fnord's network detection function.

** The other variables may be used elsewhere but will be trashed by this code.

** Use caution; this code may take place in the middle of another script, if a hero gains a level

or a battle is provoked

** Functions Used: 643-661, 8166

** Timers Used: 74

--------> ARCANE TOWER (script04.erm)

Author: Donald

ERM WoG Option Numbers: 104

Object Used: Type 63, Subtype 9 (Thin Tower)

** Variables Used: v590, v600-v617, v618, z403

** Flags used: 2-5

** z403 must not be changed in other programs!

** v590 must always be 0! Some of my other scripts also use it as 0 for hint indexing.

** The other variables may be used elsewhere but will be trashed by this code.

** Functions Used: 620-627

--------> BANK (script05.erm)

Author: Donald

ERM WoG Option Numbers: 105

Object Used: Type 63, Subtype 47 (Black Tower)

** Variables Used: v590, v592-v606, m-n, z401

** v592-v599, z401 must be untouched by other ERM programs!

** v590 must be 0! Some of my other scripts also use it as 0 for hint indexing.

** The other variables may be used elsewhere but will be trashed by this code.

** Functions Used: 631, 8165

** Timers Used: 75

--------> HOURGLASS OF ASMODEUS (script06.erm)

Author: Timothy

ERM WoG Option Numbers: 106

Object Used: enhances Hourglass of the Evil Hour artifact (85)

Flags Used in this Script: 1, 266-271

Variables used in this Script: v234,v247,v266-284, v1255-v1256, v9300, z266-269, z444

Functions used in this Script: 6664-6670

Macro Names used in this Script: $xpos$, $ypos$, $lpos$, $hpower$, $apower$, $hsex$, $hnumber$,

$aknow$, $hcolour$, $aname$, $hrname$, $hisher$

--------> FISHING WELL (script07.erm)

Author: Timothy

ERM WoG Option Numbers: 107

Object Used: enhances Magic Well (Object 49)

Flags Used in this Script: 1-6

Variables Used in this Script: v300-v308, v998-v1000, z1-z2, z300-z303

Functions Used in this Script: 1100-1110, 14000

--------> JUNK MERCHANT (script08.erm)

Author: Donald

ERM WoG Option Numbers: 108

Object Used:  Type 63, Subtype 8 (Windmill with Barrels)

** Variables Used: v590, v600-v612, z326-z330, z400

** Flags Used: 2

** v590 must always be 0! Some of my other scripts also use it as 0 for hint text indexing.

** z400 must not be changed by other programs!

** The other variables may be used elsewhere but will be trashed by this code.

** Functions Used: 640-641

--------> MARKET OF TIME (script09.erm)

Author: Timothy

ERM WoG Option Numbers: 109

Object Used:  Type 63, Subtype 51 (Market of Time)

Flags used: 1-4, 1000

Variables used: v50-v54, v451-v469, w45, z1, z47-z61, z241-248

Functions used: 451

Dialogs used: 14

Macros used: @hsex@, @slevel@, @pgold@, @sicon@, @cday@, @skillnum@, @pithnum@, @skname@, @hname@, @he-she@, @man-woman@, @pithy@

--------> MAGIC MUSHROOMS (script10.erm)

Author: Bruno

ERM WoG Option Numbers: 110

Object Used: Type 63, Subtypes: 14 (Air Mushroom), 18 (Water Mushroom), 23 (Earth Mushroom),

and 29 (Fire Mushroom)

Uses timer 10 and Functions 10-12

Uses v1-v3 just for local use

Uses w20-w27 to track hero visits to mushrooms and previous skill levels

Uses z10-z17 for hint texts

--------> PALACE OF DREAMS (script11.erm)

Author: Timothy

ERM WoG Option Numbers: 11

Object Used:  Type 63, Subtype 33 (Big Turretted Palace)

Flags Used: 1-3

Variables Used: v1-v2, v101-v111, z1, z3-z6, z450

Functions Used: 777-779

--------> LIVING SKULL (script12.erm)

Author: Timothy

ERM WoG Option Numbers: 12

Object Used:  Type 63, Subtype 50 (One-eyed Living Skull)

Flags used in this script: 1, 21, 27

Variables used in this script: v1, v24-v34, v94, v95, z1, z22-z44, z454

Function numbers used in this script: 20-24

Extended Dialogue Box numbers used in this script: 20-21

Variables that MUST be preserved outside this script: z454

--------> TAVERN GAMBLING GAME (script13.erm)

Author: Timothy

ERM WoG Option Numbers: 13

Object Used: enhances Tavern (Object 95)

Functions used in this code: 1, 2

Flags used in this code: 1, 400-408

Variables used in this code: v400-v420, z201-z205, w41-w42

--------> ALTAR OF TRANSFORMATION (script14.erm)

Author: Timothy

ERM WoG Option Numbers: 14

Object Used:  Type 63, Subtype 20 (Lightning Altar)

Flags Used in this Script: 1,209-212

Variables Used in this Script: v88-v95,x16,z451-z453

Functions Used in this Script: 18001-18009

Timers Used in this Script: 80

--------> MYSTERIOUS CREATURE DWELLING (script15.erm)

Author: Dieter

ERM WoG Option Numbers: 15

Object Used:  Type 63, Subtype 3 (Broken Tower)

** Variables Used: v141-v143, z141-z143, w14

** Flags Used: 140,141

** Functions Used: FU141-FU145

** Timers Used: TM14

** Variables v141, z142, z143 and w14 must not be modified by other programs!

--------> BATTLE ACADEMY (script16.erm)

Author: Anders

ERM WoG Option Numbers: 16

Object Used:  Type 63, Subtype 32 (Light-coloured Fort with Small, Dark Turrets)

Flags: 1-10

Variables: (v1-v2), v381-v383, v388 z382 (may not be used in other scripts),

z1-z4, w38, [z116000-z116037]

Timers: TM30

Functions: FU3610-FU3618, FU8165-FU8167

--------> POTION FOUNTAINS (script17.erm)

Author: Bruno

ERM WoG Option Numbers: 17

Object Used:  Type 63, Subtypes 48 (Kneeling Man statue),

Type 63, Subtype 2 (Lady with Jug statue), and enhances Fountain of Fortune (Object 30)

Variables: v1-v12, v40-v41, v1260-v1261, w10-w12, z1-z3, z18-z21

Flags: 1, 902-907

Functions: 800-802, 810-815

--------> ALMS HOUSE (script18.erm)

Author: Donald

ERM WoG Option Numbers: 18

Object Used:  Type 63, Subtype 24 (Small Snow-covered Stone building)

** Variables Used: v590, v600-v606, z120, z326, z402, w13

** z402 must not be changed elsewhere!

** v590 must always be 0! Some of my other scripts also use it as 0 for hint indexing

** The other variables may be used elsewhere but will be trashed by this code.

** Functions Used: 610-611

--------> MASTERS OF LIFE (script19.erm) *NOTE: This script is NOT part of WoG 3.57f*

Author: Sir Four

ERM WoG Option Numbers: 19

Object Used: none

Variables: v777

Functions: FU100

Flags: none

Timers: 11

--------> WEEK OF MONSTERS (script20.erm)

Author: Timothy

ERM WoG Option Numbers: 20, 134, 135, 136

Object Used: none

Flags Used in this Script: 1, 56, 170-172, 412

v Variables used: v1-v7, v166-200, v205, v361-v367, v372-373, v1200-1210,

z Variables used: z190-199, z495

Functions used: 180-184, 5300-5309, 8000

Timers used in this script: 61-63

--------> FREELANCERS GUILD (script21.erm)

Author: Timothy

ERM WoG Option Numbers: 21

Object Used: enhances Freelancer's Guild (Object 213)

Variables: z1-z5, v210-247, v249-257, z210-z231

Flags: 49-51

Functions: 1400-1409

Dialogues: 30-32

Timers: 64

--------> MONSTER MUTTERINGS (script22.erm)

Author: Timothy

ERM WoG Option Numbers: 22

Object Used: used with Monster stacks (Type 54)

Variables used: v371, v1212-v1214, z119-z141, z469, (z480-z492)

Flags used: 2,57

Functions used: 2826

--------> SORCERY SKILL ENHANCEMENT (script23.erm)

Author: Timothy

ERM WoG Option Numbers: 23

Object Used: none, but used with many objects (resource piles, treasure chests, windmills, water wheels, star axes, gardens of revelation, mystical gardens, learning stones, artifacts, warrior's tombs, wagons, skeletons, sea chests, shipwreck survivors, flotsam, ocean bottles, signs, scholars, universities, camp fires, pyramids, witches' huts, shrines, trees of knowledge)

Flags Used in this Script: 1-3, 410, 872

Variables Used in this Script: v1-v4, v310-v312, z1-z5, z440-z443 (hint text)

Functions Used in this Script: 849, 5000-5037, 8167

Timer: 18

--------> ENHANCED DWELLING HINT TEXT (script24.erm)

Author: Timothy

ERM WoG Option Numbers: 24

Object Used: none, but used with external dwellings

Flags Used in this Script: 1-3,58

Variables Used in this Script: v1,v94-v95,z1-z3

Functions Used in this Script: 2400-2406

--------> MAP OPTIONS (script25.erm)

Author: Timothy

ERM WoG Option Numbers: 131, 144-148, 150-164, 166-169

Object Used: none

Variables used: v975-v976, v1-v4, z1-z4

Flags used: 1

Functions used: 10799-10815

Dialogue Box numbers used: 17

Timers: 34

--------> ARTIFICER (script26.erm)

Author: Dieter

ERM WoG Option Numbers: 26

Object Used: Type 63, Subtype 52 (Red roofed building with fence)

** Variables used: v160-v164, z160-z166,

** Functions used:FU160, FU161,

** Flags used: 160-162

** Timers used: 16

--------> SPELL BOOK (script27.erm)

Author: Anders

ERM WoG Option Numbers: 27

Object Used: spell book artifact (0)

Variables used: (v1-v4), (z1-z9), [z127000-z127003]

Functions used: FU3633-FU3638

--------> SCHOOL OF WIZARDRY (script28.erm)

Author: Anders

ERM WoG Option Numbers: 28

Object Used:  Type 63, Subtype 62 (Blue Tower)

Flags: (1-10)

Variables: v384-v386, v389, z383, w38 (may not be used in other scripts), (v1-v5), (z1-z4), [z128000-z128076]

Timers: TM30

Functions: FU3620-FU3630, FU8165-FU8167

--------> CHEST (script29.erm)

Author: Donald

ERM WoG Option Numbers: 29

Object Used: new Chest (Type 101, Subtype 1)

** Variables Used: w63, w80, z326, v550-v559, v600-v646

** Flags Used: 2

** v550-v559 are a bit table used by several of my scripts. It must not be changed but may be used.

** w63 is from the Adventure Cave script and may not otherwise be modified.

** w80 must not be modified by other scripts.

** The other variables may be used elsewhere, but get trashed by this code.

** Functions Used: 840-848

--------> ADVENTURE CAVE (script30.erm)

Author: Donald

ERM WoG Option Numbers: 30

Object Used: Type 63, Subtype 57 (Cave with Spider Web and Skulls )

** Variables Used: z326-z330, z360-z366, z368-z379, z404, v510-v548, v550-v559, v600-v669, v1263-v1265, w61-w78, i, v510-v548, w61-w74, and z404 must not be changed elsewhere!, v550-v559 is a bit table also used by the map rules, it must not be changed but may be used elsewhere.

** The other variables may be used elsewhere but will be trashed by this code.

** Flags used: 2, 600-603

** Functions Used: 730-776, 780-799, 820-835

** Timers Used: 90

--------> TREASURE CHEST 2 (script31.erm)

Author: Timothy

ERM WoG Option Numbers: 31

Object Used: new Chest (Type 101, Subtype 5)

Flags used: 1-2, 409, 1000

Variables used: v1-v6, z1-z5, w52-w54, w64 (check only)

Timers used: 28

Functions used: 5200-5208, 5210-5211

Note: Function 5209 is used in the update of WoGify: script00.erm.

--------> SUMMONING STONES (script32.erm)

Author: Timothy

ERM WoG Option Numbers: 32

Object Used:  Type 63, Subtype 21 (Stone Circle)

Variables: v1-9, v234, 247, v360-370, v998-1000, v1211 z1-4, z480-494

All variables may be reused except z493 and z494 which store the hint text.

Flags: 1,2,4, 57 ("Week of Monsters" flag)

Functions: 5219-5229

Timers: 98

--------> LIVING SCROLLS (script33.erm)

Author: Timothy

ERM WoG Option Numbers: 33

Object Used: enhances Spell Scrolls (Object 93)

Variables Used: v1-v6, z1-z2, v1218, v1220-v1235, v1257, v9300

Functions Used: 5244-5255, 5260-5262

--------> CARDS OF PROPHECY (script34.erm)

Author: Matthew

ERM WoG Option Numbers: 34

Object Used: enhances Cards of Prophecy artifact (47)

** flags used: 270,271

** z-variable usage: 698, 134001-134025

** v-variable usage: 1300-1327, 1332-1335

** Function usage: 13500-13507

--------> MYSTICISM SKILL ENHANCEMENT (script35.erm)

Author: Anders

ERM WoG Option Numbers: 35

Object Used: none

Variables used: (v1-v10), (z1-z9), z800-z803, [z135000-z135177]

Flags: (1-10), 56, 172, 173, 412

Functions: FU8150-FU8165

Timers: TM30

--------> MITHRIL (script36.erm)

Author: Anders

ERM WoG Option Numbers: 36

Object Used: Mithril resource (Type 79, Subtype 7) and also used with towns, mines, windmills,

shipyards, liths, and water wheels.

Variables used: (v1-v6), (z1-z9), z805-z815, [z136000-z136058]

Flags:  (1, 9, 10), 172, 410, 870-874

Timers: TM99

Functions: FU709, FU8170-FU8188

Sets up PO:N numbers at Mine, Water Wheel and Windmill entrance squares.

--------> REBALANCED FACTIONS (script37.erm)

Author: Steven

ERM WoG Option Numbers: 37

Object Used: none

Variables used: v1, v346, v1500, z100-z103

Functions: 4850

Timers: 31

--------> KARMIC BATTLES (script38.erm)

Author: Dieter

ERM WoG Option Numbers: 38

Object Used: none

** Variables Used: v490-v492, w49

** Flags Used: 490

** Functions Used: FU491-FU494

** Variables v490,v491 and Flag 490 must not be modified by other programs!

--------> HERO SPECIALIZATION BOOST (script39.erm)

Author: Alexis

ERM WoG Option Numbers: 39

Object Used: none

Variables: v425-v444, v9001, w28-w32, z405-z406

Functions: FU803-FU808, FU836-FU838, FU850-FU852

Flags: 428, 429, 430

Timers: 77

--------> FIRST MONEY (script40.erm)

Author: Alexis

ERM WoG Option Numbers: 40

Object Used: none

Variables: v428-v429

Timers: 78

--------> BATTLE EXTENDER (script41.erm)

Author: Alexis

ERM WoG Option Numbers: 41

Object Used: none

Variables: v425-v427

Functions: FU809,839

** IMPORTANT NOTE **

Scripts listed after 41 (plus script19.erm) are NOT part of WoG 3.57f but are currently being worked on (and variables reserved). They will be part of WoG 3.58 or they may be made available earlier if we release a tested script update prior to 3.58.

** IMPORTANT NOTE **

--------> GARRISONS (script42.erm)

Author: Timothy

ERM WoG Option Numbers: 42

Object Used: Garrisons (Types 33 and 219, Subtypes 0 and 1)

Variables: v1-v9, z1-z5, v1236-v1239, v1253-v1254

Functions: 10850-10862

Timers: 19 (shared with WoGify), 48

Dialogues: 88

--------> SUPPORT (script43.erm)

Author: Alexis

ERM WoG Option Numbers: 43

Object Used: none

Variables: z432-439, v425-435

Functions: FU853-858

Flags: 431

--------> EMERALD TOWER (script44.erm)

Author: Timothy

ERM WoG Option Numbers: 44

Object Used:  Type 63, Subtype 65 (Golden-green roofed Tower)

Permanent Variables: z816-z841, v1240-v1252 (v1255 used by script06.erm)

Temporary Variables: v1-v6, v360-v369, z1-z5, z480-z490

Functions: 10900-10910

Timers: 38

Dialogues: 3

--------> ADDITIONAL UPGRADES (script45.erm)

Author: Alexis

ERM WoG Option Numbers: 45

Object Used: none, but used inside towns (Object 98)

Variables: v425-v429, v1600-v1983

Flags 432, 433

Functions: FU859-869

Timers: TM82

--------> REBALANCING PRICES (script46.erm)

Author: Alexandru Balahura

ERM WoG Option Numbers: 46

Object Used: none

Variables: none

Functions: FU950

--------> HATREDS (script47.erm)

Author: Matthew

ERM WoG Option Numbers: 47

Object Used: none

Timer 13

v-vars: 1340-1357

flags: 130-132 (possibly will be using flag 133 as well but not sure yet)

Functions 13520-13525

--------> ENHANCED SECONDARY SKILLS (script48.erm)

Author: Arstahd

ERM WoG Option Numbers: 48

Object Used: none

Variables used: s r

V Variables used: v7020-v7053, v7186-v7197

Z Variables used: z1-z3, z700-z706, z710-z728, z732-z752

Y Variables used: y1-y11

W Variables used: w90-w94

Functions used: 7000-7025

Timers used: 50, 51

Flags used: 1, 2, 70-72

--------> ENHANCED ARTIFACTS (script49.erm)

Author: Arstahd

ERM WoG Option Numbers: 49

Object Used:

Variables used: ?

--------> ENHANCED MONSTERS (script50.erm)

Author: Arstahd

ERM WoG Option Numbers: 50

Object Used: none

Variables used: i, v7000-v7010, v7183 y1-y9

Flags used: 75-77

Functions used: 7060-7066

--------> ENHANCED COMMANDERS (script51.erm)

Author: Arstahd

ERM WoG Option Numbers: 51

Object Used: none

** Variables used:  v7080-v7087, v7185, y1-y9

** Functions used: 7070-7073

** Timers used:  none

--------> ??????  (script52.erm)

Author: Sir Four

ERM WoG Option Numbers: 52

Object Used:

Variables used: ?

--------> WISHING VAULT (script53.erm)

Author: Anders

ERM WoG Option Numbers: 53

Object Used:

Variables: (v1-v10), (v600-v684) (though fewer may actually be needed), v165, (z1-z5), z380-z381

Flags used: (1-10)

Functions: FU8200-FU8227;

Timers: TM30

--------> WAR MACHINES (script54.erm)

Author: Bonizag

ERM WoG Option Numbers: 54

Object Used: none

Variables used: v850-v859, v862-v880 for long term, v1-v3, v7800-v7956 temporarily, z1-z3, z78-z90 temporarily, w81-w83 for long term

Flags used: 784-790 for long term, 2, 3, 4 temporarily

Timers: TM41

Functions: FU7795-FU7820

PO Numbers used: H (for towns and war machine factories), O for owner of war machine factory

--------> SUMMON ELEMENTALS (script55.erm)

Author: Bonizag

ERM WoG Option Numbers: 55

Object Used: none

Variables used: w84, v860-v861, v881-v882, v7600-v7756, v1 temporarily

Flags used: 791

Functions: FU7821-FU7824

Timers: TM42

--------> DEATH CHAMBER.ERM (script56.erm)

Author: Rich Reed

ERM WoG Option Numbers: 56

Object Used:  Type 63, Subtype 15 (Skull Pile)

Variables used:

Flags used:

Functions:

Timers:

--------> NEUTRAL UNITS (script57.erm)

Author: Alexandru Balahura

ERM WoG Option Numbers: 57

Object Used:  none

Variables used: v100

Flags used: none

Functions: FU1000

Timers: none

--------> ESPIONAGE (script58.erm)

Author: Petyo

ERM WoG Option Numbers: 58

Object Used:  none

Variables used: v2100-v2107, v2110-v2112, v2200-v2208

z101 (may be a conflict with Rebalanced Factions), z250-z265, z270-z279, w51,w55-w59, f-p,

Flags used: 32, 33

Functions: FU266-FU278

Timers: 57

Dialogues: 11

--------> SCRIPTLETS (script59.erm)

(Includes: Anti-Coward, Berserker Fly, Witch Hut, Choose Commander, Stablemaster)

Authors: Petyo (Anti-Coward), Timothy (Berserker Fly, Choose Commander), Dieter (Witch Hut),          Diemios (Stablemaster)

ERM WoG Option Numbers: 59

Object Used:  Stablemaster enhances object 94, Witch Hut enhances object 113

Variables used:

   Anti-Coward: v421-v422

   Berserker Fly: v295-v299

   Witch Hut: v145-v147

   Choose Commanders: v2-v5 (temporary), z2, z22-z31 (temporary)

Flags used:

   Berserker Fly: 298, 299

   Witch Hut: 145-147

Functions:

   Berserker Fly: FU19000

   Witch Hut: FU146-FU148

   Choose Commander: FU18

   Stablemaster: FU960

--------> POUCH (script60.erm will be script17.erm - merging with potion script)

Author: Robert

ERM WoG Option Numbers: 60

Object Used:

** Permanent Variables Used: w1-w12, z18, z20, v747-v761

** Temporary Variables Used: v1-v10, v13-v14, v747-v749, z1-z9, z47-z61

** Functions Used: FU200-FU209, FU300-FU301

** Reserved: FU210-FU265, FU279-FU299

** Dialogues: 100

--------> PROTECTION FROM THE ELEMENTS (script61.erm)

Author: Petyo

ERM WoG Option Numbers: 61

Object Used:  none

Variables used:

Flags used:

Functions:

Timers:

Dialogues:

--------> REBALANCED UNITS AND TOWNS (script62.erm)

Author: Alexandru Balahura

ERM WoG Option Numbers: 62

Object Used:  none

Variables used:

Flags used:

Functions:

Timers:

--------> PASSABLE TERRAIN (script63.erm)

Author: Timothy

ERM WoG Option Numbers: 63

Object Used: none

Permanent Variables: v1270

Temporary Variables: v1-v4, z1

Functions: FU14001-FU14008

--------> TOBYN'S SCRIPTS (script64.erm)

Author: Tobyn

ERM WoG Option Numbers: 64

Object Used: none

Permanent Variables:

Temporary Variables:

Functions:


Instructions list
instructions for multiplayer script supporting


ERM instructions

Instructions list

Instructions for multiplayer (MP) script supporting.

1. There are two different ways when script may cause problems in a battle:

  - Human attacks Human battle (through a network);

  - AI attacks Human on another PC (a battle runs at that PC).

  These two cases are different.

  Let us see it.

2. Human (PCA) attacks a Human on other PC (PCD).

  The sequence is the next:

  1. PCA: a hero runs up to an enemy hero/town and attack.

  2. PCA: !?BA0; trigger section runs.

  3. PCA: !?IP0; trigger section runs.

  4. PCA: data transferred to PCD side including:

     - Attacking   Defending Heros info (SoD);

     - Both Heroes' Commanders info (WoG);

     - Changed Monsters statistics (WoG);

     - v9001...v10000 vars values (WoG).

  5. PCA: goes to a battle screen.

  6. PCD: Meantime the sent info arrived:

     - Attacking   Defending Hero info (SoD);

     - Both Heroes' Commanders info (WoG);

     - Changed Monsters statistics (WoG);

     - v9001...v10000 vars values (WoG).

  7. PCD: !?IP1; trigger section runs.

  8. PCD: !?BA50; trigger section runs.

  9. PCD: goes to a battle screen.

  10. ***** Now the battle runs *****

     If Attacker wins:

  11. PCA: !?BA1; trigger section runs.

  12. PCD: !?BA51; trigger section runs.

     If Defender wins:

  11. PCD: !?IP2; trigger section runs.

  12. PCD: data transferred to PCA side including:

     - Defending Hero only info (SoD);

     - Defending Hero's Commander info (WoG);

     - v9001...v10000 vars values (WoG).

  13. PCD: !?BA51; trigger section runs.

  14. PCA: Meantime the sent info arrived:

     - Defending Hero only info (SoD);

     - Defending Hero's Commander info (WoG);

     - v9001...v10000 vars values (WoG).

  15. PCA: !?IP3; trigger section runs.

  16. PCA: !?BA1; trigger section runs.

This may look very complex, though, here is the sketch:

--------------------------------------

  Attacker                  Defender

  Human                     Human

--------------------------------------

  !?BA0;

  !?IP0;

   ---HA,CA,HD,CD,v9001-v10000-->

                            !?IP1;

                            !?BA50;

   ********** Battle *************

   Win                       Lost

  !?BA1;                    !?BA51;

--------------------------------------

or:

--------------------------------------

  Attacker                  Defender

  Human                     Human

--------------------------------------

  !?BA0;

  !?IP0;

   ---HA,CA,HD,CD,v9001-v10000-->

                            !?IP1;

                            !?BA50;

   ********** Battle *************

   Lost                      Win

                            !?IP2;

   <---HD,CD,v9001-v10000--------

  !?IP3;                    !?BA51;

  !?BA1;

--------------------------------------

3. AI (PCA) attacks a Human on other PC (PCD).

  The sequence is the next:

  1. PCA: an AI hero runs up to an enemy hero/town and attack.

  2. PCA: !?BA0; trigger section runs.

  3. PCA: !?IP0; trigger section runs.

  4. PCA: data transferred to PCD side including:

     - Attacking   Defending Heros info (SoD);

     - Both Heroes' Commanders info (WoG);

     - Changed Monsters statistics (WoG);

     - v9001...v10000 vars values (WoG).

  5. PCA: goes to "wait until battle ends" screen.

  6. PCD: Meantime the sent info arrived:

     - Attacking   Defending Hero info (SoD);

     - Both Heroes' Commanders info (WoG);

     - Changed Monsters statistics (WoG);

     - v9001...v10000 vars values (WoG).

  7. PCD: !?IP1; trigger section runs.

  8. PCD: !?BA50; trigger section runs.

  9. PCD: goes to a battle screen.

  10. ***** Now the battle runs at PCD side only *****

     No mater who wins:

  11. PCD: !?BA51; trigger section runs.

  12. PCD: !?IP0; trigger section runs.

  13. PCD: data transferred to PCA side including:

     - Attacking   Defending Heros info (SoD);

     - Both Heroes' Commanders info (WoG);

     - Changed Monsters statistics (WoG);

     - v9001...v10000 vars values (WoG).

  14. PCA: Meantime the sent info arrived:

     - Attacking   Defending Heros info (SoD);

     - Both Heroes' Commanders info (WoG);

     - Changed Monsters statistics (WoG);

     - v9001...v10000 vars values (WoG).

  15. PCA: !?IP3; trigger section runs.

  16. PCA: !?BA1; trigger section runs.

The sketch:

--------------------------------------

  Attacker                  Defender

  AI                        Human

--------------------------------------

  !?BA0;

  !?IP0;

   ---HA,CA,HD,CD,v9001-v10000-->

                            !?IP1;

                            !?BA50;

   ********** Battle *************

  Win/Lost                  Win/Lost

                            !?BA51;

                            !?IP0;

  <---HA,CA,HD,CD,v9001-v10000---

  !?IP3;

  !?BA1;

--------------------------------------


Format CC

Commander Classes

#	Hero	Commander
0	Knight; Cleric	Paladin
1	Ranger; Druid	Hierophant
2	Alchemist; Wizard	Temple Guardian
3	Demoniac; Heretic	Succubus
4	Death Knight; Necromancer	Soul Eater
5	Warlock; Overlord	Brute
6	Barbarian; Battle Mage	Ogre Leader
7	Beastmaster; Witch	Shaman
8	Planeswalker; Elementalist	Astral Spirit


Receiver !!PM

Options Legend

The PM Receiver has a dual purpose. It's used to set or check the spell reward for defeating the guardians of a pyramid but is also a command that can be used to help attract the AI to new objects, or conversely to keep the AI from visiting them.

These are the objects listed in the WoG Objects section of this help file.

The AI will try to visit an object (Pyramid) if:

 1. It has enough power to beat guards.

 2. It has enough wisdom to learn a spell there.

 3. If this object is NOT visited by any player.

 4. If this object is NOT visited by this player.

We cannot control 2 first conditions but we can set 2 others.

!!PM:XXXX;

Pyramid or any New Object.

You can use V command to "attract" AI to a New Objects (and Sphinx also).

You can set this bit and wait until the AI comes.

Comments:

You can use the V command to "attract" the AI to New Objects (and Sphinx also).

You can set this bit and wait until the AI comes. If you catch it by !!OB receiver, disable the object, reset V bit and set P bit, you can make AI not have a battle and get a spell. So to attract the AI set the V flag. To free the AI, reset V and set P flag.


Options list for !!PM receiver
P#1/$1 S/C/G a "visited by player" flag

S S/C/G a bonus spell

V$ S/C/G a "not visited" flag


Options for !!PM receiver

Options list Legend

P#1/$1

Set/check/get a "visited by player" flag.

   #1 - Color of the visitor (See Format E1).

   $1 - State of visit

         0 - Not visited

         1 - Visited.

S

Set/check/get a bonus spell (AI will get it if it wins the "Pyramid" battle).

   $ - Spell number (Format SP).

V$

Set/check/get a "not visited" flag.

   0 - Visited,

   1 - Not visited.


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/