x@x.com (xelag) // User Search

x@x.com (xelag) // User Search

1  2  3  |  

HamBot using SDK, no entry in Atlantis?

Oct 22, 1998, 8:13pm
I started using the SDK option in HamBot today. In Beta world it logs
fine, in Atlantis the program freezes when getting world info. Can
somebody explain that?

I've been working at a bot script for HamBot for a few days in 'hambot
mode', and this developmen is frustrating, since I 'live' in Atlantis.

What priviliges do SDK bots have. May they build, send telegrams...
just as its citizen owner does?

TIA, XelaG


Alex Grigny de Castro
name: agrigny
domain: xs4all.nl
e-mail: <name> at <domain>

HamBot using SDK, no entry in Atlantis?

Oct 23, 1998, 2:27pm
On 22 Oct 1998 15:57:22 -0800, "HamFon" <ncrowle at sprintmail.com>
[View Quote] Thanks, HamFon, for your reply.

Yesterday night I parked 2 bots in my home in Atlantis and closed the
browser. When I returned (hours later), they were gone. The log says:

Sending AvatarPosition 445106NS 308156WE 50A 1326, Av 22(0) for bot 0
Sending World message 0x08, length 19, for instance 0
Socket send returned error 10058
Socket send to world failed - instance 0
Sending AvatarPosition 445256NS 308306WE 100A 1326, Av 3(0) for bot 1
Sending World message 0x08, length 19, for instance 1
Socket send returned error 10058
Socket send to world failed - instance 1
Sending AvatarPosition 445183NS 308093WE 50A 1407, Av 22(0) for bot 0
Sending World message 0x08, length 19, for instance 0
Socket does not exist - can not send
....
Sending AvatarPosition 445201NS 308117WE 50A 422, Av 22(0) for bot 0
Sending World message 0x08, length 19, for instance 0
Socket does not exist - can not send
Socket send to world failed - instance 0
Sending AvatarPosition 445351NS 308267WE 100A 422, Av 3(0) for bot 1
Sending World message 0x08, length 19, for instance 1
Socket does not exist - can not send
Socket send to world failed - instance 1
....
This went on for hours, I suppose (the log file is 4.7 megabytes!).
But I've had this happen before after a few minutes. Does this mean
that the connection to the server was lost at a certain point? Can one
recover the bots at the same place and state? The script in HamBot
goes on running, messages in MainLoop are still processed, HamBot
attempts to send them to the server, and the bots are not actually
'killed', although they dont have a socket. This means IMHO that the
information about the bots is still present. Can I, as user, trap this
refusal 'event' in the script, so that I can KillBot and StartBot my
bots at the same place and state?

BTW, I'm having a lot of fun with this program. Hope things like
string processing and trigonometry (for a 'move forward' action, for
instance) will be added, and more user variables. A suggestion that
would add more possibilities easily: ChopFirstWord B$ A$ , where B$ is
the chopped bit? Old syntax ChopFirstWord A$ (one parameter) should
still work for compatibility. And maybe IfVarIsEqual A$ x Text (case
insensitive)?

Cheers and thanks for your answer. XelaG




XelaG:
>
HamFon:
>The problem is that Atlantis is a newer (2.1) world, with a list of citizen
>numbers who are allowed to run bots. (A bot-rights parameter, similar to
>build-rights, etc). I just checked, and the only citizen number allowed to
>run bots at this very instant is Cryonics.
>
>The call to aw_enter() seems to have a problem (or the implementation in
>HamBot does, maybe ;-) , causing HamBot to hang.
>
>To fix this problem, you need to talk to Cryonics to get your citizen
>number enabled to run bots.
>
>HamBot will continue to run in "native" mode (non-SDK), tho, even in worlds
>with bot-rights. This will probably work until the encryption is
>*required*.
>
XelaG:
>
HamFon:
>The SDK bots may build, but may not (currently... ;-) send telegrams or
>keep contact lists. HamBot allows telegrams and contact lists, but only
>when you log in your bot as a REAL citizen (not as a tourist, and not using
>the SDK).

Alex Grigny de Castro
name: agrigny
domain: xs4all.nl
e-mail: <name> at <domain>

HamBot using SDK, no entry in Atlantis?

Oct 23, 1998, 8:48pm
On 22 Oct 1998 15:57:22 -0800, "HamFon" <ncrowle at sprintmail.com>
[View Quote] HamFon:

Refering to your suggestion of asking Cryonics, I got this message:

Telegram from Cryonics, sent 15 minutes ago:
At this time we are not allowing SDK bots in COF worlds other than COF
bots.

XelaG's question:

HamFon's answer:
>The problem is that Atlantis is a newer (2.1) world, with a list of citizen
>numbers who are allowed to run bots. (A bot-rights parameter, similar to
>build-rights, etc). I just checked, and the only citizen number allowed to
>run bots at this very instant is Cryonics.


Alex Grigny de Castro
name: agrigny
domain: xs4all.nl
e-mail: <name> at <domain>

cant find build number of aw.dll

Nov 8, 1998, 9:31am
Hi, I've looked everywhere I know of, especially in
www.activeworlds.com/sdk, for the build number of aw.dll. Can anybody
enlighten me? TIA

XelaG

cant find build number of aw.dll

Nov 9, 1998, 2:10pm
Thanks both of you, i'd missed the .h define.

more than1 bot: creation/selection problem

Nov 9, 1998, 3:12pm
Thanks to Kevin MacLennan's help i got VisualBasic6 to make me a bot.
Deaf he is (and will remain until VB6 can use the API, who can help?),
but cool. I wish to create more than one, and here's (one of) my
problem(s):

Whatever bot I create seems to count, but only the first one reacts,
talks etc (etc=not much more at this stage!). I suspect my
understanding of aw_instance and aw_instance_set is defective, I get
one number per session, something like 215550416, no matter how many
bots I make. I would like to register the instances to be able to
switch from one to the other.

My definitions of both (which might be wrong) are:
'AWAPI void* aw_instance (void);
Public Declare Function aw_instance Lib "aw.dll" () As Long
'AWAPI int aw_instance_set (void *instance);
Public Declare Function aw_instance_set Lib "aw.dll" (ByRef instance
As Any) As Long

Also, av_create has an 'instance', by default set to 0?

How can I set Bot0, Bot1, and Bot2 to be the actors?

Here's part of the code I use.

I first create a form, and in Form_Load i do the preliminaries:
====<code>
Private Sub Form_Load()

Dim rc As Long
Dim c as String
' Ini File
On Error GoTo Form_Load_Error
IniFile = App.Path & "\Bot1.ini"
' etc, i initialize ApplicationName, MaxBot to 3, LoginOwner,
' and PrivilegePassword.
MaxBot = Int(MaxBot): If MaxBot < 1 Then MaxBot = 1
ReDim botSlot(0 To MaxBot)
' initialize ActiveWorlds API
rc = aw_init(AW_BUILD)
If rc <> 0 Then
MsgBox "Unable to initiate API (reason " & rc & ")."
End
End If
' install handler for avatar_add event
' should this be here or is it instance related????
rc = aw_event_set(AW_EVENT_AVATAR_ADD, AddressOf evtAvatarAdd)
Exit Sub
Form_Load_Error:
Err.Clear
Resume Next
End Sub
'====</code>
Then I start creating my bots like this, triggered by some user input:
the type of botSlot() is roBot, defined as
Type roBot
Logged As Boolean
instance As Long
Caption As String
World As String
NS As Long
WE As Long
Altitude As Long
Rotation As Long
Avatar As Long
Gesture As Long
End Type
'====<code>
Public Function BotLogin(ByVal botNr)
Dim rc As Long, c As String
On Error GoTo BotLoginError
BotLogin = False
With botSlot(botNr)
If .Logged = True Then GoTo BotLoginEnd
If .Caption = "" Then .Caption = "DeafBot" & botNr
If .World = "" Then .World = "Beta"
' create bot instance
rc = aw_create("auth.activeworlds.com", 5670, botNr)
If rc <> 0 Then GoTo BotLoginFailed
' log bot into the universe
rc = aw_int_set(AW_LOGIN_OWNER, LoginOwner)
rc = aw_string_set(AW_LOGIN_PRIVILEGE_PASSWORD,
PrivilegePassword)
rc = aw_string_set(AW_LOGIN_APPLICATION, ApplicationName)
rc = aw_string_set(AW_LOGIN_NAME, .Caption)
rc = aw_login()
If rc <> 0 Then GoTo BotLoginFailed
' log bot into a world
rc = aw_enter(.World, 0)
If rc <> 0 Then GoTo BotLoginFailed
rc = aw_int_set(AW_MY_X, .WE)
rc = aw_int_set(AW_MY_Z, .NS)
rc = aw_int_set(AW_MY_Y, .Altitude)
rc = aw_int_set(AW_MY_YAW, .Rotation)
rc = aw_int_set(AW_MY_TYPE, .Avatar)
rc = aw_state_change()
.instance = aw_instance()
Call aw_say("Hi, I'm " & .Caption & ", a VB6.0 freak...")
.Logged = True
End With
BotLogin = True
Exit Function
BotLoginError:
' debug code omitted
Resume Next
BotLoginEnd:
' degug code omitted
Exit Function
BotLoginFailed:
' debug code omitted
End Function
'====</code>


TIA, XelaG

more than1 bot: creation/selection problem

Nov 9, 1998, 6:21pm
I solved the mystery:

1. my VB6 definition of aw_instance_set was incorrect, should be ByVal
instead of ByRef:
'AWAPI int aw_instance_set (void *instance);
Public Declare Function aw_instance_set Lib "aw.dll" (ByVal Instance
As Any) As Long

2. the definition and example for aw_create given in the specs in
www.activeworlds.com/sdk is confusing, at least for a non C/C++ human:
the third parameter returns the new bot's instance number and, at
least in VB, should pass a variable to retreive its value.

XelaG.

2 questions.

Nov 10, 1998, 12:40pm
I use vb6.0 and have managed to login 3 bots at a time, roughly
following the greeter bot script (no greetings i'm afraid). I have 2
questions at the moment. Can anyone help explaining these matter?.

1.
Whether i log in 1 or more bots, they disappear from the world (Beta
GZ) after some time, about a minute. Their instance number is still
valid (selectable) but they are gone. The only way to get them back on
stage is to select one of the bots with
rc = aw_instance_set(<instance number>)
and start from aw_enter(.World,0) to aw_state_changed() all over
again.
Strangely enough, this method sometimes gets all three bots back, even
if I only explicitely select one of them and bring it back.

The sequence i follow to create the bots is this one:

rc = aw_create("auth.activeworlds.com", 5670, Inst)
rc = aw_int_set(AW_LOGIN_OWNER, .LoginOwner)
rc = aw_string_set(AW_LOGIN_PRIVILEGE_PASSWORD, .PrivilegePassword)
rc = aw_string_set(AW_LOGIN_APPLICATION, ApplicationName)
rc = aw_string_set(AW_LOGIN_NAME, .Caption)
rc = aw_login()

rc = aw_enter(.World, 0)
rc = aw_int_set(AW_MY_X, .we)
rc = aw_int_set(AW_MY_Z, .ns)
rc = aw_int_set(AW_MY_Y, .Altitude)
rc = aw_int_set(AW_MY_YAW, .Rotation)
rc = aw_int_set(AW_MY_TYPE, .Avatar)
rc = aw_int_set(AW_MY_GESTURE, .Gesture)
rc = aw_state_change()
Call aw_say("Hi, I'm " & .Caption & ", a VB6.0 freak...")

2.
I cant seem toget char* aw_string (AW_ATTRIBUTE a) working in VB6. The
code I use
Public Declare Function aw_string Lib "aw.dll" (ByVal awAttribute As
AW_ATTRIBUTE) As String
is useless, although a similar syntax for aw_int() works ok. I think
it is because this is the only function retuning a string. Is there
any workaround? <wishfull thinking> Maybe having a function with no
return value that accepts a fixed length string as parameter, as in
Kernel's GetPrivateProfileString.

TIA. XelaG, agrigny at xs4all.nl

2 questions.

Nov 11, 1998, 1:20am
No, I wasn't calling aw_wait. I don't use a loop as such, the windows
form just sits and waits for events to pour on it. I wrongly assumed
that since i cant get events from the server using VB6 anyway,
aw_wait() was unnecessary. Facter (Walter) first put me on the right
track: use a timer object instead of a loop, set the Timer.Interval to
1 second, and let the timer call aw_wait(10) i.e. for 10 milliseconds
every minute. Thanks for your explanation about how aw_wait() works.

On Tue, 10 Nov 1998 16:01:23 -0800, "Roland Vilett" <roland at lmi.net>
[View Quote] >Are you calling aw_wait() at all? You must call aw_wait() in order to
>receive any events. Also, aw_wait() periodically sends heartbeats to the
>servers so they know your bot is still alive. I assume the reason your bots
>are vanishing is that you are not calling aw_wait(), so after about a minute
>the world server gives up on your bots and disconnects them.
>
>After setting up your bots, your program should spend the majority of its
>time in a loop calling aw_wait(), as demonstrated in the sample programs.
>
>-Roland
>
[View Quote]

2 questions.

Nov 11, 1998, 1:33am
On Tue, 10 Nov 1998 14:46:04 -0500, Canopus <aek2 at ix.netcom.com>
[View Quote] I sort of tried that trick today, i'll try it later again more
systematically. It didn't work.

Wat VB does fine is using a string of a sufficient length as an
argument to an api, for instance, GetPrivateProfileString uses that
method. Searching for ascii zero is unnecessary, VB shortens the
string to the right VB-length, so you can't use a constant which has
fixed length. What i don't yet know is if this also works for a
returned string. I've noticed awapi has AW_MAX_ATTRIBUTE_LENGTH =
255& which i declared Public Const. That didn't work. I'll retry
later.
>In earlier versions of VB, you could get round VB's preference for VB
>strings by providing a fixed-length string that was long enough to hold
>whatever was returned by a C DLL function (Dim ReceiverString As String *
>255, or ReceiverString = String(255,0)). VB would convert VB string
>parameters to C strings if you declared them ByVal, but that only worked
>for passing strings TO a C DLL, not for getting them FROM a C DLL. It was
>up to you to find the ASCII Zero that C uses to mark the end of a returned
>string. Don't know if this is still true.
>
>Walter Knupe's idea about aw_wait is worth trying, as some callback events
>seem to depend on it. But the Delphi version of the multibot program
>worked without any mention of aw_wait (it just had a "repeat...until Stop"
>loop).
See my thread to Roland about this.

Thanks for your answer.

>
[View Quote]

2 questions.

Nov 11, 1998, 1:52am
Facter, thanks for your posting and the online help this afternoon.
Its stable now with 2 SDK bots, the 3rd one crashes the syten. (and I
had my 2 other Hambots there at the same time, I thought the limit was
3). Got the forward/ back/ sidewards/ up/ down and turning around
movements ready, sorted out the trigonometry this evening. Next:
climbing at an angle, random-walking and figure-skating! I can also
have him say through keyboard input, I'm working on the teleport
option now and trimming the GUI. Pity he can't interact.



On Tue, 10 Nov 1998 18:05:55 +0100, "Walter Knupe" <wak at faber.ping.de>
[View Quote] >Xelag,
>
>XelaG schrieb in Nachricht <36484701.31444845 at news.activeworlds.com>...
>
>I found my bots to dissappear if i don't call aw_wait anymore....
>
>It happens in my C++ programm when i am debugging it and keeping it on hold
>on a breakpoint.
>
>so make sure you have some kind of mainloop that calls aw_init().... i do
>this using a WM_TIMER and calling aw_wait(10); in there, about once a
>second.
>
>
>
>i have no clue there since I am not into VB. but char * is a common
>expressions for API functions as well i think.
>For example, lstrcpy is a WIN32 function (exported from kernel32.dll) and it
>returns a string pointer like that. So see if you can find a declaration for
>that one and use it to create your proper aw_string prototype.
>
>Walter
>
>

2 questions.

Nov 11, 1998, 10:14am
Canopus, i made a mistake in my previous posting: windows does require
an ascii zero check,as you said, doesn't conveniently clip the string.
It's just that I use a constantly a routine that masks that fact...!
;o)

2 questions.

Nov 11, 1998, 10:21am
Sorry for the confusion, both Walter and Facter, I haven't slept for
48 hours because of my deafbot. Walter (I forgot your aw- nickname),
you and your bot [Daniel] were very helpful to me yesterday, many
thanks.

On Wed, 11 Nov 1998 13:49:40 +0800, facter <facterinvurt at hotmail.com>
[View Quote] >
>
>
>Me and Walt are different people Xela =))
>
>Fac.

P.S. he is called [Daniel] your bot, Walter, or am I again mistaken?

P.P.S. and thanks to you, Fac, for your help a few days ago (or am I
again confused?). I'm going to bed!

2 questions.

Nov 11, 1998, 10:25am
Thank you for your posting. I only hope we'll soon be able to use all
the aw.dll features in Visual Basic... XelaG.

Loosing focus

Nov 12, 1998, 5:56am
Same happens to me, also with Hambots. I've made a narrow vertical
panel which fits next to the browser, and click back and forth. It
would be great if the next version of the brouwser could draw in the
background. Another option is using 2 computers on a network, one for
your browser and one for your bot <hehe>. Pas d' chance, hein..?

XelaG

On Wed, 11 Nov 1998 20:31:34 +0100, "jeanphi"
[View Quote] >Hello,
>
>How do you guys do to recover the focus of active world browser ?
>I am programming under Delphi, and when I enter a command, or press a button
>on my application, I loose the focus of the activeworlds brwoser. That leads
>to not seeing the updates until I reclick inside AW browser.
>
>Can someone give me a hint ?
>
>thx
>jeanphi
>

aw_enter hangs in hostile worlds

Nov 12, 1998, 6:05am
Is it VisualBasic or does it also happen in the C community that
aw_enter() hangs and doesn't return rc when attempting to enter
certain worlds? Shouldn't it time out and return an error code? This
happens e.g. in Atlantis - that doesn't allow SDK bots, but also in
Amigos, which I think has no policy against bots. If there is a
workaround, I'd like to know. XelaG. agrigny at xs4all.nl

aw now closed for bots ?

Nov 17, 1998, 7:39pm
As I understand it, an invisible bot is one that entered a world with
aw_enter() but has not called aw_state_change(). If so, how can it be
located in gz or anywhere else. Maybe Roland or someone else could
expand on the subject of invisible bots, or post a url where I could
get more details bout what they can/not do: i.e. can they speak?
Thanks.


On Tue, 17 Nov 1998 12:08:20 -0800, "Roland Vilett" <roland at lmi.net>
[View Quote] >No, the no-GZ rule only applies to visible bots.
>
>-Roland
>
[View Quote]

movement etc...

Nov 15, 1998, 10:31pm
I'd like to give my bot some autonomous movement (like the hambot's
random movement), but don't quite know where to start. I recently
migrated from windows 3.11 (shame on me) so know nothing about
threads, except that they exist. What are the options?

I could create a timer object for each bot (would that be = to
creating a new thread?). I already have one timer object for
aw_wait(). Can anybody give a hint? I use vb, its bad enough having a
deaf bot, I don't want him to look paralized as well!

;o) confused, XelaG

movement etc...

Nov 16, 1998, 8:02am
Thanks Walter aka Faber ! I'll try this later today, your synchretic
code is clear.

XelaG.

On Mon, 16 Nov 1998 02:08:18 +0100, "Walter Knupe" <wak at faber.ping.de>
[View Quote] >Hey Xelag,
>
>XelaG schrieb in Nachricht <364f700e.6446890 at news.activeworlds.com>...
>
>a WM_TIMER is not at all the same as a seperate thread, but since the SDK is
>not thread safe anyway and since it doesn't make sense to move more than
>once a second, a WM_TIMER does the job.
>
>so set up a second timer, and add a routine to it which does the following
>(pseudo code following)
>
>OnMoveTimer ()
>{
> get_old_position();
> my_current_x := my_current_x + random_value_between(-100, 100);
> my_current_z := my_current_x + random_value_between(-100, 100);
> my_current_yaw := my_current_x + random_value_between(-100, 100);
> my_current_yaw := my_current_yaw MODULO 3600;
> int success = aw_change_state();
>
> if (success)
> {
> save_current_position();
> }
>}
>
>well, i think i got 3 languages in the above code, but the point should be
>clear :)
>
>hope that help a little,
>
>Walter aka Faber
>
>

movement etc...

Nov 17, 1998, 7:55pm
Thanks again, Walter, it works fine. I use the same timer for aw_wait
and for the random walk for 3 bots, an array of boleans regulates the
traffic in the movement routine, combining with the 'if success' bit.
The bots step 70 cm per second, from time to time if the browser skips
a heartbeat they gliiiiiiiiide. XelaG.



On Mon, 16 Nov 1998 02:08:18 +0100, "Walter Knupe" <wak at faber.ping.de>
[View Quote] >Hey Xelag,
>
>XelaG schrieb in Nachricht <364f700e.6446890 at news.activeworlds.com>...
>
>a WM_TIMER is not at all the same as a seperate thread, but since the SDK is
>not thread safe anyway and since it doesn't make sense to move more than
>once a second, a WM_TIMER does the job.
>
>so set up a second timer, and add a routine to it which does the following
>(pseudo code following)
>
>OnMoveTimer ()
>{
> get_old_position();
> my_current_x := my_current_x + random_value_between(-100, 100);
> my_current_z := my_current_x + random_value_between(-100, 100);
> my_current_yaw := my_current_x + random_value_between(-100, 100);
> my_current_yaw := my_current_yaw MODULO 3600;
> int success = aw_change_state();
>
> if (success)
> {
> save_current_position();
> }
>}
>
>well, i think i got 3 languages in the above code, but the point should be
>clear :)
>
>hope that help a little,
>
>Walter aka Faber
>
>

Sick of VB6 !

Nov 20, 1998, 10:08pm
Just to say I'll have to find another programming language that has
GUI support. VB6 can't read aw_string and crashes, sometimes
unexpectedly crashes on aw_int, in both cases with an ACCESS VIOLATION
in aw.dll... Can't spend more efforts on this rubbish language. And my
bot was getting so nice: walking, dancing, flying, travelling by foot
to new destinations... I could cry.

I tried compiling the 1st SDK example in C with VC++6, within 15
minutes I had the Speaker bot running and HEARING, a new experience
for me. But GUI support is lacking there, and I really want that too.

Help! Canopus, how's Delphi? I havent programmed in Pascal since
Turbo times under DOS, that's years ago. Does object Pascal support
dlls in C? I have now Delphi 2, it's been given away for free.

Desperately seeking....

XelaG

Sick of VB6 !

Nov 21, 1998, 12:34am
Hi Canopus,

I'll give Delphi 2.0 a try. I need some help, though, to get started.
I have your akSample2eForm.pas and akAWAPI.pas (build 9), but don't
really know how to start. I've been through the code, understand most
of it at first glance, and have a few remarks or questions, besides a
fundamental one:

1. how do you build this project in Delphi for this to work (I know
how to make a form and position buttons etc, thats about it in
Delphi).

In akAWAPI:

2. why do you have to declare the apis twice?

3. you have a PInteger type in
function aw_data (a : AW_ATTRIBUTE; length : PInteger) : PChar;
cdecl;
is this intentional?

4. what does 'const' mean in, for instance,
function aw_create (const domain : PChar; port : Integer; instance :
PAWhInst) : Integer; cdecl;
can't it be just 'domain: PChar'? I couln't find this in the Delphi
help, only the syntax 'const xxx = yyy'.

Any help or suggestions, also about books to read, is welcome! My
e-mail is decastro at cable.a2000.nl, just in case its not appropriate to
answer to the ng.

Thanx, XelaG


On Fri, 20 Nov 1998 19:55:42 -0500, Canopus <aek2 at ix.netcom.com>
[View Quote] >Delphi uses Object Pascal, and so is object-oriented, like C++. It has a
>graphics user interface, with lots of built-in forms and controls, like
>VB6. Unlike some versions of C, even, Delphi's compiler links the aw.dll
>into the AWAPI (now updated to Build 9) smoothly and automatically. Check
>and see how quickly the Delphi versions of Sample 1 and 2 came out
>compared to other languages. I have the 5 construction bot applications
>that I came to the SDK to do finished: I'm just waiting for Beta to be
>over so I can use them.
>
[View Quote]

Sick of VB6 !

Nov 21, 1998, 12:35am
Walter, i'll try Delphi first :o)

On Sat, 21 Nov 1998 01:33:45 +0100, "Walter Knupe" <wak at faber.ping.de>
[View Quote] >maybe its the right time to look into c++ ?
>
>just if you wonder, its possible to write a GUI bot using c++ in VC5.0, so
>6.0 should work too.. this is what [Daniel] is.
>
>Walter
>
>XelaG schrieb in Nachricht <36560038.28775246 at news.activeworlds.com>...
>

Sick of VB6 !

Nov 21, 1998, 3:13am
Got it working for your akSample2eForm.pas, Canopus. Took me a few
hours, wasted time trying to use your pas file as is. I still can't
figure out how to change the name of Unit1. Form1 I can rename through
the properties.

I moved Stop := False from Form.Create to just before the loop,
otherwise I coudn't repeat Button1Click and keep the bots there!

Can one add units without forms? I suppose public procedures etc are
reachable from all units.

I definitely nead a Delphi Tutorial and a good book. None included in
the free distribution, but lots of online help. I coudn't find any
code example yet, except for your code. I need to learn quite fast how
to read/write to file, to INI files, how to manage arrays, and lots
more...

XelaG

Sick of VB6 !

Nov 21, 1998, 3:28am
Thanks, I didn't read your answer till after I posted my "Got it
working" bit...

On Fri, 20 Nov 1998 22:55:53 -0500, Canopus <aek2 at ix.netcom.com>
[View Quote] >There's other useful Delphi information in the earlier Delphi threads,
>especially the instructions on how to build your own Form from the Delphi
>version of Sample 1 and the comments following the Delphi version of Sample
>2.
>
>The declaration part is for support of the other declarations; the
>implementation part is a peculiarity imposed by the way the DLL is linked in
>(a little more info there too). Other than mentioning it in your Uses clauses
>and looking up the correct call format, you don't have to worry about the
>AWAPI unit.
>
>There's a predefined PointerToInteger type in Delphi called PInteger.
>
>Delphi 2 has these constant parameters, I think: it's a way to tell the
>compiler that the value passed will not be changed during the procedure (more
>efficient code, at least with arrays, sets, etc.).
>
>The best Delphi books are those by Marco Cantu, in my opinion. He even has a
>section on connecting to DLL's, which is helpful in understanding our
>situation.

Sick of VB6 !

Nov 21, 1998, 3:36am
>The declaration part is for support of the other declarations; the
>implementation part is a peculiarity imposed by the way the DLL is linked in
>(a little more info there too). Other than mentioning it in your Uses clauses
>and looking up the correct call format, you don't have to worry about the
>AWAPI unit.

Does this mean that the dll is actually linked when building the
programme? or is it an equivalent of the aw.lib file which is linked?

Sick of VB6 !

Nov 21, 1998, 7:22pm
None on my copy of Delphi 2.0. PCPlus claims its the full version. If
you still have the help file, my e-mail is decastro at cable.a2000.nl.

;o)

On Sat, 21 Nov 1998 14:17:35 -0500, Canopus <aek2 at ix.netcom.com>
[View Quote] >Look and see if there's a file with Delphi 2 called VB2Delphi or something
>like that: it came along with Delphi 1, to help VB programmers make the
>move to Pascal. Most versions of Delphi come with a lot of examples; only
>the source for Delphi itself was restricted to Delphi Pro editions.

Sick of VB6 !

Dec 1, 1998, 2:00pm
Thanks for the tip, BB. I'm not the only one who's had these problems
with VB, and I have asked for help regularly here. I didn't hear your
voice then. Maybe you would care to publish your variable
declarations? That would be most helpful.

XelaG



On Tue, 01 Dec 1998 00:21:13 -0500, Leo Mauk <lmauk at netonecom.net>
[View Quote] >"It's a poor workman that blames his tools."
>You need to make sure your Variables are being declared properly.
>VB has the best GUI going.
>
>BB
>
>
[View Quote]

Moving the bots

Nov 21, 1998, 11:35am
The bot reacts to changes in avatar position, gesture and type. If an
avatar comes within range of the bot (or the bot comes within range of
the avatar), the event handler for AW_EVENT_AVATAR_ADD is triggered,
if any avatar within range changes position etc, the handler for
AW_EVENT_AVATAR_CHANGE is triggered, on leaving the avatar triggers
the handler AW_EVENT_AVATAR_DELETE. These handlers must be installed
by you before creating the bot.

When one of these handlers is triggered, you can get the session
number of the avatar in AW_AVATAR_SESSION (call it avS), the position
in AW_AVATAR_X, AW_AVATAR_Z, AW_AVATAR_Y. Say you call these avX, avZ.
avY, your pposition (known to you, you positioned the bot) are myX,
myZ, myY. Then, delta_x = avX - myX etc. and hor_h is the distance
between your bot and the avatar whose event you trapped. If this hor_h
is near enough for your purpose, register the position of your bot (so
it can return there after the chase), the session number avS of the
avatar you are chasing and start keeping track of any event that has
the same avS, until the avatar gets out of range by leaving or when
hor_h gets too large (hor_h is always positive), or you time out the
case. Whenever an event has your victim's avS, adjust the position of
your own bot to follow the avatar.

If you only have one bot, you can adjust the position of your avatar
when you trap the event that would justify the change. If you have
more than one bot running its slightly more complicated: you'll have
to register the proposed changes to your bot's position when the event
occurs, but only call aw_instance_set (select the bot), aw_int_set
(for the new position) and aw_state_change (to send the data to the
world server) from a place where this will not interfere with ongoing
action, for instance, from the aw_wait loop.

XelaG

[View Quote] >I am not sure I see what you are going for. I am using the GNU, which I
>think is of somwhat difference from the AWCPP. I don't know what the
>delta_x, z variables represent in the programming source.
>I also want to understand what each of the values represent (ie, what
>sets the react range, and the follow distance) so I can modify the code
>myself once I get successfull implementation. Also, where in the source
>of the bot would these lines take place? I am not sure if you would need
>to call another event header or what...
>
[View Quote]

Moving the bots

Nov 21, 1998, 11:45am
Remember that the world server may reject your request to update the
position of the bot, if two requests reach the server within one
second, so that you must keep track of that and re-send a request
after a second.

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