Board ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
roland vilett // User Search
roland vilett // User Searchrc 200Sep 21, 1998, 9:08pm
Oops, sorry, this is a bug in the SDK that will be fixed in the next build.
It should be returning 0. World server reason codes start at 200, and the SDK is currently adding 200 to the reason codes that come back from the world server, however it should be checking for RC_SUCCESS and not adding 200 in that case. Thanks for pointing out the problem! -Roland [View Quote] Reason 416Sep 22, 1998, 3:47pm
RC_RECEIVE_FAILED means that the low-level socket read call (recv) failed.
It's hard to be more specific than that because this can occur for any number of reasons. But in general, it means some kind of network communication problem has occurred. It could be that your network connection dropped, the world server went down, or anything that would interfere with socket communications. Does this happen every time you try to run your app? When your app fails, can you run the AW browser from the same PC without problems? -Roland [View Quote] Reason 416Sep 23, 1998, 4:16pm
Ah! Okay, your problem is that during the beta test of the SDK, SDK apps
will *only* work within the main COF universe. I'm sorry if this was not made very clear. The additional functionality of the SDK requires version 2.1 of our uniserver, which is still in testing here at COF. The main COF universe is running a prototype of the 2.1 uniserver, which is why SDK apps do work in our universe. To write SDK apps that work within your galaxy, you will have to wait until version 2.1 of Active Worlds is released later on this year. In the meantime, you are welcome to use the world called "beta" in our universe for any and all SDK testing and development. By default Hambot does not use the new SDK functionality, so that is why Hambot does work in your galaxy. -Roland [View Quote] Reason Code 454Sep 24, 1998, 9:42pm
Error 454 means there is a version mismatch between the aw.dll file you are
using and the version of the SDK you compiled for. If you are using the latest SDK (build 5) and you are getting this error, that means there is an aw.dll from a previous build on your PC somewhere that Windows is picking up when you are running your application. Make sure the latest build 5 aw.dll is in the same folder as your SDK application. This doesn't have anything to do with protecting the SDK from "being edited". It's to prevent the crashes that might occur if you try to use the wrong build of aw.dll with your app. -Roland [View Quote] object adding/modification/deletionSep 27, 1998, 12:28am
Object creation and manipulation is no doubt by far the most difficult
aspect of using the SDK. As soon as I get a free moment, I'm going to create Sample Application #2 for the SDK which will implement a simple DJ bot, much like yours, although I plan to have it simply rotate through a fixed list of MIDI files to keep it simpler. One problem with your app is that it creates the juke box object each time you run it. That's fine for testing but for a real bot that's not good because you are going to wind up with a pile of juke boxes, one on top of the other, one for each time you ran your bot. A better approach I think is to create the juke box object yourself (by hand) and instead have the bot look for it when it starts up. However this is a bit tricky because it involves using aw_query(), probably the single most complex call in the SDK. I will illustrate all of this in the next sample application. One thing that you'll have to change in your code as it currently stands is that after the aw_object_add() call succeeds, you'll need to query and save the value of the AW_OBJECT_NUMBER attribute. This is a 32-bit integer that uniquely identifies the object within the cell. Then before the call to aw_object_change(), set AW_OBJECT_OLD_NUMBER to this value. The AW_OBJECT_NUMBER attribute is assigned by the SDK, not by you. The docs are not particularly clear on this point right now. Each time you call aw_object_change(), you'll need to query the object number again for the subsequent call to aw_object_change(), something like this: int number; aw_int_set (AW_OBJECT_X, 1000); aw_int_set (AW_OBJECT_Y, 0); aw_int_set (AW_OBJECT_Z, 700); aw_int_set (AW_OBJECT_YAW, 2250); aw_string_set (AW_OBJECT_MODEL, "zjuke.rwx"); aw_string_set (AW_OBJECT_DESCRIPTION, "-Playing-"); aw_string_set (AW_OBJECT_ACTION, "create sound http://midivault.ml.org:81/misc/Nebula.mid"); if (rc = aw_object_add ()) printf ("Unable to add object (reason %d)\n", rc); else { puts ("Object added"); number = aw_int (AW_OBJECT_NUMBER); } .... /*Music=============================Music*/ if (strstr (aw_string (AW_CHAT_MESSAGE), music1)) { aw_say ("*starts up the juke box* -KICK-"); aw_int_set (AW_OBJECT_OLD_NUMBER, number); aw_int_set (AW_OBJECT_OLD_X, 1000); aw_int_set (AW_OBJECT_OLD_Z, 700); aw_int_set (AW_OBJECT_X, 1000); aw_int_set (AW_OBJECT_Y, 0); aw_int_set (AW_OBJECT_Z, 700); aw_int_set (AW_OBJECT_YAW, 2250); aw_string_set (AW_OBJECT_MODEL, "zjuke.rwx"); aw_string_set (AW_OBJECT_DESCRIPTION, "Local H -Bound For The Floor"); aw_string_set (AW_OBJECT_ACTION, "create sound http://midivault.ml.org:81/bands/Local_H/BoundForTheFloor.mid"); if (rc = aw_object_change ()) printf ("Unable to change object (reason %d)\n", rc); else { puts ("Object changed"); number = aw_int (AW_OBJECT_NUMBER); } [View Quote] problem with a botSep 27, 1998, 4:42pm
Well it probably has something to do with how you are using the ofstream
class. I'm not a C++ expert so I'll let someone else in this newsgroup look at that part. I should mention that you should not pass aw_int (AW_MY_X) in for the sector coordinates to aw_query(). AW_MY_X is in units of centimeters, whereas sector coordinates are in units of 80 meters. In sample app #2 I'll show how to convert from centimeter coordinates to sector coordinates. -Roland [View Quote] problem with a botSep 27, 1998, 10:24pm
It's possible there may be a problem with the aw_query() call in synchronous
mode then. I assume you haven't installed the AW_CALLBACK_QUERY callback, so that means the aw_query() call will not return until the query request completes. I'll try to look at this soon. -Roland [View Quote] problem with a botSep 30, 1998, 4:48pm
Actually, not quite...the first 1K or 2K of property data (depending on
whether it is a 2.0 or 2.1 world) is returned from a single call to aw_query(). If there is more data available, the app must adjust the sequence number list based on the results of the first query and issue additional queries. Again, I will illustrate how to do this in sample app #2, hopefully within the next couple of days. -Roland [View Quote] Delphi (Object Pascal)Oct 2, 1998, 2:44am
> This may interest those AW
>citizens who were discouraged when they heard that knowledge of C/C++ >would be necessary to use the new SDK. Just a teeny-tiny nit-pick, but you only need to know C to use the SDK. C++ isn't necessary :) -Roland Request of the SDKOct 2, 1998, 2:37am
Dontchya worry, we got ya covered :)
The 2.1 world browsers and servers will allow a world owner to restrict which bots, if any, can come into their world. If you are currently experiencing problems with people bringing uninvited SDK bots into your world and causing problems, please email me at roland at activeworlds.com and I will deal with it. SDK users, I really hope it goes without saying that during the beta it is *not* appropriate to run your SDK programs inside other people's worlds without their permission. This will not be tolerated. -Roland [View Quote] Do I need a Universe Server for using sdk ?Oct 2, 1998, 4:13pm
No it is not necessary to have your own universe server. You may run SDK
apps within the main COF universe. Currently, you may use the COF world "beta" to test your SDK programs, or you can run them in your own personal world instead. In fact, currently the COF universe is the *only* universe out there that will support the SDK, since the SDK features require a version 2.1 universe, which is not released yet (the COF universe is running a 2.1 prototype). -Roland [View Quote] Do I need a Universe Server for using sdk ?Oct 2, 1998, 8:08pm
>Suppose I have a world ( personnal server ).
>Could you tell me an very simple exemple of program using the SDK that would >interfere into my world ? Please see Sample Program #1 in the SDK documentation: www.activeworlds.com/sdk >Now, this program should be running from my personnal computer or from the >world personnal server ? It doesn't matter. SDK applications interact with the servers across the network so they can run any computer anywhere as long as it has internet access. -Roland When the courses will start ?Oct 2, 1998, 8:07pm
The SDK course will occur sometime after the SDK is released. It is still
currently a beta version only. I wouldn't want to inflict beta software on my poor hapless students. :) -Roland [View Quote] Roland: SDK docs for viewing off-line?Oct 4, 1998, 9:00pm
Maybe at some point in the future, but currently the SDK documentation is
still changing too much for it to make sense to distribute an offline version. -Roland [View Quote] callbacksOct 7, 1998, 2:41pm
>There is practically no difference between callbacks and aw_event_set
>functions. Its just a way for the SDK to call your code. > >I don't understand why the SDK implements them using different mechanisms. There is a conceptual difference. Callbacks occur in order to report the results to you of specific actions that your app has triggered, e.g. adding an object, looking up a citizen, etc. Success or failure of the request is common to all callbacks, thus the callback functions take a single int rc argument. Meanwhile, events can happen at any time, not necessarily in response to your application's actions. They don't have a concept of succeeding or failing, thus the event handlers do not take any arguments. -Roland callbacksOct 7, 1998, 11:06pm
I did the best job I can do of explaining callbacks in the "Asynchronous
Operation" section of the SDK docs: http://www.activeworlds.com/sdk/asynchro.htm -Roland [View Quote] Non-Bot Ideas?Oct 7, 1998, 2:53pm
This is a multi-part message in MIME format.
------=_NextPart_000_0060_01BDF1D8.46BA8220 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The potential applications of the SDK, even in its relatively simple = current form, are literally endless. Anything from the simplest greeter = bot to elaborate multi-player role playing games complete with teams, = score, and complex puzzles are possible. I know it sounds corny, but = the limit really is your own imagination. Just to get started, take a = look at the "Bot Ideas" section of the web page. It is only the tip of = the iceberg. =20 You can only do so much in the action field. Try to imagine how you = might implement a complex role playing game complete with items that can = be picked up/dropped, and hit points, using the action field. For = applications like this, you need some form of central "intelligence" = managing the state of the game, locations of all players, etc. That's = where the SDK comes in. =20 That said, I'm not interested in having a discussion here about whether = or not the SDK is useful. It's clear that most people perceive its = potential, which is why so many people are already trying to use it even = in its early beta stage. If you can't see its potential, I'm sorry for = you, but please don't fill up this particular newsgroup with criticisms = of the SDK. You are welcome to carry on that discussion in one of the = general-purpose AW newsgroups such as awcommunity. =20 -Roland [View Quote] Just a couple of ideas. You know one of the frustrating things I = am dealing with is trying to envision all the 3d work that I will be = getting into to make these bots really work. Much of the work is on the = visual side. Building the appropriate gestures, adding new avatars to = take on new rolls. Adding objects that can be moved by bots. I back = ground is programming so writting the intellegence is no problem. My = learning curve is creating objects. Oh well time will tell. ------=_NextPart_000_0060_01BDF1D8.46BA8220 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"> <HTML> <HEAD> <META content=3Dtext/html;charset=3Diso-8859-1 = http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 = Transitional//EN"> <META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR> </HEAD> <BODY bgColor=3D#ffffff> <DIV> <DIV><FONT size=3D2>The potential applications of the SDK, even in its = relatively=20 simple current form, are literally endless. Anything from the = simplest=20 greeter bot to elaborate multi-player role playing games complete with = teams,=20 score, and complex puzzles are possible. I know it sounds corny, = but the=20 limit really is your own imagination. Just to get started, take a = look at=20 the "Bot Ideas" section of the web page. It is only the = tip of=20 the iceberg.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>You can only do so much in the action field. = Try to=20 imagine how you might implement a complex role playing game complete = with items=20 that can be picked up/dropped, and hit points, using the action = field. For=20 applications like this, you need some form of central = "intelligence"=20 managing the state of the game, locations of all players, etc. = That's=20 where the SDK comes in.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>That said, I'm not interested in having a discussion = here=20 about whether or not the SDK is useful. It's clear that most = people=20 perceive its potential, which is why so many people are already trying = to use it=20 even in its early beta stage. If you can't see its potential, I'm = sorry=20 for you, but please don't fill up this particular newsgroup with = criticisms of=20 the SDK. You are welcome to carry on that discussion in one of the = general-purpose AW newsgroups such as awcommunity.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>-Roland</FONT></DIV></DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: = 5px"> [View Quote] ------=_NextPart_000_0060_01BDF1D8.46BA8220-- Which robot saw it?Oct 9, 1998, 2:50am
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01BDF305.A6F1EA60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable In this example, your AVATAR_ADD callback is going to be called 50 = times, once for each deer (assuming the person approached within range = of all 50). Within the context of your callback, just call = aw_instance() to determine which instance the callback is for. In the = first call to your callback, aw_instance() will be instance handle for = the first deer that saw it. Well, in theory, anyway. In practice, if the deer are close together, = the person is probably going to enter the "field of view" of several = deer simultaneously, since the world servers update the positions of = avatars relative to all others once per second. If within that one = second the person becomes visible to several deer at once, it's going to = be random which one gets the AVATAR_ADD first. -Roland [View Quote] The aw_event_set(AW_EVENT_AVATAR_ADD, function); allows me to set a = function to be called if an avatar approaches the bot within some = distance. The function called is not passed any arguments to indicate = which bot noticed the approaching avatar.=20 There should probably be a "void *instance" parameter passed to the = function to indicate this.=20 It will not look good for all my deer to run away at the same time.=20 Edward Sumerfield.=20 ------=_NextPart_000_0007_01BDF305.A6F1EA60 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"> <HTML> <HEAD> <META content=3Dtext/html;charset=3Diso-8859-1 = http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 = Transitional//EN"> <META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2>In this example, your AVATAR_ADD callback is going = to be=20 called 50 times, once for each deer (assuming the person approached = within range=20 of all 50). Within the context of your callback, just call = aw_instance()=20 to determine which instance the callback is for. In the first call = to your=20 callback, aw_instance() will be instance handle for the first deer that = saw=20 it.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Well, in theory, anyway. In practice, if the = deer are=20 close together, the person is probably going to enter the "field of = view" of several deer simultaneously, since the world servers = update the=20 positions of avatars relative to all others once per second. If = within=20 that one second the person becomes visible to several deer at once, it's = going=20 to be random which one gets the AVATAR_ADD first.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>-Roland</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: = 5px"> [View Quote] ------=_NextPart_000_0007_01BDF305.A6F1EA60-- Lame question :)Oct 13, 1998, 12:45am
Yes AW_AVATAR_GESTURE indicates the current gesture (if any) in progress for
that particular avatar. Using AW_AVATAR_GESTURE can be a clever way to get your bot to respond when other users press the various gesture buttons on the toolbar. In fact this opens the possibility of using the gesture buttons for other features entirely...it conveniently provides a mechanism whereby users can control or communicate with your bot simply by pressing buttons in the toolbar. :) -Roland [View Quote] aw_create returns error # 429 - what does it mean?Oct 13, 1998, 12:42am
429 means the SDK was not able to establish a connection with the universe
server. Was your internet connection active at the time? If so, were you trying to enter the COF universe or some other universe? At this time SDK apps will only run within the main COF universe. I've now added 429 to the reason code list. Not sure how I missed it the first time around...sorry about that. -Roland [View Quote] SDK updateOct 13, 1998, 12:24am
Hi everyone,
Build 6 of the SDK is now available. Please update at your earliest convenience. Build 6 fixes a bug which caused aw_wait() to return an error when connection to the server was lost. Normally if the server connection is lost, the SDK transparently attempts to re-establish the connection without troubling your application about it. Build 6 also contains one new API method aw_sector_from_cell() which is a utility function I added to make writing applications which manipulate property a little bit easier to write. Please see the docs for a complete description. The SDK docs have also been updated. Sample Application #2 is now available (as promised, a simple "DJ Bot" program.) Also, I've added a new topic called "Property" which describes the property mechanism in some detail, in particular how to use aw_query. I think that even with this new section property is still somewhat confusing. If anyone has any suggestions on how I can improve the docs in this area, please let me know. -Roland Java Native Interface for AW SDKOct 13, 1998, 7:36pm
Hi DrChandra,
thanks very much for your heroic efforts! I'm sure many people will find your JNI useful. Since it comes up so often, I'd like to add the question "Can I write SDK applications in Java?" to the SDK FAQ and provide a link to your JNI. I realize it isn't done yet, but then again neither is the SDK, so... :) -Roland [View Quote] Java Native Interface for AW SDKOct 31, 1998, 2:35am
I just wanted to mention, I'm sure everyone's definition of "big bucks" is
different, but I have recently seen the standard edition of Visual C++ 6.0 for sale at online software sites for as little as $80 to $90. Just skip past the ~$800 "professional" version (which they usually list first) and look further down the list, you'll probably find it there. If you find yourself spending inordinate amounts of time struggling with a freeware compiler, you might want to consider Visual C++...I don't want to sound like I'm actually pushing Microsoft software or anything (gasp), but the Visual line of development tools really are useful products to have around, especially if you are going to be doing a fair amount of programming under Windows. Among other things, the help files come with a complete Windows API reference, which is something you absolutely must have on hand if you are going to be doing any GUI programming. It also comes with MFC, which a lot of people find useful, although I don't use it much myself. -Roland [View Quote] small bugOct 13, 1998, 5:19pm
Hi,
I've discovered a small bug in the 2.0 world servers that will cause bots that enter a world using an identity with Public Speaker to receive AW_EVENT_CHAT events even if the bot has not called aw_state_change() yet. In this case, the bot will receive the chat events but will not receive AW_AVATAR_ADD or AW_AVATAR_DELETE events, so it might be a bit confusing. The problem will be fixed in the 2.1 version of the world server. I doubt this bug will affect anyone seriously but I just wanted to mention it in case anyone runs into it and can't figure out what is going on...it sure threw me for a loop :) -Roland MFC botOct 14, 1998, 4:26pm
Don't #include "aw.lib". aw.lib is not a C header file, it is a binary file
which is why you are getting all those errors. -Roland [View Quote] more on the PS bugOct 14, 1998, 9:20pm
Hi folks,
earlier I posted a message that stated there was a small bug in the 2.0 world servers that caused bots that logged in under an account with PS to receive AW_EVENT_CHAT events even if they hadn't called aw_state_change() first. Since then I've discovered that there is more to this bug. In fact it appears that 2.0 world servers send *all chat messages in the entire world* to any user or bot with PS privileges, regardless of how far apart they are, and regardless of whether they have called aw_state_change() or not. The problem with this is that the chat messages will be sent even if the speaker's avatar is out of range, so the bot can wind up receiving AW_EVENT_CHAT events from users for whom it never received an AW_AVATAR_ADD. This means that for those CHAT events for received from users who are out of range, the AW_AVATAR_NAME attribute will not be correct. This has been going on for a while, but no one ever noticed until now because the AW browser ignores any chat messages that it receives for any user for whom it hasn't first received an AVATAR_ADD. I've fixed this problem in the 2.1 world servers so that it now operates as I believe it was originally intended: PS users receive all chat messages from everyone in the world who is within a fixed range of 200 meters in any direction. This means that there is still a possibility that a PS bot can receive an AW_EVENT_CHAT event for a user without getting an AW_EVENT_AVATAR_ADD first if there are more than 50 people packed into a single 200 x 200 meter area, but this is still very unusual. I will probably change the SDK to simply ignore the CHAT event in this rare instance. -Roland Time sequencing...Oct 14, 1998, 10:35pm
No VRT is not built into the SDK. VRT is simply GMT minus two hours.
You'll have to write your own code in your bot to calculate the current time in VRT. There are a variety of calls under Windows that can give you the current time in GMT. time() is one of them. -Roland [View Quote] Time sequencing...Oct 15, 1998, 9:06pm
A slight correction here...
time() does not return a tm structure, I believe you are thinking of localtime(). time() returns a time_t which on most systems is a 32-bit integer specifying the number of seconds that have elapsed since 12 AM, January 1, 1970. There are routines available in the Windows API to convert back and forth between the various ways of representing time. For example I believe localtime() takes a time_t as an argument and converts it to a struct tm. Windows has a dizzying array of different formats for storing time values. It's almost as if each programming team that developed a certain Windows subsystem created their own personal time format, complete with their own series of functions to operate on it... -Roland [View Quote] dialog based bot.... questions & errorsOct 15, 1998, 8:55pm
>Roland might change his include file (and his dll source as well) to use
>"const char *" whenever he does not need to change the supplied string. I don't believe any strings passed to the API are modified anywhere in the SDK. The SDK always makes its own copies of everything. Are you saying I should change all "char *" in the function prototypes to "const char*"? I can do this easily, if it will help. I have to admit that this is one area where my knowledge is a bit hazy... Thanks, Roland dialog based bot.... questions & errorsOct 16, 1998, 5:17pm
Not sure if this is related to your problem or not, but the world AWTeen is
actually running a 2.1 world server and it was set to not allow any bots in. I just changed it to allow any bots in (for now). If your bot was trying to enter AWTeen it would not have worked before about 5 minutes ago. -Roland [View Quote] |