Thread

[953] delete object using object id (Sdk)

[953] delete object using object id // Sdk

1  |  

magine

Aug 13, 2006, 4:37pm
It doesn't appear possible to delete an object using the object id. I do:

// iObjectID, iObjectZ, iObjectX are set to the previously created
object's ID and coordinates.

aw_int_set(AW_OBJECT_NUMBER, 0);
aw_int_set(AW_OBJECT_ID, iObjectID);
aw_int_set(AW_OBJECT_Z, iObjectZ);
aw_int_set(AW_OBJECT_X, iObjectX);
aw_object_delete();

....but the object doesn't get deleted. Sometimes aw_object_delete
returns "no such object" and sometimes it returns successful (0) but the
object doesn't disappear. Sometimes the wrong object disappears.

There's no problem if I use object number instead of ID.

Yes, I am getting the new object id and not the object number when I
create the object with object number set to 0. The aw_object_change
function works ok using the object id instead of the object number.

cotarr

Aug 13, 2006, 5:19pm
My understanding is that AW_OBJECT_NUMBER is used to uniquely identify
an object within a cell address (AW_OBJECT_X, AW_OBJECT_Z). You should
use AW_OBJECT_NUMBER to delete, and I think it will work for you, if
you have the X, Z cell address correct.

I believe AW_OBJECT_ID is intended to be used to uniquely identify an
object in the entire world, and that it does not change if the object
is edited. This is used primarily by game bots that track object
ownership. Perhaps also used for the tourist guard bots. For a game
bot, I think it is much simpler to use AW_OBJECT_ID, than trying to
track the OBJECT_NUMBERS, which can change, and are tied to cell
addresses.

Perhaps one of the game bot programmers can clarify.

-cotarr

On 13 Aug 2006 14:37:38 -0400, "Magine" <magine at turtleflight.com>
[View Quote] >It doesn't appear possible to delete an object using the object id. I do:
>
>// iObjectID, iObjectZ, iObjectX are set to the previously created
>object's ID and coordinates.
>
>aw_int_set(AW_OBJECT_NUMBER, 0);
>aw_int_set(AW_OBJECT_ID, iObjectID);
>aw_int_set(AW_OBJECT_Z, iObjectZ);
>aw_int_set(AW_OBJECT_X, iObjectX);
>aw_object_delete();
>
>...but the object doesn't get deleted. Sometimes aw_object_delete
>returns "no such object" and sometimes it returns successful (0) but the
>object doesn't disappear. Sometimes the wrong object disappears.
>
>There's no problem if I use object number instead of ID.
>
>Yes, I am getting the new object id and not the object number when I
>create the object with object number set to 0. The aw_object_change
>function works ok using the object id instead of the object number.

magine

Aug 15, 2006, 12:22am
This is a multi-part message in MIME format.
--------------090908000804050905040605
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I guess you mean one of the other game bot programmers? :) Right,
object id doesn't change when an object is moved or edited, so it would
be more reliable to use when controlling objects in a game or anything
else where you want to control objects that might get moved.

I know you can delete things using object number, but you should be able
to use object id also. Theoretically you can (according to Chris), but
it's just not working for some reason, or not working for me anyway. It
is true that with object id you don't need to know the object location,
so that part of my code was unnecessary.



[View Quote] >My understanding is that AW_OBJECT_NUMBER is used to uniquely identify
>an object within a cell address (AW_OBJECT_X, AW_OBJECT_Z). You should
>use AW_OBJECT_NUMBER to delete, and I think it will work for you, if
>you have the X, Z cell address correct.
>
>I believe AW_OBJECT_ID is intended to be used to uniquely identify an
>object in the entire world, and that it does not change if the object
>is edited. This is used primarily by game bots that track object
>ownership. Perhaps also used for the tourist guard bots. For a game
>bot, I think it is much simpler to use AW_OBJECT_ID, than trying to
>track the OBJECT_NUMBERS, which can change, and are tied to cell
>addresses.
>
>Perhaps one of the game bot programmers can clarify.
>
>-cotarr
>
>On 13 Aug 2006 14:37:38 -0400, "Magine" <magine at turtleflight.com>
[View Quote]
--------------090908000804050905040605
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I guess you mean one of the <i>other</i> game bot programmers? :)&nbsp;
Right, object id doesn't change when an object is moved or edited, so
it would be more reliable to use when controlling objects in a game or
anything else where you want to control objects that might get moved.<br>
<br>
I know you can delete things using object number, but you should be
able to use object id also. Theoretically you can (according to Chris),
but it's just not working for some reason, or not working for me
anyway. It is true that with object id you don't need to know the
object location, so that part of my code was unnecessary.<br>
<br>
<br>
<br>
[View Quote] I believe AW_OBJECT_ID is intended to be used to uniquely identify an
object in the entire world, and that it does not change if the object
is edited. This is used primarily by game bots that track object
ownership. Perhaps also used for the tourist guard bots. For a game
bot, I think it is much simpler to use AW_OBJECT_ID, than trying to
track the OBJECT_NUMBERS, which can change, and are tied to cell
addresses.

Perhaps one of the game bot programmers can clarify.

-cotarr

On 13 Aug 2006 14:37:38 -0400, "Magine" <a class="moz-txt-link-rfc2396E" href="mailto:magine at turtleflight.com">&lt;magine at turtleflight.com&gt;</a>
[View Quote] </pre>
<blockquote type="cite">
<pre wrap="">It doesn't appear possible to delete an object using the object id. I do:

// iObjectID, iObjectZ, iObjectX are set to the previously created
object's ID and coordinates.

aw_int_set(AW_OBJECT_NUMBER, 0);
aw_int_set(AW_OBJECT_ID, iObjectID);
aw_int_set(AW_OBJECT_Z, iObjectZ);
aw_int_set(AW_OBJECT_X, iObjectX);
aw_object_delete();

....but the object doesn't get deleted. Sometimes aw_object_delete
returns "no such object" and sometimes it returns successful (0) but the
object doesn't disappear. Sometimes the wrong object disappears.

There's no problem if I use object number instead of ID.

Yes, I am getting the new object id and not the object number when I
create the object with object number set to 0. The aw_object_change
function works ok using the object id instead of the object number.
</pre>
</blockquote>
</blockquote>
<br>
</body>
</html>

--------------090908000804050905040605--

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