UNIVERSAL
COMMANDS
(UN)
RECEIVER
Used for universal commands that make changes to the map and/or game.
Universal commands. These commands relate to changes on the heroes map. |
OPTIONS
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/set
an artifact's info |
||||||||||||||||||
A;![]() (Combo) |
Extended UN:A command syntax for Combination Artifact management Combination artifact management: !!UN:A#/$/#1/#2 {/#3/#4/#5/#6/#7/#8/#9/#10/#11/#12/#13/#14}; Build/remove a Combo Art. # - Combo index (0...31) $ - set/check/get Combo Art Num (0...MaxArtNum) #1 - Part 1 of Combo art #2 - Part 2 of Combo art #3 - Part 3 of Combo art (optional) . . #14 - Part 14 of Combo art (optional) Results. Combo art is set up. If successful ERM Flag 1 is set to 1 otherwise to 0. Comments. 0. You may use an instruction syntax !#UN:A 1. All Combo settings are kept in a specific table. This table is extended up to 32 entries. So we can have up to 32 combo arts. All standard combos are already in the table (first 12 entries). 2. You may check whether the table entry is empty or not: !!UN:A5/?v100/0/0; Get the combo art number in an entry 5 of a Combo Table to v100. Two zeros in the end is needed to have at least 4 parameters. In a check/get syntax extra (zeros) parameters are ignored. NOTE. The empty entry in the Combo table keeps a combo art number 0. So in an example above, v100 will have 0 if the entry is empty and you can use it. You may delete a combo art without adding a new one. Use Combo Art number 0 to do it. Example: !!UN:A5/0/0/0; First 0 means remove Combo info in entry 5 of the combo table. The next two zeros are just to make sure that we have 4 parameters, no less. Important: only artifacts with an index below 160 may be a part of a Combo artifact although any artifact be used for the assembled combination. |
||||||||||||||||||
B; | Remove a description/hint for an object | ||||||||||||||||||
B#/$; | Set operation or
new chests and Mithril # = Type 0 - Mithril 1...6 - new chests $ = Operation (0-standard,1-advanced) The new Chests ![]() ![]() ![]() ![]() ![]() ![]() The new resource : Mithril ![]() Comments: For all new chests (type 101, subtype 1...6) 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 disappear after being taken. For Mithril (type 79, subtype 7) standard operation means that when you (or AI) pick it up, you will get a 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 Mithril will be added to the Mithril stock of the player and you can check and set it with UN:R#/7/$. Both work for human or AI. The AI treats Mithril as gold when deciding to pick it up or not. |
||||||||||||||||||
B7..10/$;![]() |
Extended UN:B
commands for new Commander Stones Comments: type is 101. subtypes:
1) Non-WoGified WoG Map without ERM, WoG Options set to Commanders Disabled, *or* Non-WoGified WoG Map with Commanders enabled by ERM, Power Stones disabled by ERM (!#UN:P3/0; and !#UN:B7/0; !#UN:B8/0; !#UN:B9/0; !#UN:B10/0;). *or* WoGified Map with Commanders disabled through WoG Options, Power Stones option enabled or disabled. Result: Power Stones act as standard treasure chests. 2) Non-WoGified WoG Map without ERM, WoG Options set to Commanders Enabled, *or* Non-WoGified WoG Map with Commanders enabled by ERM (!#UN:P3/0), Power Stones enabled by ERM or NOT disbled by ERM (!#UN:B7/1; etc. -- the default for Power Stones is enabled if no UN:B commands for them is inclued). *or* WoGified Map with Commanders Enabled through WoG Options, Power Stones option option enabled or disabled. Result if hero has a live Commander: Commander gains bonus from Power Stone. Result if hero has a dead or no Commander: Option to destroy Power Stone or leave it. 3) Non-WoGified WoG Map with Commanders disabled by ERM (!#UN:P3/1;). Result: Power Stones act as more valuable treasure chests (up to 7500 gold/7000 exp.). |
||||||||||||||||||
C#1/#2/$; |
Write/Read an integer at address |
||||||||||||||||||
D#1/#2/#3; |
Make a square of water passable for hero |
||||||||||||||||||
D#1/#2/#3/$; | Additional syntax for D
commands: Place/remove path (logs) over water $ means place (1) or remove (0) logs |
||||||||||||||||||
E#1/#2/#3; |
Check where to place an object. |
||||||||||||||||||
F$1/$2/$3/$4/$5; | Provoke a fire (if possible) $1 = x $2 = y $3 = l $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' 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) (see Format SS) #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 will be restored if you visit a local event at 8/5/0. |
||||||||||||||||||
G1/#1/#2/$; |
Change Monster names. #1 - Number of Monster (see Creature Format) #2 - Type of text 0 - Singular name 1 - Plural name 2 - Specialty text 3 - Def file name (in battle, e.g. 'CGTITA.DEF') 4 - Sound prefix (4 first letters in sounds, e.g. 'gtit') $ - z variable (or its number) that keep the new text 0 means restore original |
||||||||||||||||||
G2/#1/#2/#3;
![]() |
Set the text and
picture for hero specialities. #1-number of hero.(see Format H) #2- set 1-small specialty picture (seen in hero meeting screen, etc.) 2-specialty description text 3-standard speciality picture See Format HS for specizlity pictures. #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. Help additions: UN:G2 description in erm_help is wrong #2 = 0: Speciality name. It's "Griffins" for Edric #2 = 1: Long speciality name. It's "Creature Bonus: Griffins" for Edric However, I have no idea where these strings are used in the the game. :) (only know that speciality name is used in Advanced Options on map start, but maybe somewhere else too) Small speciality picture is always the same as the normal one. |
||||||||||||||||||
H#1/#2/#3/#4/#5; |
Hide part of the map (round area) |
I#1/#2/#3/#4/#5... up to 9 parametres | Place an object. #1 = x #2 = y #3 = Level #4 = Type of object (see Format OB) #5 = Subtype of object If you use only 5 parameters you cannot set another terrain type and cancel redraw (terrain=-1, redraw=1) #6 = Terrain type (see Format TR) #7 = Redraw needed (1) or not (0) Additional syntax: You can place an object which functions as object type/subtype but looks like an object type2/subtype2. If you do so then: #1 = x #2 = y #3 = Level #4 = Type of object (see Format OB) #5 = Subtype of object #6 = Type2 of object to look like (see Format OB) #7 = Subtype2 of object to look like If you use only 7 parameters you cannot set another terrain type and cancel redraw (terrain=-1, redraw=1) #8 = Terrain type (see Format TR) #9 = Redraw needed (1) or not (0) |
||||||||||||||||
J0/#/$; | Disable spells # - number of spell 0...69 (see Format SP) $ - 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. |
||||||||||||||||||
J1/$1/$2;![]() |
Set/check/get
a hero level limit for a map $1 is a level limit (you can set/check/get it) $2 is an XP amount for this level Comments: Whenever you set or get the level value, the XP amount is always for the current level limit. So if you set the level, it will return an XP for this new just set level. So to set and meanwhile get the level and level XP, you can use one command: !!UN:J1/35/?y10; Here you set the level to 35 and get an experience for this level to y10. Untested ERA 2.9 Note: the experience values returned for parameter 2 are incorrect, and the command can cause Hero's experience to become negative! Use the Map Editor instead of this ERM command. |
||||||||||||||||||
J2/$;![]() |
Set,
check or get a difficulty level chosen by player Set, check or get a difficulty level chosen by player. If you set the level it may not always keep its value later so use with caution. |
||||||||||||||||||
J3/$;![]() |
Load
an external file with WoGification settings With this command you can customize the way a map is wogified. The loaded setting will override the settings in the WoG Options screen. Syntax: !#UN:J3/^the path to the file^; The path may have a folders in relative or absolute path (based on the WoG folder), like this: ^MyOptions.xxx^ - a file in the Heroes home folder ^maps\opt.yyy^ - a file in the maps folder ^.\maps\opt.yyy^ - the same as above ("." means the current folder) ^C:\xxx.yyy^ - a file in the C: root folder ^..\mysets\set001.zzz^ - a file in mysets folder that is a child folder for the parent folder for the heroes home folder. |
||||||||||||||||||
J4/$;![]() |
Control AI "thinking" radius $ = 32000 is a SoD default = 4096 is a current WoG default This is not a number of squares to analyze, but is the total range of an AI hero based on its movement points and the terrain. For grass, one square of distance is about 100 points. This is not saved in the saved game. You can change this value at any moment, for example, making one AI player or even a specific hero more clever than another. Caution: if this value is set too low, an AI hero may just sit there and not move at all. |
||||||||||||||||||
J5/$;![]() |
Disable Autosave $ = 1 enable autosave $ = 0 disable autosave Comments: The state of disabling won't be saved in a save game file, so if you need autosave to remain disabled, you should also put this command after a Load Game trigger (!?GM0). In most cases it isn't advisable to disable the autosave, because the autosave provides an important backup for the player in case anything goes wrong. |
||||||||||||||||||
J6/#/$;![]() |
Generate a random artifact # - (set) artifact level (-1=random, 1=no class, 2=treasure, 4=minor, 8=major, 16=relic) $ - (get/check) random artifact of a level Comments: This function returns only enabled artifacts. Artifact level 1 includes The Grail, Spell Book, Spell Scroll, and all War Machines. Example: !!UN:J6/2/?v10; - get a random Treasure artifact to v10 You can add level numbers together to cover several classes. e.g., 18=treasure & relic. If you generate more than one random artifact number from the same trigger, the artifact numbers will be unique, so you can be assured of getting a selection of different artifacts without duplicates. |
||||||||||||||||||
J7/#/$;![]() |
Control a town's Artifact Merchant # - slot index (0...6) $ - artifact in the slot Comments: You may use set, get or check syntax. -1 means no artifact. Example: !!UN:J7/3/?v10; - get artifact in slot 3 !!UN:j7/v5/v20; - set artifact in slot v5 to v20 |
||||||||||||||||||
J8/$1/$2;![]() J8/$/^text^; ![]() |
Check if a file exists $1 - modifier $2 - index of z var (local, standard or extended from ERT) z[$2] or ^text^ - a file name (with possible path) Return: Flag 1 set to 1 if file exists otherwise 0. Modifiers: 0 - location is in Heroes home folder 1 - in DATA folder 2 - in MAPS folder 3 - in RANDOM_MAPS folder 4 - in GAMES folder 5 - in DATA\S folder 6 - in DATA\P folder 7 - in DATA\ZVS\LIB1.RES folder 8 - in DATA\ZVS\CMP.RES folder 9 - in ERM_HELP folder 10 - absolute path 11 - in MODS folder The main purpose of the modifier is to not worry about path. For example, you have a picture in a script folder. Now this is DATA\S but later we can transfer them to other folder. Using the modifier you need not know exactly where the script folder is located, you just need to use a modifier 5. Example: UN:J8/1/^mypic.bmp^ - checks for ..\DATA\mypic.bmp UN:J8/1/^P\mypic.bmp^ - checks for ..\DATA\P\mypic.bmp UN:J8/2/^mypic.bmp^ - checks for ..\MAPS\mypic.bmp Modifier 10 - an absolute path. With this modifier, the file name is the exact name with possible path. Example. If the modifier is 10 and the name is "Hello.txt", the file will be searched for in the current folder. Current folder for Heroes is most probably a Heroes home folder. If the name is "C:\Hello.txt", the file will be searched for in the root of disk C: |
||||||||||||||||||
J9/$1/$2;![]() |
Get a path for a file This command gets Heroes 3 paths so you can create a full path for a file if you need, taking into account a particular player's Heroes folder location. !!UN:J9/$1/$2; The command gets a corresponding path to a z variable. $1 - modifier (the same as for UN:J8) $2 - index of z var (local or standard) Example: It copies an absolute path to the z variable. Say we have heroes installed to C:\HOMM\WOG, the command UN:J9/2/10 will copy to z[10] the next path: "C:\HOMM\WOG\". You can just add a name of file you want to use and then use it in any way you want. |
||||||||||||||||||
J10;![]() |
Output variables to WOGERMLOG.TXT Use UN:J10 command at any time (writes all non-zero variables to a file). The log will be stored in WOGERMLOG.TXT. |
||||||||||||||||||
J11/$;
![]() |
Don't understand this one, sorry $ is a flag that allows to stay on a battle screen a right mouse click stack info dialog (0, default) or work a standard way like in SoD (1). This flag is stored in saved game, so you can set it once per a game. |
||||||||||||||||||
J12/z#;
![]() |
Get map file name z# - z-var to store the name (z-1...z-10, z1...z1000) If you want to use a different INI file for different map, you may now check the map name. |
||||||||||||||||||
K#/$; | Set up *new week* property. K1/$ - disable ($=1) all *week of ...* (monster +5, Imp*2) or enable ($=0) as usual. K2/$ - set 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 does 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 behaviour M1 - Disable weeks of monster*2 and all/2 M2/$ - Set up a week of $ monster (monster*2) (see Format C) M3 - Set up a week of plague (all/2) Comments: * 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 |
||||||||||||||||||
N0/z
var index/$; N1/z var index/$; N2/z var index/$1/$2; N3/z var index/$1/$2; N4/z var index/$; |
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/zvarind/$; - name of artifact ($=artifact number) (see Format A1) N1/zvarind/$; - name of spell name ($=spell number) (see Format SP) N2/zvarind/$1/$2; - name of building ($2) (see Format U) inside town type ($1) (see Format T) N3/zvarind/$1/$2; - name of monster ($1=monster number) (see Format C) in singular ($2=0) or plural ($2=1) N4/zvarind/$; - name of secondary skill ($=skill number) (see Format SS) 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=^; |
||||||||||||||||||
N5/#1/#2/#3/#4;![]() |
Write z variables to an external file
Write z variable to wog.ini file [common] section: !!UN:N5/#1/#2/#3/#4; - save z string to wog.ini file #1 - z var index of string to write string data from #2 - option index (any positive value) #3 - (optional parameter) z var index of user-defined section to use instead of [common] #4 - (optional parameter) z var index that keeps the filename (without ".INI" part) with possible path. Note: if you include parameter 4, you must also include parameter 3. | ||||||||||||||||||
N6/#1/#2/#3/#4;![]() |
Read z variables from an external file
Read z variable from wog.ini file [common] section: !!UN:N6/#1/#2/#3/#4; - load z string from wog.ini file #1 - z var index of string to load string data into #2 - option index (any positive value) #3 - (optional parameter) z var index of user-defined section to use instead of [common] #4 - (optional parameter) z var index that keeps the filename (without ".INI" part) with possible path. Note: if you include parameter 4, you must also include parameter 3. Comments: You may save and load regular or local z variables. Option index should be unique to a save/load procedure (one option number per z variable). So if you save a z var as an option 123456, you need to load the saved value (to any other z var) using the same option 123456. The value is not stored in a saved game but is stored in an external INI file (wog.ini, if parameter 4 is omitted). You may use these commands without problem in instructions. So to store a variable z-1 named "The_Main_Var" in a file "My.var" in GAMES folder (section "MyLocalSettings"), with option index 4, use: !!VRy1:S4; !!VRz-1:S^The_Main_Var^; !!VRz-2:S^MyLocalSettings^; !!VRz-3:S^GAMES\My.var^; !!UN:N5/z-1/y1/-2/-3; | ||||||||||||||||||
O$1/$2/$3; | Delete an object. $1 = x $2 = y $3 = Level Comments: For this command, x, y and level refer to the lower right corner of the object and not to the trigger square. Sometimes this square will not even appear to be part of the object, so it's best to check in the editor; click once on the object and look for the white rectangle that appears around it--the lower-right square in this rectangle is the square that x/y/l refers to. |
||||||||||||||||||
O$1/$2/$3/h; | Delete object at x/y/l and a
description/hint (if was set). h = 1 - delete description/hint h = 0 - do not delete For the style Ox/y/l description/hint will not be deleted (h=0). |
||||||||||||||||||
P$; | Setting lvl8 dwellings
behaviour $ =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 (0..999) $ - Option state Comments # = 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) See below for more info. # = 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), all Heroes 3 but ASK before (3) # = 6 and $ = Heroes start with Commanders (0) or they must be hired (1) # = 7 and $ = Dwelling accumulation enabling(1)/disabling(0) # = 8 and $ = Guards accumulation enabling(1)/disabling(0) # = 9 and $ = Sylvan Centaur creation enabled (1) or disabled (0) # = 10 and $ = Troop Stacks left will rejoin (1) or won't rejoin (0) their owner # = 900 and $ = Stack Experience Disabled (0) or Enabled (1) # = 901 and $ = Stack Experience System (0..3) # = 902 and $ = can (1) or cannot(0)leave artifact on the map # = 903 and $ = cheating is enabled (0) or disabled (1) # = 904 and $ = Error message enabled (0) or disabled (1) # = 905 and $ = If error occured, $ set to 1 regardless of P904 # = 906 and $ = Enable(0) or disable (1) gaining of stack experience in battle Comments: Both WoGified and Non-WoGified WoG maps with no scripts will use the WoGify Options selected for enabling or disabling the features above. 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. # = 9 and $ = Sylvan Centaur creation enabled (1) or disabled (0) Comment If enabled, Sylvan Centaurs can be created for free by control-clicking on a stack of Centaur Captains or Grand Elves in the Hero screen (does not work in any other screen). An equal number from both stacks is replaced with Sylvan Centaurs. Thus 10 Grand Elves plus 10 Centaur Captains equal 10 Sylvan Centaurs. Note: Sylvan Centaurs start at 0 experience and do not keep any stack experience that the Centaur Captains or Grand Elves had before combining. # = 10 and $ = Troop Stacks left will rejoin (1) or won't rejoin (0) their owner. Comment If enabled, troop stacks left by right-clicking will rejoin their owner when they're "attacked" by that player. Note: all previous stack experience is lost when a troop stack is left by right-clicking. # = 900 and $ = Stack Experience Disabled (0) or Enabled (1). If enabled, troop stacks lead by a hero gain experience if they win the battle. Experience is equal to the experience the hero gains from the battle. When it gains enough experience, a troop stack will gain a rank and may gain bonuses to attack, defense, damage, speed, health, and special abilities. If you combine two experience stacks, their experience is averaged. Each stack can improve up to rank 10. Right-click on a stack's portrait in its info screen to see its current stack experience details. # = 901 and $ = Stack Experience System: $=0 - Equal shares and each creature gains full experience. $=1 - Weighted Shares: Lower level creatures gain more than higher level creatures. $=2 - Weighted Shares: Higher level creatures gain more than lower level creatures. $=3 - Equal shares: divided by all creatures. Note: the stack experience system is currently tested with option 0 (the default). Other options were earlier attempts at finding the best system to use, but although rejected, they have been left in place in case anyone wishes to experiment with them anyway. If you do want to try another system (UN:P1..UN:P3), you'll need to also set a higher experience multiplier using the EA:H command for humans, and EA:A (possibly also EA:S and/or EA:T) for AI players since experience is divided by all creatures in the battle and thus significantly lower. # = 902 and $ = can (1) or cannot(0)leave artifact on the map. This lets you enable leaving of artifacts from a hero's backpack by right-clicking on an empty map square. This is done in the same way that you leave troops. You may use an old option 2 (may not leave troop) and a new 902 (may leave artifacts) together:
# = 903 and $ = cheating is enabled (0) or disabled (1) Disables the cheat codes and menu (if normally enabled). If the cheat menu is enabled, it will still appear (even if disabled with this option), but clicking on menu items has no effect. Note: Although cheat codes do not normally work in multiplayer games, this option will prevent players using the cheat codes and menu by loading saved games in single player mode. # = 904 and $ = $=0 - Error message shown as normal and P905 is set to 1 if an error occurs $=1 - Error messages are disabled but P905 is set to 1 if an error occurs. This is ERM Error message disabling feature. If it is 1, all error messages are disabled, but if any error happens, option 905 will be set to 1. If it is 0, the message will be shown as normal and option 905 will be set to 1. Moreover, if the messages are disabled, the execution of the script will not be interrupted (the current trigger section). So you may use "risky" commands. Example: !?FU... ... !!UN:P904/1 P905/0; disable error messages !!HE-1:N?v99; get default hero index to v99 !!UN:P905/?i; !!FU&i>0:E; leave if error If you use a standard version: !?FU... ... !!HE-1:N?v99; produces an error message if a default hero is undefined here. # = 906 and $ = Disable gaining of stack experience. $=0 - creatures may gain stack experience from battles (if P900=1). $=1 - creatures may NOT gain stack experience from battles. If you set it to 1 and the stack experience system is enabled, stacks will not gain experience from battles, but you can still give stack experience with ERM. |
||||||||||||||||||
P3/#; | Commander enabling/disabling
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. |
||||||||||||||||||
P7/#; | Dwelling
accumulation enabling /disabling New hard coded 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. |
||||||||||||||||||
P8/#;
![]() |
Guards
accumulation enabling/disabling New hard coded 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.. |
||||||||||||||||||
Q#; Q$1/$2; ![]() |
Win or lose the game for
CURRENT player. # = 0 to lose the game # = 1 to win If you use a dummy second argument, it will Win or Lose the game using a different function than before. So if you found any problems with the old function, try with the new one instead. Example: !!UN:Q0/1; to lose (for current player) !!UN:Q1/1; to win (for current player) |
||||||||||||||||||
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). |
||||||||||||||||||
R4/#;![]() |
Redraws town
screen. Comments: This command must only be used while inside a town screen or it may crash the game. It is primarily of use if a new visiting or garrison hero is added to a town (with ERM while in the town screen), or if new troops are added to a visiting or garrison hero (again, with ERM while in the town screen). |
||||||||||||||||||
R5/$1/$2;![]() |
Set the appearance of the mouse pointer $1 - mouse pointer type (0..4, see Format PM) $2 - mouse pointer subtype (0..[depends on type]) Comments: Displaying any dialog restores the pointer to an arrow. If you set a pointer to any shape, it will be restored to a default pointer if you move it unless you disable pointer changing with the UN:R7 command. |
R6/$;![]() |
Set the delay $ - delay, ms (1000 ms = 1 second) |
R7/$1/$2;![]() R7/$; ![]() |
Control mouse pointer Some more commands for mouse control. !!UN:R7/$1/$2; may be !!UN:R7/$1; $1 - show (0) / hide (1) mouse pointer $2 - enable (0) / disable (1) later pointer changing Comments: When you visit some objects (like fishing well) when !?OB trigger works out, the mouse pointer IS disabled. So to be sure that when your long script works with hourglass pointer, you may turn it ON manually. Then if you disable pointer changing, it prevents the pointer from changing until: - starting a new game; - loading a game; - any standard message appears (may be with ERM); - any extended WoG dialog shown. So for fishing well, it may be: !!UN:R5/1/1; !!UN:R7/0/1; then if you want to show a message or a question: !!IF:M... disable pointer changing again: !!UN:R5/1/1; !!UN:R7/0/1; until the end of the script where you can enable pointer changing again: !!UN:R7/0/0; |
||||||||||||||
S#1/#2/#3/#4/#5; | Open (show) part of the map
(round area) #1 = X #2 = Y #3 = L #4 = Owner (Format E1) #5 = Radius |
||||||||||||||||||
T#1/#2/#3/$; |
Set a type of monster to
hire in towns. |
||||||||||||||||||
U#1/#2/?$1; | Calculate all objects on the
map #1 = Type of object (Format OB) #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 coordinates of an object #1 = Type of object (Format OB) #2 = Subtype of object (-1 = any) #3 = Number of object (1...final object number) #4 = Index of first v variable to store the coordinates i.e., v[#4]=x, v[#4+1]=y, v[#4+2]=l 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: (first) left to right (second) up to down (third) surface to underground This method requires to iterate through entire list of objects, skipping (#3-1) every time it is called. Decent if you need to reach specified object, but very slow in loops. If you want to do some operations on all objects of given type and subtype, relative method is MUCH faster. |
||||||||||||||||||
U#1/#2/-1/#3;![]() U#1/#2/-2/#3; ![]() |
Get coordinates of an object (relative method) #1 = Type of object (Format OB) #2 = Subtype of object (-1 = any) #3 = find NEXT (-1) or PREVIOUS (-2) object (see here for information) #4 = Index of first v variable to store the coordinates This is much faster version than previous method and preffered way to make loops. |
||||||||||||||||||
V?$1/?$2; | Gets the version of WoG and
ERM being used. $1 version of WoG (now 356 as 3.56) $2 version of ERM (now 250 as 2.50) 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 version and then display a message for the player at the start of the map that they have an older version of the Add-on (if they do). 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 |
||||||||||||||||||
V.../?$6/?$7;![]() |
Extended UN:V command to see if a player used cheat codes Now you can check also whether the cheat menu is enabled or disabled and check if a player has tried to use cheat codes during the game. !!UN:V?$1/?$2/$?3/?$4/?$5/?$6/?$7; $6 =1 if cheat menu is enabled and =0 if disabled. $7 =1 if the player used cheat codes till now, 0=no. Comments: 1. You may not enable or disable the cheat menu to be SHOWN but you may check it. 2. In multiplayer, neither cheat codes nor cheat menu works. 3. If you disable cheating, it works for keyboard codes and for cheat menu (even if it is enabled). |
||||||||||||||||||
W#1/#2/#3/#4/#5; |
Make a "line" of water
passable for hero |
||||||||||||||||||
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.^; |
Placing Objects (with I option):
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
Pyramid (type=63, subtype=0) - Receiver: !!PM
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) - (use the HE:P command to place a hero on the map instead)
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.
New faster method for U command (search object engine)
Now if you use a search object syntax UN:Utype/subtype/index/varindex you can set index to -1
or -2 (it was allowed to be 1...N before). A value of -1 means it will search for the next
object of a type, using the coordinates of the previously found object of the same type while a
value of -2 means the same but it will search for the previous object of a type on the map,
starting from the last coordinates.
In the standard syntax (index=1...N), UN:U is searching for each object from the beginning of
the map and skips them until the index object is found. Thus it is a long process on larger
maps, especially if there are a lot of objects of the specified type.
With the new syntax (index=-1 or index=-2) the coordinates returned in
v[varindex]/v[varindex+1]/v[varindex+2] are used, and a search for an object of the type
specified starts from the next square on the map for -1 or the previous square for -2, not from
the beginning. This means that the process should be faster, but it requires that you HAVE NOT
CHANGED the returned coordinates of the previous search in V vars.
Moreover, for the first (or last) object you should use a standard syntax OR you may set
V[xcoord] var to -1 for the first object or -2 for the last object (see examples below).
If you use -1 and -2 as an index of the object to find you may move forward and backward from
the current object. You may use them in any order.
Examples:
It works fine
!!UN:U53/-1/1/1; (get location of mine 1: v1/v2/v3)
...
!!VRv1:S99; (change v1 to anything)
...
!!UN:U53/-1/2/1; (get location of mine 2: v1/v2/v3)
It works WRONG!!! for v1 was modified
!!UN:U53/-1/1/1; (get location of mine 1: v1/v2/v3)
...
!!VRv1:S99; (change v1 to anything)
...
!!UN:U53/-1/-1/1; (get location of NEXT mine (2): v1/v2/v3)
It works fine
!!UN:U53/-1/1/1; (get location of mine 1: v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (2): v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (3): v1/v2/v3)
It works fine
!!VRv1:S-1; (start search from the first object on the map)
!!UN:U53/-1/-1/1; (get location of NEXT mine (1): v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (2): v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (3): v1/v2/v3)
To see a demonstration of how this syntax works, the following sample script may be used with a
randomly generated XL 2 levels SoD map. It runs through all Creature banks in forward and then
backward order.
Example:
ZVSE
!#TM1:S1/999/1/1; set TM1 for red
!?TM1;
!!UN:U16/-1/?v100;
!!VRv1:S-1;
!!IF:M^Found %V100 Creature Banks. Now run through all of them.^;
!!DO123/1/v100/1:P;
!!IF:M^Put Shroud.^;
!!UN:H72/72/0/1/100; Close for Red
!!UN:H72/72/1/1/100; Close for Red
!!VRv1:S-2;
!!IF:M^Now run in backward order.^;
!!DO124/1/v100/1:P;
!?FU123;
!!UN:U16/-1/-1/1;
!!UN:Sv1/v2/v3/0/3; Open for Red
!!UN:Lv1/v2/v3/100; Move a look for 100 ms
!?FU124;
!!UN:U16/-1/-2/1;
!!UN:Sv1/v2/v3/0/3; Open for Red
!!UN:Lv1/v2/v3/100; Move a look for 100 ms