Thread

VB: Identifying objects (Sdk)

VB: Identifying objects // Sdk

1  |  

jeiden

Feb 18, 2001, 11:16pm
Okay just how would I identify if a specific object gets clicked?

I know that it has something to do with an object number, so how would I
find out the object number in the first place? And are there any other
things that I would use to make sure I have the correct object? If so what
are they?

And what would the correct syntax be for the code?

ananas

Feb 18, 2001, 11:31pm
Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------87D1F996125F891EF1BF262B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Add an object description so the bot can identify the object, that
should be the easiest way.

jeiden schrieb:
>
> Okay just how would I identify if a specific object gets clicked?
>
> I know that it has something to do with an object number, so how would I
> find out the object number in the first place? And are there any other
> things that I would use to make sure I have the correct object? If so what
> are they?
>
> And what would the correct syntax be for the code?
--------------87D1F996125F891EF1BF262B
Content-Type: text/x-vcard; charset=us-ascii;
name="vha.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte für Volker Hatzenberger
Content-Disposition: attachment;
filename="vha.vcf"

begin:vcard
n:Hatzenberger;Volker
x-mozilla-html:FALSE
url:oct31.de
adr:;;Bornheimer Strasse 15;Bonn;;53111;Germany
version:2.1
email;internet:vha at oct31.de
end:vcard

--------------87D1F996125F891EF1BF262B--

lanezeri

Feb 19, 2001, 12:36am
*sounds buzzer* wrong...

First you have to query the world so the bot will get the message (it is
enough to query the close vicinity of the bot). Then you should keep track
of the objects (or those you are interested) in a kind of database.
Install your callback to the AW_EVENT_OBJECT_CLICK . The clicked object is
uniquely identified by AW_CELL_X, AW_CELL_Z,
and AW_OBJECT_NUMBER at the callback. Do a lookup in your database for the
particular object and act as you planned if you got a match.


(Taken from andras post)

jeiden

Feb 19, 2001, 1:22am
So how would I get the blasted object number in the first place? Cause
getting the N W coords is easy, I have no clue what to do about getting the
actually object number.

[View Quote]

lanezeri

Feb 19, 2001, 2:09am
Ask.. andras or Brant

andras

Feb 19, 2001, 4:53pm
You get it when you do the query.
Excerpt from the API help:

AW_EVENT_CELL_OBJECT

DESCRIPTION

Describes a single object in response to aw_query or aw_cell_next.

NOTES

This event is triggered in response to a call to aw_query or to
aw_cell_next. This event sets the following attributes:

AW_OBJECT_NUMBER
AW_OBJECT_OWNER
AW_OBJECT_BUILD_TIMESTAMP
AW_OBJECT_X,
AW_OBJECT_Y
AW_OBJECT_Z
AW_OBJECT_YAW
AW_OBJECT_MODEL
AW_OBJECT_DESCRIPTION
AW_OBJECT_ACTION

See Property for a description of the property query mechanism.


[View Quote]

the derek

Feb 19, 2001, 6:43pm
you have to store the objects object number
then when the bot recieves an object click verify that the object number and
the stored object number match

[View Quote] > Okay just how would I identify if a specific object gets clicked?
>
> I know that it has something to do with an object number, so how would I
> find out the object number in the first place? And are there any other
> things that I would use to make sure I have the correct object? If so what
> are they?
>
> And what would the correct syntax be for the code?

ananas

Feb 19, 2001, 6:52pm
Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------48AA3BF2246C1CA807EA89BB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

As long as you don't have the object number yet it is much easier to
identify an object with help of the description field. The original
post was about a specific object so why should someone keep a database
of all objects in a cell if he just wants to identify one specific
button or whatever?
There isn't a collision between Andras' method and this one, it is just
a variation, you just don't qyuery the object number but the description
field and compare that.

lanezeri schrieb:
>
> *sounds buzzer* wrong...
>
> First you have to query the world so the bot will get the message (it is
> enough to query the close vicinity of the bot). Then you should keep track
> of the objects (or those you are interested) in a kind of database.
> Install your callback to the AW_EVENT_OBJECT_CLICK . The clicked object is
> uniquely identified by AW_CELL_X, AW_CELL_Z,
> and AW_OBJECT_NUMBER at the callback. Do a lookup in your database for the
> particular object and act as you planned if you got a match.
>
> (Taken from andras post)
--------------48AA3BF2246C1CA807EA89BB
Content-Type: text/x-vcard; charset=us-ascii;
name="vha.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte für Volker Hatzenberger
Content-Disposition: attachment;
filename="vha.vcf"

begin:vcard
n:Hatzenberger;Volker
x-mozilla-html:FALSE
url:oct31.de
adr:;;Bornheimer Strasse 15;Bonn;;53111;Germany
version:2.1
email;internet:vha at oct31.de
end:vcard

--------------48AA3BF2246C1CA807EA89BB--

andras

Feb 19, 2001, 7:14pm
Sorry Ananas, you are wrong. The object click event is described in the help as :

AW_EVENT_OBJECT_CLICK

DESCRIPTION

Event called when a user left-clicks on an object in your area.

<snip>

This event is triggered whenever a nearby user left-clicks with the
mouse on an object. It will also be triggered if another nearby SDK
application calls aw_object_click. During this event, the following
attributes are defined:

AW_AVATAR_SESSION
AW_AVATAR_NAME
AW_CELL_X
AW_CELL_Z
AW_OBJECT_NUMBER

AW_AVATAR_SESSION and AW_AVATAR_NAME indicate the user
that clicked on the object. The clicked object is uniquely identified
by AW_CELL_X, AW_CELL_Z, and AW_OBJECT_NUMBER.


[View Quote]

ananas

Feb 19, 2001, 7:29pm
Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------D2B644314171D09F034354B7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

uh, right - I digged out the SDK docs - should have done that before,
instead of trusting my memory. Sorry.

andras schrieb:
>
> Sorry Ananas, you are wrong. The object click event is described in the help as :
--------------D2B644314171D09F034354B7
Content-Type: text/x-vcard; charset=us-ascii;
name="vha.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte für Volker Hatzenberger
Content-Disposition: attachment;
filename="vha.vcf"

begin:vcard
n:Hatzenberger;Volker
x-mozilla-html:FALSE
url:oct31.de
adr:;;Bornheimer Strasse 15;Bonn;;53111;Germany
version:2.1
email;internet:vha at oct31.de
end:vcard

--------------D2B644314171D09F034354B7--

jeiden

Feb 20, 2001, 2:39pm
Yes but how do I get the number in the first place?

[View Quote]

xelag

Feb 21, 2001, 4:42pm
When you query a zone, in aw_cell_object you can get ALL the data of the
object, including the number you are looking for: keep those in a database.
When you get a click on an object, the number and cell coordinates are also
given to you. So go back to your database and look for it.

BTW, it would be fantastic if AWCOM finished the API documentation job by
including the callbacks.

XelaG

[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn