Board ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
canopus // User Search
canopus // User SearchAWCPP - C++ release v0.2Oct 30, 1998, 1:58pm
Yes, my construction bots (mover bot, builder bot, surveyor bot, demolition bot) either record
or manipulate the result of aw_query; the survey record is in an editable form. (See the Delphi news above.) What I am testing corresponds to most of your proposal (not the wildly wonderful elliptical stuff, though!), except that I get the radius for each object (hypotenuse) by geometric means (courtesy of Pythagoras) and calculate the effect of the universal rotation starting from the object's arctan angle. Once the radius and angle of the rotated object location are known, the problem becomes a variant of the moving avatar problem (the radius is the distance moved, the deltax/z are derived by sine and cosine from the rotated angle). There is one aspect of the moving avatar problem that becomes clearer in view of this solution, however: in Movement.C, the negative and positive values returned by sine/cosine are correctly interpreted for AW because Movement.C equates the avatar's angle of motion with the avatar's yaw (which in AW is always calculated conterclockwise from N). To allow the avatar to move backwards, or sideways, while continuing to face the old way, one would have to declare a separate angle of motion, being careful to calculate it in AW fashion, with the first quadrant starting at due N. You yourself notice that the object's yaw rotates as it takes the desired path around the circle (the angle of rotation), not according to the angle of the radius where the object is built (the avatar's angle of motion). I heartily agree: math was fascinating in school, but never so much fun! [View Quote] > Don't you just have to manipulate the results of the aw_query? It returns the objects in a > zone. Once retrieved, you can then decide on a center, select the objects and sequence through > each of them applying the same rotation algorithm. > > I am not sure how you want to select your objects. Maybe by owner id, or specify some kind of > bounding box? > > The algorithm you want is more complicated than mine. You don't want to work out the yaw of > the object as a tangent to your circle, that would get you into differentiation - hated that > in school. Given an objects position, a center and an angle of rotation you can work out the > new x,z coords. > > Lets see, if you look at the problem as "how do I move to the edge of my circle at a specified > angle" then you have a simple forward movement from circle center algorithm. > > All you have got to start with is the circle_x , circle_z and object_x, object_z numbers. You > have to work out the radius of the circle you want your object to scribe. I think this is the > hardest part of all this. > > First work out the length of the sides of the triangle. > > delta_x = circle_x - object_x; > delta_z = circle_z - object_z; > > Now work out the angle represented by the object and the circle center. Remember that all > these angle things are in radians. This goes back to the tan(angle) = o/h equation so the > angle = inverse tan(o/h). > > angle = atan(delta_x / delta_z); or = atan2(delta_x, delta_z); > > So the radius is > > radius = delta_z / cos(angle); > > Now to work out the position on the edge of the circle for any angle is simple. > > center_x = 100; > center_z = 100; > angle = 15; > > edge_x = center_x + (radius * sin(angle)); > edge_z = center_z + (radius * cos(angle)); > Move object to edge_x, edge_z; > > You could get fancy if you want to tilt your circle into the y plane. > > angle_yaw = 0; > angle_pitch = 0; > > edge_x = center_x + (radius * sin(angle_yaw)); > edge_z = center_z + (radius * cos(angle_yaw)); > edge_y = center_y + (radius * sin(angle_pitch)); > Move object to edge_x, edge_z, edge_y; > > We are using a constant radius here but what if you wanted to rotate in an ellipse. I guess > the radius would have to change with some function of the angle. Maybe you could set the > radius for each step using > > radius = minimum_radius + (radius_variation * cos(angle)); > > That way your radius would vary from the minimum_radius to the maximum radius (minimum + > variation) based on the angle. > > There is more. We currently have an ellipse whose minimum and maximum dimensions are aligned > with the NS and EW axis. You can now rotate your ellipse in the horizontal or vertical plane > by adding an angle constant to the radius calculation. > > radius = minimum_radius + (radius_variation * cos(angle + (ANGLE%360))); > > You are also going to have to change the yaw of your objects based on how far around the > circle they have moved but I think that's just a matter of adding the angle of rotation to the > objects yaw. > > Of coarse, this is a total guess. Its has been years since I played with math's. Its quite fun > to get back into it again. I was working with my 15 year old son doing algebra the other day. > It takes a while for it all to come back, he is still faster at it than I am. > > Edward Sumerfield. > [View Quote] AWCPP - C++ release v0.2Oct 31, 1998, 1:02am
--------------5E28ECA0E8C29429ABCEF137
Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Nothing special about the arctan business (= your atan2(delta_x, delta_z) ): it should yield the angle at the original object, just above the unlabelled radius on your cool colored diagram. To that angle, I add the user's selected rotation (in degrees). Which allows me to find out what the width of the angle above radius h2 is. On your diagram, the original angle looks like 100 degrees, the rotation like 65 degrees, and the angle of the object to be built looks like 165 degrees. Since it is 165 degrees, and the radius h2 is known, I can proceed to use the avatar solution of sine/cosine routes to the new x and z. Neither the yellow triangle nor the red triangle come into it at all. Of course, I've been so busy reading everybody's fascinating new bot and geometry ideas, that I still haven't tested this out! [View Quote] [View Quote] --------------5E28ECA0E8C29429ABCEF137 Content-Type: multipart/related; boundary="------------72685A34110E35700D520F51" --------------72685A34110E35700D520F51 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <HTML> Nothing special about the arctan business (= your atan2(delta_x, delta_z) ): it should yield the angle at the original object, just above the unlabelled radius on your cool colored diagram. To that angle, I add the user's selected rotation (in degrees). Which allows me to find out what the width of the angle above radius h2 is. On your diagram, the original angle looks like 100 degrees, the rotation like 65 degrees, and the angle of the object to be built looks like 165 degrees. Since it is 165 degrees, and the radius h2 is known, I can proceed to use the avatar solution of sine/cosine routes to the new x and z. Neither the yellow triangle nor the red triangle come into it at all. Of course, I've been so busy reading everybody's fascinating new bot and geometry ideas, that I still haven't tested this out! [View Quote] <P><IMG SRC="cid:part1.363A7DBA.DE282070 at ix.netcom.com" HEIGHT=80 WIDTH=100> <P>Do you mean h1 or h2 assuming the avatar direction follows the yellow arrow? <BLOCKQUOTE TYPE=CITE>To allow the avatar to move backwards, <BR>or sideways, while continuing to face the old way, one would have to declare a separate angle of <BR>motion,</BLOCKQUOTE> I think I will add methods for move_right, move_left, move_up and move_down. All retaining the same yaw. <P>I have decided to extrapolate movement patterns from the Movement class. So I will have a Shape class that can have inherited shapes like circle, polygon or line even. Each version of the Shape class will take a Position object and through multiple calls to its move method will translate the coordinates within the Position object to the next location all around the edge of the shape. <P>You might end up with the following. <P> Circle c(position, radius, step, start angle); <BR> for (int angle = 0; angle < 24; angle++) { <BR> c.move() <BR> aw_change_state <BR> } <P>Edward Sumerfield. <BLOCKQUOTE TYPE=CITE> [View Quote] <P>> Don't you just have to manipulate the results of the aw_query? It returns the objects in a <BR>> zone. Once retrieved, you can then decide on a center, select the objects and sequence through <BR>> each of them applying the same rotation algorithm. <BR>> <BR>> I am not sure how you want to select your objects. Maybe by owner id, or specify some kind of <BR>> bounding box? <BR>> <BR>> The algorithm you want is more complicated than mine. You don't want to work out the yaw of <BR>> the object as a tangent to your circle, that would get you into differentiation - hated that <BR>> in school. Given an objects position, a center and an angle of rotation you can work out the <BR>> new x,z coords. <BR>> <BR>> Lets see, if you look at the problem as "how do I move to the edge of my circle at a specified <BR>> angle" then you have a simple forward movement from circle center algorithm. <BR>> <BR>> All you have got to start with is the circle_x , circle_z and object_x, object_z numbers. You <BR>> have to work out the radius of the circle you want your object to scribe. I think this is the <BR>> hardest part of all this. <BR>> <BR>> First work out the length of the sides of the triangle. <BR>> <BR>> delta_x = circle_x - object_x; <BR>> delta_z = circle_z - object_z; <BR>> <BR>> Now work out the angle represented by the object and the circle center. Remember that all <BR>> these angle things are in radians. This goes back to the tan(angle) = o/h equation so the <BR>> angle = inverse tan(o/h). <BR>> <BR>> angle = atan(delta_x / delta_z); or = atan2(delta_x, delta_z); <BR>> <BR>> So the radius is <BR>> <BR>> radius = delta_z / cos(angle); <BR>> <BR>> Now to work out the position on the edge of the circle for any angle is simple. <BR>> <BR>> center_x = 100; <BR>> center_z = 100; <BR>> angle = 15; <BR>> <BR>> edge_x = center_x + (radius * sin(angle)); <BR>> edge_z = center_z + (radius * cos(angle)); <BR>> Move object to edge_x, edge_z; <BR>> <BR>> You could get fancy if you want to tilt your circle into the y plane. <BR>> <BR>> angle_yaw = 0; <BR>> angle_pitch = 0; <BR>> <BR>> edge_x = center_x + (radius * sin(angle_yaw)); <BR>> edge_z = center_z + (radius * cos(angle_yaw)); <BR>> edge_y = center_y + (radius * sin(angle_pitch)); <BR>> Move object to edge_x, edge_z, edge_y; <BR>> <BR>> We are using a constant radius here but what if you wanted to rotate in an ellipse. I guess <BR>> the radius would have to change with some function of the angle. Maybe you could set the <BR>> radius for each step using <BR>> <BR>> radius = minimum_radius + (radius_variation * cos(angle)); <BR>> <BR>> That way your radius would vary from the minimum_radius to the maximum radius (minimum + <BR>> variation) based on the angle. <BR>> <BR>> There is more. We currently have an ellipse whose minimum and maximum dimensions are aligned <BR>> with the NS and EW axis. You can now rotate your ellipse in the horizontal or vertical plane <BR>> by adding an angle constant to the radius calculation. <BR>> <BR>> radius = minimum_radius + (radius_variation * cos(angle + (ANGLE%360))); <BR>> <BR>> You are also going to have to change the yaw of your objects based on how far around the <BR>> circle they have moved but I think that's just a matter of adding the angle of rotation to the <BR>> objects yaw. <BR>> <BR>> Of coarse, this is a total guess. Its has been years since I played with math's. Its quite fun <BR>> to get back into it again. I was working with my 15 year old son doing algebra the other day. <BR>> It takes a while for it all to come back, he is still faster at it than I am. <BR>> <BR>> Edward Sumerfield. <BR>> [View Quote] --------------72685A34110E35700D520F51 Content-Type: image/gif Content-ID: <part1.363A7DBA.DE282070 at ix.netcom.com> Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="C:\TEMP\nsmailQC.gif" R0lGODlhZABQAPcAAAAAAAAAUhAYxhAhzhgxzhg5zhhC1hhS1iFa3iFj3iFr3iGM5ykhximU 7ymc7yml7ym19yn/GDHG9zHO/zHe/zkpzkpCzlJK1mtj1nNr3oyE3pSM58YpMcbG7+fn9+/v //f3c/8xAP////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /////////////////////////////////ywAAAAAZABQAAAI/gBFCBxIsGBBChQmIEy4UCFC hwwfNpwosWLEixAzUsS4UaHBjx8jarQ4kiPJjihPqjRJAaTLgQtTsixJU2bNlTVfupQIcabN nziB+kSoE+TFozeHKk3KFGXRkCebBp26VCjEpwZZUpVadetPrAejWh3rtexFsAS1dl3Lte1E tDDFmnU7VyhcgWrpsiVb9a6IlHoD873pd29dqgAARIgwuKHfv4Y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SRDs8MI lHB1JYeAZIQfyZEMZ0jDGtZQfY0iG+7ad5YXXtCGkUAMIosWQ8QiGvGIRUTJvjDiEhhG6CmW QaIUj4grCo3kJU584ksAkJW1yIVE78OiArX4HMAd6oO008kYyUigQAlvT2DJIhvLiDciAccv cpwjG+2lx+pdL499DOQcxwdIQRryickr5CEXeRfrKZKRkMSKIyNJSTw68pGVzKRALolJTXry k6AMpShHScpSmlInAQEAOw== --------------72685A34110E35700D520F51-- --------------5E28ECA0E8C29429ABCEF137-- AWCPP - C++ release v0.2Oct 31, 1998, 1:48am
Just tested out the code for a builder bot modified to build a blueprint
with a rotation, if requested. Seemed to work. You can check the results at 8s 93w on Beta, where there is a simple building to your south that was moved by a mover bot to that location, and the same building design, rotated 180 degrees, on your north, built by the revised builder bot. (Also, further to the south, there is an empty space where there used to be a huge building that was cleanly and neatly demolished by a demolition bot, without touching the neighboring property.) While I was there, I got some neighborly advice that matrix math was a good way to do rotations. [View Quote] [View Quote] AWCPP - C++ release v0.2Oct 31, 1998, 11:42pm
The builderbot code that takes care of rotating the building objects
goes like this: deltax := objx - builderbotx; deltaz := objz - builderbotz; deltah := Hypot(deltax, deltaz); deltaw := Arctan2(deltax, deltaz) + Rotation; SinCos(deltaw, sinix, cosiz); deltax := sinix * deltah; deltaz := cosiz * deltah; objx := builderbotx + deltax; objz := builderbotz + deltaz; The middle 5 lines of straightforward trigonometry could be replaced by 2 lines of matrix math (thanks to Netropolis for this suggestion): deltaz := (deltaz * Cos(Rotation)) - (deltax * Sin(Rotation)); deltax := (deltaz * Sin(Rotation)) + (deltax * Cos(Rotation)); [View Quote] [View Quote] AWCPP - C++ release v0.2Oct 31, 1998, 11:58pm
The matrix math lines should read:
newdeltaz := (deltaz * Cos(Rotation)) - (deltax * Sin(Rotation)); deltax := (deltaz * Sin(Rotation)) + (deltax * Cos(Rotation)); deltaz := newdeltaz; [View Quote] > The builderbot code that takes care of rotating the building objects > goes like this: > deltax := objx - builderbotx; > deltaz := objz - builderbotz; > deltah := Hypot(deltax, deltaz); > deltaw := Arctan2(deltax, deltaz) + Rotation; > SinCos(deltaw, sinix, cosiz); > deltax := sinix * deltah; > deltaz := cosiz * deltah; > objx := builderbotx + deltax; > objz := builderbotz + deltaz; > The middle 5 lines of straightforward trigonometry could be replaced by > 2 lines of matrix math (thanks to Netropolis for this suggestion): > deltaz := (deltaz * Cos(Rotation)) - (deltax * Sin(Rotation)); > deltax := (deltaz * Sin(Rotation)) + (deltax * Cos(Rotation)); > [View Quote] AWCPP - C++ release v0.2Nov 1, 1998, 5:04pm
As well as the above code segment, that rotates the building, there is the
segment (mentioned in earlier discussions) that rotates each object as it moves into its new location further along the circle (objw is the object's yaw). objw := objw + Rotation; This code works for the standard trigonometric version and the compact version taken from matrix math. The matrix math version, by the way, seems to be nothing but the two "addition formulas" of trigonometric analysis, cos(x + y) = (cos x * cos y) - (sin x * sin y) sin(x + y) = (sin x * cos y) + (cos x * sin y) after one has substituted in for the constant radius (hypotenuse) and the known values of the relative coords at angle x (treating the rotation as angle y). [View Quote] > The builderbot code that takes care of rotating the building objects > goes like this: > deltax := objx - builderbotx; > deltaz := objz - builderbotz; > deltah := Hypot(deltax, deltaz); > deltaw := Arctan2(deltax, deltaz) + Rotation; > SinCos(deltaw, sinix, cosiz); > deltax := sinix * deltah; > deltaz := cosiz * deltah; > objx := builderbotx + deltax; > objz := builderbotz + deltaz; > The middle 5 lines of straightforward trigonometry could be replaced by > 2 lines of matrix math (thanks to Netropolis for this suggestion): > deltaz := (deltaz * Cos(Rotation)) - (deltax * Sin(Rotation)); > deltax := (deltaz * Sin(Rotation)) + (deltax * Cos(Rotation)); > [View Quote] building objectsOct 26, 1998, 4:49pm
To do work on someone else's objects, you'll need to get a privilege
password from them. See Changing The Owner, above, for some possibly relevant information and one solution. [View Quote] > if i log in a bot under one Citnumber, can i place an object that > belongs to another Citnumber? > eg: > logn as 610932 > place an obj as 271946 aw_queryNov 7, 1998, 1:54am
First try reading the document called "Property" (which is all about Queries)
and then study Sample Program 2 (there are 5 lines that use Cell or Sector coords derived from a specific AW location, 1N 1W in the program). [View Quote] > A couple of questions to whoever can help: > > 1) aw_query requires the int x_sector and int z_sector parameters. Are these > real AW coordinates (i.e. 32N, 5W) or are they the reference to the sector > in the zone ? > > 2) I have noticed that aw_object_number occasionaly returns some large and > sometime negative number. The following is part of a dump of values > retrieved from Virtualy which has about 65,000 objects. > > 57837,286443,905945912,-9500,2500,9000,900,v5012.rwx,, > 57838,286443,905945912,-10000,2600,9000,1800,v5231.rwx,, > 1622163995,188537,909781012,-9200,3000,9100,0,col10m02.rwx,, > 926433427,188537,909781016,-9200,3000,9350,0,col10m02.rwx,, > 2043787557,188537,909781038,-9200,2050,9350,0,col10m02.rwx,, > > The first number is the aw_object_number which makes sense in the first two > lines. Is this normal ? What do the negative numbers mean ? > > Thanks for for your help. > > Lucio & Emanuele aw_queryNov 7, 1998, 2:15pm
In Sample Program 2, the Query is used to find a midispk object which has been
placed at 1N 1W on Beta world (this shows up in the CellX, CellZ in the first line of handle_cell_object). These coords place it in SectorX=0, SectorZ=0 (this shows up in the lines making calls to aw_query near the end of main and in the middle of handle_query). SectorX=0, SectorZ=0 define the center Sector of a 9-Sector Zone, ranging from X= -1 to +1 and Z= -1 to +1 (this shows up in the sanity-check line in handle_cell_begin). You and the server communicate about the Zone with reference to an array of 9 Sector-status containers, which is passed back and forth during communications (Querying a Zone can take many communications). The array is indexed from 0 to 2 in two dimensions, so you have to convert your 9 SectorX and 9 SectorZ coords to the corresponding array indexes: subtract your center SectorX and SectorZ from 1, and then add the difference to the current SectorX and SectorZ array indexes (this shows up in the last line of handle_cell_begin: 1,1 minus 0,0 = 1,1, so you add 1 to SectorX and 1 to SectorZ when indexing the array). When I tested out the Delphi version of Sample Program 2, I placed a midispk at Beta 1S 78W. So the line in my CellObject handler tests Cell_X = 78 and Cell_Z = -1. That's in a Zone whose center Sector is at SectorX=10, SectorZ=0. So I did aw_query(10, 0, SEQUENCE) at the end of the main procedure and in the ReQuery handler. And the sanity-check in the CellBegin handler tests whether SectorX<9, SectorX>11, SectorZ<-1, SectorZ>1. The line at the end of CellBegin updating the SEQUENCE array adds the appropriate differences to the array indexes: SEQUENCE[SectorZ + 1, SectorX - 9] finds the Sector-status container in the array which is ready to be updated. [View Quote] > First try reading the document called "Property" (which is all about Queries) > and then study Sample Program 2 (there are 5 lines that use Cell or Sector > coords derived from a specific AW location, 1N 1W in the program). > [View Quote] aw_queryNov 9, 1998, 3:11pm
It sounds reasonable to me. I've programmed a surveyor bot that reads the entire
contents of a Zone (each object with its 10 attributes) into a textfile that anyone can edit; and a builder bot that builds from a textfile of that type. My original idea was to use a database, since databases are an integral part of the Delphi system (including SQL, Access, Paradox, etc.), and I reduced it to textfiles only to make the bots accessible to everybody. There are two world-builders that I know of who are working on SDK mappers for their worlds, one working in Delphi. The bots can only query one Zone at a time, and live input mode is good only for that Zone. Will you have your bot move around from Zone to Zone to detect new construction? By the way, Virtualy is a beautiful place. All the trouble you took to build with so many landscape objects was worth it. [View Quote] > Thanks to both. > > I had looked at the Property section of the Docs but was confused on the > specific aw_query parameters I asked about. One reason I got confused is > because I thought the ZONE was always referenced with respect to the > position of the bot... thinking back I don't know how I got that idea. > > My objective is to build a bot that will keep the world synchronized with an > SQL database. I am the builder of "Virtualy", a world entirely covered with > a modular surface. The fact that the entire surface is covered with objects > makes it impossible to use the traditional registry-based building control. > To overcome this I have developed an SQL database structure (for the moment > in MS-Access) which is periodically fed by a propdump. I have a set of > queries and SQL scripts that allow me to monitor and do "bulk" maintenance > on the world (For example: assign all objects in an area to a citizen so he > can modify the ground and remove trees). > > The current problem is that changes made to the world by other citizens > between the propdump and propload phases are lost. I believe an on-line SDK > bot would eliminate this problem. I also think such a sync process should be > fairly straight forward and similar to what the browser normaly does with > the local cell.dat cache. > > My next step would be to build a reverse process that builds in the world > from new records in the SQL database. This would eliminate the need for > builder bot scripts (used in the beginning to create Virtualy) or the merge > and propload which I currently use. > > In practice what I am aming at is an ODBC interface to the World Database > :))) > > Comments on this idea ? > > Lucio 2 questions.Nov 10, 1998, 3:02pm
When I read your previous message, I noticed you were having some of the
same problems I faced when converting the AWAPI from C to Object Pascal for Delphi programmers. (Like the C use of 0 to mean nil.) I had never actually tried to field multiple bot instances, so I wondered if that part of the Delphi AWAPI would actually work, since it gave aw_create a third parameter that is a Pointer to an untyped Pointer, and you said that in VB, a simple variable parameter worked better. (Also that aw_instance_set should be passed an untyped value.) I don't know if it is relevant, but I did roughly the same program as the one you describe (based on the multibot SDK document), and the three bot avatars appeared, said their speeches, and then hung around until I finally pressed the Stop button to aw_destroy each of them. Believe me, I don't know why the C version of aw_create insists upon being passed the address of an untyped Pointer, but at least it works. (In Pascal, you can't pass a nil into a parameter coded as var {=ByRef} or const, so I had to declare the parameter as a Pointer to an untyped Pointer.) [View Quote] > 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 10, 1998, 5:46pm
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). [View Quote] > 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 10, 1998, 10:41pm
Yep, after about two and a half minutes of SDK inactivity, the server did
finally erase my three bots. (Watching them go through calisthenic routines one after the other was worth the wait.) What if I don't use aw_wait and instead give bot commands? Will the server erase them anyway? And how long is "-1" milliseconds (in one of the examples)? [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] More Than 1 Bot (Delphi)Nov 12, 1998, 2:23pm
This is a multi-part message in MIME format.
--------------45021886792784937FA91E06 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Programming more than one bot can be difficult, even in C, and certainly in other languages (see the above threads started by XelaG). This seems to be due primarily to typing instance parameters and the use of aw_wait in the absence of callbacks. Attached is Sample2e, a Delphi program that initializes three bots, lines them up in a row, has them identify themselves, and lets them stand around long enough to demonstrate the need for aw_wait. --------------45021886792784937FA91E06 Content-Type: application/x-zip-compressed; name="Sample2eForm.zip" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="Sample2eForm.zip" UEsDBBQAAAAIALVcayVG4ER4/wUAACgZAAASAAAAYWtTYW1wbGUyZUZvcm0ucGFz1Vhbb9pI FH6v1P9wpF0tsKWIy1atwma1hNAWiZsCWdK8oMGewDS2x5oZQijqf99zxjYYAqHpkkhLFLCP Z87lO5f5YMlu+8wPPV7mH6XyCz2mv79+BcvBVGgIlZwo5gMzhvuh0WAk3AjuuVCBscR7ZkAG HIzweRXMlC/A5b4MtFHMcFRDMqHgjnnCFWYB4wVowwJXBBMQATBwplLNtCdQCeo644ZBqfCu D+8/DAHXgQ45u8XVBXSK/maBMLDpcpXkIjBc3TCH20WaazI+FIEr5zoPba41m3C86i/0pREe XtU9pjWJPikWToVDIhkYJekh6cWPc8E8OdF5UoZWa8Nar4k6jFs3ipY17o29si6YRWhDHtwo f+0hnIJDlrID0pmzmqDHAu6VTmBgL6opYXlL2EY4aSF9xqKzmTEyIGF0FYsbCDAJ6TMlKm+K oi3l7c2YaIe7M8UT7XVPOLfZPg9crnBxd/yVOyb3YDXFVFcck314bWz6Ec2hEndx3QAsoRfd YkkhglhQAgsLvtuFszFqWa2zdzuWAaZKhnACZ1J6nD0MtiUnIjiTJov/HeZzXNo3CsutClc9 qfG2iXU14SryD32uRmV4xxQJNjJ9spV5u6XeHDSvG51R57J91rhYK4wefu5eXPav8vHF9cbj 168caiQYdi9a51hFmTE2Rya2L8iEzwNjwyXJ8tcL+L1w/rFtG2Ud4qZPhUPpjQMD5Wz5CiTo 1acsvkXESnl6L9v3Cj6tDadN9LgKy1qQ3ABOERbALKDucKEnbaNSN485Yh8lBMQNZG39Fgb8 3lCwmRxIFQnLaSHOkwDSWyHukUILZ4gu1Fw3m2mQDagLI77h6s7MH+Ptb7aehIcRYatpPZfK zSRVSi9+v+qSONP2kpA4BTYfCRw92dpwdHbZbJ2vNpLruOTPv6D4g95dBmzscRqlpBEnDHoJ drBgI2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PL 0LV8EHUlPxFsMXy8Krx+9S9QSwECFAAUAAAACAC1XGslRuBEeP8FAAAoGQAAEgAAAAAAAAAB ACAAtoEAAAAAYWtTYW1wbGUyZUZvcm0ucGFzUEsFBgAAAAABAAEAQAAAAC8GAAAAAA== --------------45021886792784937FA91E06-- aw now closed for bots ?Nov 12, 1998, 11:14pm
So, under the new AW rules, if Tazunu Inoue's Castle, which contains about
5680 objects, were to be moved to a better site by a mover bot, it should be broken down into 57 parts to be separately moved and reassembled? Or would the mover bot satisfy the AW server if it called aw_wait(60000) after every 99th object in the building? [View Quote] > Is it true, that the main world AW is now closed for bots as well ? > > its bad that aw_enter does not return giving an error code, and > its even MORE bad that beta seems the only bot open place now.... > > bots are not that interesting if you run them in an empty world only... > > Walter aka Faber aw now closed for bots ?Nov 13, 1998, 1:53pm
Maybe you could speed up the review by collapsing all objects added in the same
cell to one, and then evaluating only those cases with more than n cells on that day. After all, the most common kind of obnoxious building is paving over a lot of cells at once (and then leaving them undeveloped). Constructing a 150-object park (in a few cells) for someone to put a home in shouldn't raise a flag. [View Quote] > Actually, technically the ban only applies to the addition of new objects, > so your mover bot would be exempt. > > Unfortunately, the way the ban is enforced is by tallying the daily number > of ADDs by citizen and then checking on anyone who registers above a certain > threshold, so if you did move 5680 objects from one place to somewhere else > it would show up as 5680 adds, assuming the move is implemented by deleting > all of the old objects in the old location and then adding them all again in > the new location. I guess you'd better drop me an email before doing it so > I know to watch out for it. > > Sigh, I *really* need to get those building quotas implemented one of these > days... > > -Roland > [View Quote] aw now closed for bots ?Nov 14, 1998, 9:31pm
The new AW rules try to prevent obnoxious builder bots and obnoxious avatar
bots. The rule that a bot can only build so many objects (or cells) in one day is good for AW citizens as well as the AW server, because it discourages obnoxious paving programs everywhere in AW. The rule that avatar bots can't run in or near GZ is good mainly for the AW server, because it doesn't discourage obnoxious avatar bots that come and occupy ordinary citizens' property away from GZ. Everybody can mute avatars to discourage them, but gangster bots, unlike their doltish owners, will have the patience of an evil angel. Being able to see the name of an obnoxious citizen or tourist helps to inhibit them, but seeing the [bot's name] is currently useless, as it totally hides the malicious or stupid owner. I suggest that the AWAPI servers display the owner's name plus the program's stated bot-name, so that the same tactic of exposure can be applied, for example, showing [Brat's GangsterBot] instead of just [GangsterBot]. [View Quote] > Is it true, that the main world AW is now closed for bots as well ? > > its bad that aw_enter does not return giving an error code, and > its even MORE bad that beta seems the only bot open place now.... > > bots are not that interesting if you run them in an empty world only... > > Walter aka Faber aw now closed for bots ?Nov 17, 1998, 3:00pm
Does the usual bot rule forbidding bots at or near the GZ area exclude doing an
aw_query of property at or near the GZ area (assuming the bot is invisible or is outside the GZ area)? [View Quote] > Oops. Sorry about that. I upgraded AlphaWorld to a 2.1 server last night, > and I forgot that 2.1 worlds disallow all bots by default. > > I've now set AlphaWorld to allow all bots. Consider this an "experimental" > condition. The usual bot rules apply, including: 1) no bots at or near the > GZ area, and 2) no large-scale automated building (small SDK auto-building > projects of 100 objects or less will be tolerated for the time being as long > as no noticeable problems arise on the server side). > > SDK apps have great potential for good, but also, unfortunately, for harm. > We will see how it goes with AlphaWorld allowing all bots. If there are too > many problems and/or abuses we may close it to bots in the future. > > -Roland > > ps. the aw_enter() problem should be fixed in build 8 of the SDK, just > posted now. > [View Quote] aw now closed for bots ?Nov 17, 1998, 8:22pm
Sample 2 is an example of an invisible bot that is located somewhere (it doesn't
need to have an avatar to change the midi on the midispk object, but Sample 2 only applies to midispk at 1N 1W--there are altogether 5 lines of code which won't work except at or near the GZ area of Beta, and must be replaced if the bot is to work elsewhere, even on Beta). [View Quote] > 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] Build 9 (Delphi)Nov 15, 1998, 4:23pm
This is a multi-part message in MIME format.
--------------60CEAEA877B74AC9B3497BC2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Attached is the Delphi AWAPI unit, updated for Build 9 of the aw.dll. --------------60CEAEA877B74AC9B3497BC2 Content-Type: application/x-zip-compressed; name="Build9AWAPI.zip" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="Build9AWAPI.zip" UEsDBBQAAAAIAE2cbCV6ANLBPwwAAIlBAAALAAAAYWtBV0FQSS5wYXPFGmtv48bxuwH/h4W/ nGy4bhEgH3pCgFISbTNHkSpJnR9FK9DS2mZCiQ5J2ecc7r93dvnatyj7rlWACzmz856d2R36 a/y7dWXNnLNZXHw7PDg82G6SEtXAIQF8PZng9OkxQQP/7je8LBGsXMbpMVrhZRrncZlkmwLF mxVK1k9ZXqI0ucvj/PXwAN1nOSofMbKWZfKM0VWWp6sCAeMTKirZlDi/j5eYyi1wASToKtms spfiFE1xUcQPGJ7C12JeJik8jdO4gHVUryWILZF1tZha1wsrigJnNI/shWt7F9El+gX99PPP Q2bVaO64EwD/nRIfHgxO/vI9f0R1wy9GJfyXowTdoS08YQTG7ua6x+/kmFhVvj5hYm3rD7B4 QHQDmOtfON7Cs6b2KQeZWWF45QcTHupfeXYgLAycz45rX9gakg7vzacjPbVCBcBZ4xseaM1m rjO2Isf3eIQ9tRz3FA1ONlmJIG9W6O6V5lk4+UTcQJfOPeezHYT2YhT4V6EdLKaO50zn01Md PrBd2wptLX5kR5aEBCe4Ey3rChtGVhBJuMC+cMIooObByz/nTmC3/hw7kXNre4IfWyjjvwYm RqSBV74SgJEzJRvlPJK4aCPcrHCmU+ei1pqwkeRdzxwDmnViA3OtMKoiK632AeFMnVbPyqGs /RUkciJXAI2s8adJ4M946EXgz70JD/NHv9rjCCyOLpWIwD4P7FDA0XKyCJyLS0E5G5LB9qLF xAfPe8oVXkTSTUaEM3vsWG4tN1QtaaxaMMkiYC4C2/Y0uJE7F9w0tgIIySdQaGzNrJHjOtEN vwJsh1oyjmx4tCbOPOTRs/kId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dyXvW1kairMuuDwzmncdRy8z7f40wJxLho+b+/i8WJrd1EmTpu75smB3HUcvM TZ9BzIxbSkUn1X8vMfNsCFUlVf9dxcyzpTQw3fMDjLm1cTyrSg2ws8OD/wJQSwECFAAUAAAA CABNnGwlegDSwT8MAACJQQAACwAAAAAAAAABACAAtoEAAAAAYWtBV0FQSS5wYXNQSwUGAAAA AAEAAQA5AAAAaAwAAAAA --------------60CEAEA877B74AC9B3497BC2-- Bot BusinessNov 15, 1998, 5:14pm
Should we give away our bot-programs? Or should we offer to run them
on someone else's behalf (getting their citizen# and privilege-password)? There are serious technical problems for either approach. (No, this is not a discussion of "how to make money from VR programming", which rightly belongs in the wishful thinking newsgroup.) If I were a non-programmer citizen, I'd hesitate to run a bot-program on my computer, if it came from some virtual person, free or not. And expecting ordinary citizens to scan open-source code looking for viruses, when even programmers can't figure out other programmers' code, is hopeless. So should we offer to run our bot-programs on our own machines? All builder-bot services, including the DJ Bot of Sample 2, can only be given away if the recipient lends us a citizen# and a privilege-password. The problem with the privilege-password is that it is too broad. Until the citizen revokes it, a privilege-password can be used to build or demolish objects owned by the citizen in any location in any World. If all I want is to have the programmer run a builderbot to build me a lawn and garden at x,z on AW, I don't want to put all my other objects on AW and other worlds at jeopardy. It's like having to give passwords to all my bank accounts in cities all over the world just to withdraw money from one account in Chicago. There should be SDK methods in support of secure transactions. The problem here is trying to use a universal password for a particular account. Is there some way that a privilege password can say which Zone on which World it applies to? Or is there some other way to get round this problem? Bot BusinessNov 15, 1998, 10:40pm
Do you mean that (when it becomes legal to do so--see next comment) you will
give the citizen the program and the citizen will run the SeedBot program? or that you will get a citizen# and privilege password from the citizen and you will run the SeedBot on your machine (apparently this is already legal)? [View Quote] > SeedBot asks for a citizen number and privilege password to use to build the > seed object with. That's probably the best way to do it - make it > customizable based on input, INI file settings, etc. > [View Quote] Bot BusinessNov 20, 1998, 8:27pm
Is it okay for programmers to exchange program code designed for the SDK?
[View Quote] > There is a little problem to give away the bot-programs: > <an excerpt from the licence agreement for the SDK> > BETA LIMITATIONS. The Active Worlds SDK is currently Beta Software and is provided as is for the purposes of > evaluation and testing only. By downloading the beta version of the SDK, you agree to not distribute the > SDK, nor any applications based on the SDK, to any person for any reason. > :((( > [View Quote] Bot BusinessNov 20, 1998, 10:49pm
I did--an *.exe is an application, mere code is not (an application is code in a form that users can execute on their
computers). I just want to make sure that SDK programmers really could exchange code, as happens here on the newsgroup all the time, or post their source where other programmers could see it. We can also run our own SDK applications. But we can't distribute them: that's all that is currently forbidden. [View Quote] > read the fine print - "to ANY person for ANY reason" :(( > [View Quote] Problems with AW_QUERYNov 17, 1998, 8:13pm
Is the line that updates the Sequence array correct? Shouldn't the z precede the
x? (Just the reverse of everything else!) [View Quote] > I am working on an SDK app that should keep an SQL database in sync with the > World Database. The reason for this is to help in the maintenance of my > world Virtualy for which I already periodically propdump and load onto SQL > server. In the long term however I want to create a building assistant bot. > > The program below works fine for the first number of aw_query calls. > However, after a some 100 calls the aw_query starts to send the same objects > back, apparently ignoring the the sequence numbers. > > The code is based on the Sample #2 apps on the SDK Docs. I have added some > command line parameters. The last parameter toggles between a debug output > (showing the sector and sequence numbers exchange) and a propdump format. > > I have reviewed the code and compared it to the sample (which used to work > also on Virtualy) but have run out of neurons to find the bug. My C skills > are quite new. > > Thanks. > > Lucio > > // sqlbot.cpp : Defines the entry point for the console application. > // > > #include "stdafx.h" > #include "aw.h" > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > > #define ONE_HOUR (60 * 60 * 1000) > > #define DBNTWIN32 > #include <stdio.h> > #include <windows.h> > #include <sqlfront.h> > #include <sqldb.h> > > void handle_cell_begin (void); > void handle_cell_object (void); > void handle_cell_end (void); > void handle_query (int rc); > > int err_handler(PDBPROCESS, INT, INT, INT, LPCSTR, LPCSTR); > BOOL gbOpen = FALSE; > > int owner; > int sequence[3][3]; > int speaker_x; > int speaker_y; > int speaker_z; > int speaker_yaw; > int speaker_number; > int cell_x; > int cell_z; > int coord_x; > int coord_z; > int sect_x; > int sect_z; > > int flDebug; > > typedef struct strOBJECT_T > { > int AW_CELL_X; > int AW_CELL_Z; > int AW_OBJECT_NUMBER; > int AW_OBJECT_OWNER; > int AW_OBJECT_BUILD_TIMESTAMP; > int AW_OBJECT_X; > int AW_OBJECT_Y; > int AW_OBJECT_Z; > int AW_OBJECT_YAW; > int AW_OBJECT_MODEL_LEN; > int AW_OBJECT_DESCRIPTION_LEN; > int AW_OBJECT_ACTION_LEN; > char AW_OBJECT_MODEL[255]; > char AW_OBJECT_DESCRIPTION[255]; > char AW_OBJECT_ACTION[255]; > > } strOBJECT, *pstrOBJECT; > > int DBInsertObject(char* user, char* pwd, char* server, pstrOBJECT obj); > > main (int argc, char *argv[]) > { > > int rc; > > /* check command line */ > if (argc < 7) { > printf ("Usage: %s number password world NS WE DebugFlag\n", argv[0]); > exit (1); > } > > flDebug = atoi(argv[6]); > > /* initialize Active Worlds API */ > if (rc = aw_init (AW_BUILD)) { > printf ("Unable to initialize API (reason %d)\n", rc); > exit (1); > } > > /* install cell update event handlers */ > aw_event_set (AW_EVENT_CELL_BEGIN, handle_cell_begin); > aw_event_set (AW_EVENT_CELL_OBJECT, handle_cell_object); > aw_event_set (AW_EVENT_CELL_END, handle_cell_end); > > /* install query callback */ > aw_callback_set (AW_CALLBACK_QUERY, handle_query); > > /* create bot instance */ > if (rc = aw_create (0, 0, 0)) { > printf ("Unable to create bot instance (reason %d)\n", rc); > exit (1); > } > > /* log bot into the universe */ > owner = atoi (argv[1]); > aw_int_set (AW_LOGIN_OWNER, owner); > > aw_string_set (AW_LOGIN_PRIVILEGE_PASSWORD, argv[2]); > aw_string_set (AW_LOGIN_APPLICATION, "SQL Bot Test"); > aw_string_set (AW_LOGIN_NAME, "SQL Bot Test"); > if (rc = aw_login ()) { > printf ("Unable to login (reason %d)\n", rc); > exit (1); > } > > /* log bot into the world */ > if (rc = aw_enter (argv[3], 0)) { > printf ("Unable to enter world (reason %d)\n", rc); > exit (1); > } > > /* issue first property query */ > > coord_x = atoi(argv[4]); > coord_z = atoi(argv[5]); > > sect_x = aw_sector_from_cell(coord_x); > sect_z = aw_sector_from_cell(coord_z); > > if (flDebug) > printf ("Starting query at: %d, %d \n", coord_x, coord_z); > > aw_query (sect_x, sect_z, sequence); > > /* keep it running long enough !!! */ > while (!(rc = aw_wait (ONE_HOUR))); > > /* close everything down */ > aw_destroy (); > aw_term (); > return 0; > > } > > void handle_cell_begin (void) > { > int x, z; // used as indices for the sequence array > > cell_x = aw_int(AW_CELL_X); > cell_z = aw_int(AW_CELL_Z); > > if (flDebug) > printf ("Starting Cell: %d, %d \n", cell_x, cell_z); > > x = aw_sector_from_cell(cell_x) - sect_x; > z = aw_sector_from_cell(cell_z) - sect_z; > > if (flDebug) > printf (" Sec: %d, %d \n", x, z); > > /* sanity check: make sure sector coordinates are within range */ > if (x < -1 || x > 1 || z < -1 || z > 1 ) > { > if (flDebug) > printf ("Sector out of Range !!!"); > return; > } > > sequence[x+1][z+1] = aw_int(AW_CELL_SEQUENCE); > > if (flDebug) > { > printf (" Seq: %d, %d, %d\n", > sequence[2][2],sequence[1][2],sequence[0][2]); > printf (" %d, %d, %d\n", > sequence[2][1],sequence[1][1],sequence[0][1]); > printf (" %d, %d, %d\n", > sequence[2][0],sequence[1][0],sequence[0][0]); > } > } > > void handle_cell_end (void) > { > cell_x = aw_int(AW_CELL_X); > cell_z = aw_int(AW_CELL_Z); > > if (flDebug) > printf (" End: %d, %d \n\n", cell_x, cell_z); > > } > > void handle_cell_object (void) > { > > pstrOBJECT pObj; > > pObj = (pstrOBJECT) malloc(sizeof(strOBJECT)); > > pObj->AW_CELL_X = aw_int(AW_CELL_X); > pObj->AW_CELL_Z = aw_int(AW_CELL_Z); > pObj->AW_OBJECT_NUMBER = aw_int (AW_OBJECT_NUMBER); > pObj->AW_OBJECT_OWNER = aw_int (AW_OBJECT_OWNER); > pObj->AW_OBJECT_BUILD_TIMESTAMP = aw_int (AW_OBJECT_BUILD_TIMESTAMP); > pObj->AW_OBJECT_X = aw_int (AW_OBJECT_X); > pObj->AW_OBJECT_Y = aw_int (AW_OBJECT_Y); > pObj->AW_OBJECT_Z = aw_int (AW_OBJECT_Z); > pObj->AW_OBJECT_YAW = aw_int (AW_OBJECT_YAW); > pObj->AW_OBJECT_MODEL_LEN = strlen(aw_string (AW_OBJECT_MODEL)); > pObj->AW_OBJECT_DESCRIPTION_LEN = strlen(aw_string > (AW_OBJECT_DESCRIPTION)); > pObj->AW_OBJECT_ACTION_LEN = strlen(aw_string (AW_OBJECT_ACTION)); > wsprintf(pObj->AW_OBJECT_MODEL, "%s", aw_string (AW_OBJECT_MODEL)); > wsprintf(pObj->AW_OBJECT_DESCRIPTION, "%s", aw_string > (AW_OBJECT_DESCRIPTION)); > wsprintf(pObj->AW_OBJECT_ACTION, "%s", aw_string (AW_OBJECT_ACTION)); > > /* DBInsertObject("sa", "", "server", pObj);*/ > > if (!flDebug) > { > printf("%d %d %d %d %d %d %d %d %d %s%s%s\n", > pObj->AW_OBJECT_OWNER, > pObj->AW_OBJECT_BUILD_TIMESTAMP, > pObj->AW_OBJECT_X, > pObj->AW_OBJECT_Y, > pObj->AW_OBJECT_Z, > pObj->AW_OBJECT_YAW, > pObj->AW_OBJECT_MODEL_LEN, > pObj->AW_OBJECT_DESCRIPTION_LEN, > pObj->AW_OBJECT_ACTION_LEN, > pObj->AW_OBJECT_MODEL, > pObj->AW_OBJECT_DESCRIPTION, > pObj->AW_OBJECT_ACTION); > } > > free(pObj); > > } > > void handle_query (int rc) > { > > if (!aw_bool (AW_QUERY_COMPLETE)) > { > aw_query (sect_x, sect_z, sequence); > if (flDebug) > { > printf ("Resend Query: %d %d\n", sect_x, sect_z); > printf (" Seq: %d, %d, %d\n", > sequence[2][2],sequence[1][2],sequence[0][2]); > printf (" %d, %d, %d\n", > sequence[2][1],sequence[1][1],sequence[0][1]); > printf (" %d, %d, %d\n\n", > sequence[2][0],sequence[1][0],sequence[0][0]); > } > } > else > printf ("Query Complete.\n"); > > } Finding a Bot's OwnerNov 17, 1998, 8:03pm
I'm trying to develop a Bank Teller Bot that will accept virtual
deposits and withdrawals from another Bot that has been sent to the Bank. What method should the Teller Bot use to identify the Bot's Owner? The Bot's Session can be gotten from AW_EVENT_AVATAR_ADD, but this doesn't lead me to the Owner that is running the depositing avatar's Session. Doing a read of aw_login_owner seems to give me the Teller Bot's owner. Will I get from the depositor avatar's Name to its owner's Number (by way of aw_citizen_attributes_by_name) if I start from AW_AVATAR_NAME, even though the avatar is the avatar of a bot and not the avatar of a citizen? Finding a Bot's OwnerNov 17, 1998, 9:17pm
Whispering would be nice, but the documents warn us that the Chat type whisper is
only currently restricted to a bot session. (And I may want to stamp the owner number on a goldbar object in the bank vaults: the password wouldn't work too well there.) A virtual owner would be making a virtual deposit via the bot, which could patiently wait for the bank to open, etc. Anyway, a lot of things would be easier to do if we could find out the owner of a bot, not the least being to prevent an obnoxious real person hiding behind a bot avatar on the assumption that there's no method for finding out a bot's owner. [View Quote] > Interesting scenario you are setting up. I see you are driven to make this a > financial environment aren't you. A couple of comments. > > 1. Why do you need a bot to deposit money into a VBank. Wouldn't real > people be doing that? > > 2. The depositors name is not enough to identify the depositor. I assume > that a VBank customer must open an account in order to deposit money? If that > is the case then the opening of an account can result in a new password for > the back account. When the depositor wishes to interact with a teller they > must whisper the password to the teller and therefore gain access to deposit > or withdraw from the account. > > Edward Sumerfield. > [View Quote] Finding a Bot's OwnerNov 17, 1998, 9:20pm
Can the Teller Bot determine whether the Avatar is a Bot?
[View Quote] > At this time, It is not possible to determine another bot's owner through > the SDK. > > -Roland > [View Quote] Finding a Bot's OwnerNov 18, 1998, 1:24am
It should be possible to set up, deposit to, withdraw from, or transfer an
account by means of a bot. And it should be possible for the owner of a virtual bank to leave it, relying on a Teller Bot. The security of an account depends on finding out the owner of the bot that arrives at the bank; and it equally depends on finding out the owner of a bot who claims to be a Teller Bot. If your avatar or your bot whispers your account password to a conman bot that is merely standing in the bank waiting to fleece innocent bots that turn up there, your account is in trouble. (And vice versa.) [View Quote] > Interesting scenario you are setting up. I see you are driven to make this a > financial environment aren't you. A couple of comments. > > 1. Why do you need a bot to deposit money into a VBank. Wouldn't real > people be doing that? > > 2. The depositors name is not enough to identify the depositor. I assume > that a VBank customer must open an account in order to deposit money? If that > is the case then the opening of an account can result in a new password for > the back account. When the depositor wishes to interact with a teller they > must whisper the password to the teller and therefore gain access to deposit > or withdraw from the account. > > Edward Sumerfield. > [View Quote] Reason code 200? - add objectNov 18, 1998, 4:49pm
See the thread rc 200 above.
[View Quote] > Hello.. > > I'm having a problem adding and changing objects....I'm using the code > > exactly as listed in the documentation for aw_object_add and > aw_object_change. > > I'm just trying to do something simple - create an object and move it > around.... > > When I attempt to add an object, the object appears in the world, with > all the > right attributes filled out, but I get "unable to add object (reason > 200)" > > I don't see reason 200 on the list, but I assume it has something to do > with permissions, > or something like that. I do have bot rights and building > rights...(eminent domain rights). > Restricted radius in the world is 0. > > After that, when I attempt to change the object with the object number > returned in > AW_OBJECT_NUMBER and the X and Z coords, I get "Unable to change object > (reason 310)" (no build rights) and then the same error message with > reason 204 > (can't find old element). > > So - first step is to understand reason 200 - anybody know this one? > > Second - I'm a bit unsure about why one needs to identify an object > with both > the object number *and* the X and Z coords - shouldn't the object number > alone > suffice? Or is it not guaranteed to be unique? > > The code - (SDK calls look strange because I'm using the version for the > Gnu compiler ) > > // Create Object > > Xcoord = 2000; > Zcoord = 2000; > > altitude = 1000; > yaw = 0; > > (AWIntSet) (AW_OBJECT_X, Xcoord); > (AWIntSet) (AW_OBJECT_Z, Zcoord); > (AWIntSet) (AW_OBJECT_Y, altitude); > (AWIntSet) (AW_OBJECT_YAW, yaw); > > (AWStringSet) (AW_OBJECT_MODEL, "tree01.rwx"); > (AWStringSet) (AW_OBJECT_DESCRIPTION, "PineTop Airways"); > > if (rc = (AWObjectAdd) ()) > printf ("Unable to add object (reason %d)\n", rc); > else > puts ("Object added"); > > object = (AWInt) (AW_OBJECT_NUMBER); > > // change object position > > (AWWait) (5000); > > for (i = 0; i<100; i++) { > > deltaX = 1000; /* place holders - These will be random > displacements */ > deltaZ = 1000; > > (AWIntSet) (AW_OBJECT_OLD_NUMBER, object); > (AWIntSet) (AW_OBJECT_OLD_X, Xcoord); > (AWIntSet) (AW_OBJECT_OLD_Z, Zcoord); > (AWIntSet) (AW_OBJECT_X, Xcoord+deltaX); > (AWIntSet) (AW_OBJECT_Z, Zcoord+deltaZ); > > Xcoord += deltaX; > Zcoord += deltaZ; > > if (rc = (AWObjectChange) ()) > printf ("Unable to change object (reason %d)\n", rc); > else > puts ("Object changed"); > > (AWWait) (1000); > > } > > Etc.... > > Any suggestions appreciated...... > > Thanks > > Chris Langton > AKA MockingBird |