POSITION
INFO
(PO)
- MAP SQUARE
RECEIVER
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.
|
Used to set up or check information on any square of the map. Sets/checks the square at x,y,l coordinates. |
|
Alternative method to above. Uses indirect
reference: |
OPTIONS
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) (see Format OB) $2 - Subtype (-1=no matter) $3 - Hero (-1=no matter) (see Format H) $4 - Owner (-1=no matter) (see Format E1) $5 - User defined number (-1=no matter) Result will be stored in v1 |
H$ |
Set/check/get hero number (0...255) (see Format H) |
N$ |
Set/check/get custom defined number (0...15) |
O$ |
Set/check/get owner (-8...8) (see Format E1) |
S$ |
Set/check/get subtype of object (or any number) (0...255) |
T$ |
Set/check/get
type of object (or any number) (0...255) (see Format OB) |
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. |
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.
A Little Explanation - Extract from mail
By Timothy and Slava
Question:
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,l reference. So how do these new parameters work and what exactly do they
mean? Is that object # and subtype? How does that work exactly?
Answer:
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
Q:
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?
A: 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).
Q:
O$ - set/check/get owner (-8...8)
Same question as above, what value if no owner and what are the negative numbers
for?
A: Same answer :-) This is just a place to store
something for this square. I propose it to use for a
colour (maybe + for bonus and - for penalty). But you can
story there whatever you want.
Q:
N$ - set/check/get custom defined number (0...15)
What do these represent exactly?
A:
Absolutely any number.
Q:
T$ - set/check/get type of object (or any number) (0...255)
What's returned if no object?
A:
This is not a real object type. Again you can set it to any number
and then use it.
Q:
S$ - set/check/get subtype of object (or any number) (0...255)
What if there are no subtypes (or no object)?
A:
The same.
Q:
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?
A:
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
Q:
When does this happen? At the start when the map is first loaded? I'm not
quite sure I understand.
A: 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.
Q:
!?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,l
coordinate and it's not a standard object # and subtype is it?
So what is it?
A:
Right, because !?OB... set v998, v999 and v1000 to actual position
of object.
Q: 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!)
A: 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.