Thread

Possible to teleport or warp a bot? (Sdk)

Possible to teleport or warp a bot? // Sdk

1  |  

thenorm

Nov 18, 2005, 8:39pm
It looks like there's no way for a bot to teleport or warp itself, is that
true? Suppose the bot got hold of it's own session number, would that work?

How could a bot get its own session number anyway? Without the help of
another bot that is.

Anyone?

deltaphc

Nov 18, 2005, 8:49pm
I'm pretty sure aw_session() returns the session number of the current
bot instance.

As for teleporting the bot, you don't even need a session number. Just
set the AW_MY_X, AW_MY_Y, and AW_MY_Z attributes to where you want to
teleport to, then call aw_state_change()

If teleporting to another world, call aw_enter() before setting the
above attributes.

[View Quote]

strike rapier

Nov 18, 2005, 8:55pm
It is really quite pointless to attempt to teleport yourself anyway, thats
what aw_state_change is for.

Note that bots simply receive the message, they dont have to act on it.

- MR

[View Quote]

thenorm

Nov 18, 2005, 9:50pm
> As for teleporting the bot, you don't even need a session number. Just set
> the AW_MY_X, AW_MY_Y, and AW_MY_Z attributes to where you want to teleport
> to, then call aw_state_change()

That's not a teleport, it's a walk.

deltaphc

Nov 18, 2005, 10:06pm
It's both.

This method isn't limited in distance. You can use it whether you want
to move 1 meter or 300,000 meters from the current posiiton.

When you call aw_state_change() after setting those attributes, you're
moved to that position instantly. The bot doesn't "walk" there.

[View Quote]

deltaphc

Nov 18, 2005, 10:10pm
For example:

aw_int_set(AW_MY_X, -942000);
aw_int_set(AW_MY_Y, 0);
aw_int_set(AW_MY_Z, -946000);
aw_state_change();

Those lines would teleport the bot to 946S 942E 0a in whatever world
it's in.

[View Quote]

thenorm

Nov 18, 2005, 10:20pm
That's true, thanks. I didn't notice aw_session before. It doesn't look like
it'll help though.

Unfortunately if a bot tries to teleport itself it doesn't seem to work. It
doesn't return an error but nothing happens.

The problem with setting AW_MY_X etc and using aw_state_change is that it's
really a walk and if you move very far the bot looks ridiculous with its
little legs flapping away. Especially if you don't turn it to face the
direction of travel. If you move a great distance it's fast enough that
people may not see it but medium distances are really funky.

Norm

[View Quote]

thenorm

Nov 18, 2005, 10:26pm
One solution might be to leave the world and do the move when you re-enter.
I don't think AW shows the first move since it doesn't have a starting
position. Unfortunately that will screw up my bookeeping and I'll have to
process a bunch of 'add avatar' events when I come back.

[View Quote]

deltaphc

Nov 18, 2005, 10:28pm
I don't have in-depth knowledge of the inner-workings of the AW browser,
so anyone who does can correct me if I'm wrong.

As far as the world server is concerned, using aw_state_change() changes
the position instantly. It only appears as if the bot is walking in the
AW browser because it interpolates between positions as avatars/bots move.

Bot is in position #1, moves to position #2 which is far away, AW
browser fills the space between, thus appearing as if the bot is running
really really fast, when in fact, it was at position #2 the whole time.

So I think it's just a "flaw" in the AW browser, not in the method of
teleport.

[View Quote]

thenorm

Nov 18, 2005, 10:37pm
I wouldn't call it a flaw. For normal movement it's exactly what you want.
But the purpose of warp is to do the same thing without all the flapping
around, slowly enough for the player to enjoy the scnenery, and the purpose
of teleport is to prevent the interpolation completely and appear
instantaneous. A bot should really be able to do all three, except for the
enjoying-the-scenery part. ;)



[View Quote]

deltaphc

Nov 18, 2005, 10:49pm
I think one way to improve upon this would be for the AW browser to only
interpolate movement for short distances.

If the distance between the old and new position is above a certain
length, it'll render the avatar at the new position instantly, rather
than fill in the gap.

Not sure if it'll work in all cases, though.

[View Quote]

strike rapier

Nov 25, 2005, 6:32pm
Sure, but that isnt likely to happen, and would have add on effects.

Any decent bot will have its own per-interval movement system that tracks
between positions, such as following, or rotating around.

- MR

[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