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).
If you want a script to occur
when an object is visited, use an object TRIGGER
Note:
v998/v999/v1000 variables will store the location of
the current object visited. Also, you can refer to it easily with an indirect
reference (for example: !!OB998:...; )
For a more detailed and explained
version of OB receiver, read
the
OB trigger & receiver easily explained (ERM for dummies, by Qurqirish
Dragon)
!!OB#x/#y/#l:XXXX; |
Generic object receiver used to enable/disable and
set the type and other general characteristics of an object. x, y = area coordinates l = level (0-ground, 1-underground) |
B; | Remove a description hint for an object. |
C$; | Set/check/get control word of object |
D#; | Disable to gamer of # colour (see Format E1) to use object |
E#; | Enable to gamer of # colour (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) |
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.
How to check if the AI visits an object
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^;