Thread

Local Console Messages? (Sdk)

Local Console Messages? // Sdk

1  |  

.duo.

Aug 19, 2002, 8:33pm
Is there a session ID that allows you to create a console message only
within the bots range? If so please tell me.

joeman

Aug 19, 2002, 9:12pm
aw_say...

-Joe

[View Quote]

.duo.

Aug 19, 2002, 11:41pm
Console messages are better for phonebots
[View Quote]

the derek

Aug 19, 2002, 11:44pm
youd have to keep track of where everyone is and issue messages to the
people near it on by one
[View Quote]

joeman

Aug 20, 2002, 12:22am
Yes, but due to the fact that your using VB, and console messaging only the
people near the bot is out of your grasp.

-Joe

[View Quote]

the derek

Aug 20, 2002, 2:54am
as far as i know there is nothing in the c++ sdk that would let you do that

what youd have to do is keep track of where eveyone is (youd need to know
how to use the memory functions of the windows API) and then when you want
to do a console message to people within a certain radius, just check each
person one by one from memory... unless you try to do it without using
memory directly it wont lag


[View Quote]

.duo.

Aug 20, 2002, 10:01am
I amde a set of functions that added session numbers to a list of people
during EventAvatarAdd using an array of sessions. The place where new
session numbers should be are is saved by a long, and it sends messages, but
it seems to not read the session ids from the array )-:
[View Quote]

strike rapier

Aug 20, 2002, 4:22pm
Function HypBetween2D(X1 As Long, Z1 As Long, X2 As Long, Z2 As Long)
'This allows you to find the distance between 4 points allong the hyp
'and is used for mapping and rangefinding. It uses X and Z (NS / EW)
Dim DistanceOnTarget As Long, XDistance As Long, ZDistance As Long
XDistance = X2 - X1
ZDistance = Z2 - Z2
HypBetween2D = Squ((XDistance ^ 2) + (ZDistance ^ 2))
End Function

A loop with all your av's in from the location of the bot. Vualla.

- Mark


[View Quote]

deconstructor

Aug 20, 2002, 5:29pm
STL :) This is what I do to keep track of everyone in the scene.

(Ignore the myBotClass::, I copied this out of my own bots--just change the
functions to whatever you are using, you get the idea)

#include <map>

using namespace std;

typedef struct {
char* citName;
int X;
int Y;
int Z;
int citNum;
int avatar;
int gesture;
} avInfo;

map<int,avInfo> avatars; // Info on everyone in the scene

void myBotClass::awEventAvatarAdd(char* avatarName,int avatarSession,int
X,int Z,int Y,int yaw,int avatarCitNum,int avatarType,int avatarGesture){
// Store avatar info
avatars[avatarSession].citName=avatarName;
avatars[avatarSession].X=X;
avatars[avatarSession].Y=Y;
avatars[avatarSession].Z=Z;
avatars[avatarSession].citNum=avatarCitNum;
avatars[avatarSession].avatar=avatarType;
avatars[avatarSession].gesture=avatarGesture;
dbgPrint("%s entered the scene. Citizen: %i Session:
%i",avatarName,avatarCitNum,avatarSession);
}

void myBotClass::awEventAvatarChange(char* avatarName,int avatarSession,int
X,int Z,int Y,int yaw,int avatarType,int avatarGesture){
avatars[avatarSession].citName=avatarName;
avatars[avatarSession].X=X;
avatars[avatarSession].Y=Y;
avatars[avatarSession].Z=Z;
avatars[avatarSession].avatar=avatarType;
avatars[avatarSession].gesture=avatarGesture;
}

void myBotClass::awEventAvatarDelete(char* avatarName,int avatarSession){
avatars.erase(avatarSession);
}

This way, you have a little spybot that keeps tabs on everyone in the scene.

Deconstructor

strike rapier

Aug 20, 2002, 10:35pm
Or just use a basic array of a Struct?

- Mark

[View Quote]

chiklit

Aug 21, 2002, 10:05pm
".duo." <ncommons at juno.com> wrote in
news:3d622fa9$1 at server1.Activeworlds.com:

> I amde a set of functions that added session numbers to a list of
> people during EventAvatarAdd using an array of sessions. The place
> where new session numbers should be are is saved by a long, and it
> sends messages, but it seems to not read the session ids from the
[View Quote] What I use in my bot is an invisible list box. on the
aw_event_avatar_add it adds the session number to the invisible one and
the name to the visable one.

strike rapier

Aug 22, 2002, 12:08am
Tsk Tsk Tsk, as Grimble put it to me, never use Graphical components when you dont need them...

- Mark

kah

Aug 22, 2002, 6:40am
"chiklit" <chiklit at funetwork.net> wrote in
news:Xns9271C878DFFABchiklitfunetworknet at 64.94.241.201:

> What I use in my bot is an invisible list box. on the
> aw_event_avatar_add it adds the session number to the invisible one and
> the name to the visable one.

That's the newbie-ish uncorrect way. The most common correct way is to use
an array. With an array you can also skip having any listboxes at all:
<code language="VB">
Private Type AwUser
AwName As String
AwSession As Long
End Type

Dim AwUsers() As AwUser
Dim AUIdx As Long 'this one should be set to -1 at init

Private Sub sdk_EventAvatarAdd()
AUIdx = AUIdx + 1
AwUsers(AUIdx).AwName = sdk.AwAvatarName
AwUsers(AUIdx).AwSession = sdk.AwAvatarSession
End Sub
</code>

KAH

bluemoon8963

Aug 22, 2002, 11:51am
If it's uncorrect then why does it work? :)
[View Quote]

kah

Aug 22, 2002, 2:59pm
"bluemoon8963" <bluemoon8963 at hotmail.com> wrote in
news:3d64ec46$1 at server1.Activeworlds.com:

> If it's uncorrect then why does it work? :)

By uncorrect I didn't say it wasn't working, but it's not the way it should
be done, it's not a very good solution to the problem. :-))

KAH

the derek

Aug 22, 2002, 11:34pm
if it works then hell use it lol
[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