Thread

Universe Question (Bots)

Universe Question // Bots

1  |  

lanezeri

Nov 4, 2001, 2:34pm
Okay, I have set up the AwEnter, AwCreate, and AwLogin, but they don't work.
I have it finally giving me a "No such citizen" error, don't have a clue
what AW's connection info is, like port and domain. If someone could help
please do.

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com

lanezeri

Nov 4, 2001, 5:11pm
Alright, I fixed that stuff. I now need to know what is wrong with my bot,
it doesn't respond to anything, and doesn't realize anyone is in the world
when there are people in the world.

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com


[View Quote]

ananas

Nov 4, 2001, 6:07pm
As long as you do not "sign up" for an event that is
triggered you will not receive the notifications.

aw_event_set (AW_EVENT_AVATAR_ADD, AvatarAddCallback);

and an own AvatarAddCallback() function are needed

[View Quote] --
"_
|
/\
\ /
__/ /_

lanezeri

Nov 4, 2001, 6:53pm
You've lost me.. I did this.. tell me how far off I am:

Public Function AwAvatarCallback()
sdk.AwEventSet AW_EVENT_AVATAR_ADD
End Function

Private Sub sdk_AwAvatarAdd()
sdk.AwEventSet AW_EVENT_AVATAR_ADD
Call AwAvatarCallback
End If
--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com


[View Quote]

ananas

Nov 4, 2001, 8:02pm
I can only tell you the scheme, as I'm not familiar
with the VB OCX, only with the DLL through C++ .

Somewhere in the main, you need to tell the SDK which
function to call when a new avatar comes into range :


sdk.AwEventSet (AW_EVENT_AVATAR_ADD, AvatarCallback);
sdk.AwStateChange ();


After you did this your function AvatarCallback()
will be called from the SDK, you don't need to call
it yourself.


In your callback function it should look somehow like
this :

Public Function AvatarCallback()
Save the citizen attributes in a global array,
you'll need at least :
NewName = aw_string (AW_AVATAR_NAME)
NewSession = aw_int (AW_AVATAR_SESSION)
and maybe
NewNumber = aw_int (AW_AVATAR_CITIZEN)

Add these retrieved values to your list of
people who are in range, so you can keep track.

and maybe a greeting to the new avatar :
aw_whisper (NewSession, "Welcome "+Newname)
End Function

Never call this function yourself, the SDK does that
for you, to inform you of a new arrived avatar.
Note that this arrived avatar might be a bot as well,
so you should check the name for brackets before you
send the greeting or add it to your list or array.


You will need basically the same for AW_EVENT_AVATAR_DELETE
to see who leaves your bots range.

[View Quote] --
"_
|
/\
\ /
__/ /_

kah

Nov 5, 2001, 3:52pm
after initing put this:
sdk.AwEventSet AW_AVATAR_ADD
sdk.AwEventSet AW_AVATAR_REMOVE
sdk.AwEventSet AW_CHAT

and so on for the events to work.

KAH

[View Quote]

lanezeri

Nov 5, 2001, 7:44pm
What do you mean after initing?

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com


[View Quote]

kah

Nov 8, 2001, 6:07pm
for the SDK to work at all you gotta initialize before calling
sdk.AwCreate(), it's what sdk.AwInit() is for...

KAH

[View Quote]

lanezeri

Nov 8, 2001, 8:00pm
Thanks a lot KAH and Ananas, I had the sdk.AwInit goin, but I didn't have
the sdk.AwEventSet after it. Thanks again!

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com


[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