Board ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
scifair // User Search
scifair // User SearchPassing a Variable to a urlAug 3, 2001, 4:27pm
Does anyone know of a simple way for me to send a variable to a web browser
when pulling up a url from a bot? For example aw_url_send just lets me put in the url, but I need to be able to send a variable (such as to an ASP page) so that a slightly different page could be opened depending on the variable. This is for a bot that I am writing in c++ if that makes any difference. Thanks in advance, Bogey Passing a Variable to a urlAug 8, 2001, 4:06pm
> I think he wants to get the url form the page....therefore woul;dnt want
to > specify it in the URL, becuase in theory, he wouldnt know what the variable > is yet...if you catch my drift. yeh i think that kind of catches what i meant, so i don't think the following would work: since i would use the following to send the url and it would look like: aw_url_send(someuser, "www.somehost.somedomain/somepage.asp?somevariable=somevalue", NULL); I would still have to add a new aw_url_send for each value of somevalue since it wouldn't interpret it as a variable but just as an int or a string or whatever it is. Does anyone know of anyway to get around this?? Thanks, Bogey Passing a Variable to a urlAug 9, 2001, 1:35pm
> If I understand correctly... You want the bot to send a URL to the client,
> along with a variable. The variable will determine which page will be > displayed, or can just fill in certain parts. That's exactly what I want to do. Grimble aqnd faber suggested good solutions to my original post being that since I am sending the URL from the bot, I should build the string in the bot code and then use aw_url_send. The problem is I forgot to mention that in my bot there are 440 different variable values so to do it that way I would have to use 440 different aw_url_send's. If somehow I could get aw_url_send to recognize that what I was sending was a variable holding an integer value as opposed to just a string I could do it with just one aw_url_send. [View Quote] I haven't done anything in CGI or PERL so I'm not exactly sure how they work. I think that I run into the same problem that I did above though. If im looking at that wrong or if anyone can think of a way to get around it I'd appreciate. Thanks for your help so far and sorry if I've been a little confusing . Bogey Public Speaker rights in BotsAug 22, 2001, 6:00pm
I am trying to make a bot that will log all of the conversations that happen
in my world. The only problem is every instance of the bot can only "hear" things that are within 20 degrees of it. Ex. If my bot was at GZ the farthest convo it could pick up would be at 20N 20W. Is there any way around this other than creating a bunch of instances and placing them throughtout the world? I tried giving myself Public Speaker rights and being the bot owner I thought maybe that would do it but it doesnt seem to work, Any suggestions? Thanks, Bogey Public Speaker rights in BotsAug 23, 2001, 3:51pm
I don't suppose that there is any way that I could get other people's
whispers either even being caretaker of the world? Public Speaker rights in BotsAug 24, 2001, 3:35pm
The worlds that I am doing this for are private worlds run in the
Educational Universe that are run on our own servers. People are told that their convo's will be recorded and their used for research purposes. (something about group dynamics in virtual world space, im not really involved in this part) so don't worry no laws are being broken here. :) [View Quote] what do aw_init() and aw_term() do?Aug 8, 2002, 11:01am
Hi,
I am running bots as a Win32 service, and I wonder what I need to do to restart a bot. 1. Can you call aw_init(), then aw_term(), the aw_init() again? 2. Is it impossible for the initializations done in aw_init() to run amuck so that a service could reliably reload itself just by killing the bot with aw_destroy() and creating it again? Right now, I run the bot as a child process of the service so that I can cleanly unload and load it again. It is safest, but running the whole service as one process would be cleaner and more configurable. Also, aw_init() accepts an argument which is the current build of the SDK. It does not return an error if you pass the wrong build number. This implies that you can link against build 22 and later, maybe, run against build 27 of aw.dll. That means the SDK internally keeps lists of the various AW_ATTRIBUTES and other enums from old builds so it can translate to the current SDK? Or does it fail silently? Thank You, Drew what do aw_init() and aw_term() do?Aug 8, 2002, 1:32pm
Thanks for the advice. I am just trying to figure out whether the
appropriate way to restart a Windows service for the AW SDK is to restart a child process, thread, or just the bot. Since it is possible to initialize and terminate a second time cleanly, then restarting the thread is an easy-enough option. I didn't mean anything bad by my phrase "running amuck," just that typical problems requiring service restarts are related to memory allocation or the state of the network communications, and destroying all of the bots does not promise to reset either. The VERSION_MISMATCH error is simple, too. I missed it running through the list. Thanks Again, Drew hellppp! n00b! :)Jul 16, 2003, 4:08pm
cin.get leaves the line terminator in the stream. So each input is reading
the endline immediately. Either use getline, or extract the endline manually between inputs. -- -Rich [View Quote] Use SDK event handler inside a class instanceMar 5, 2005, 9:47pm
neophile-
You can use a static member function as an event handler. If you want an instance method to handle the event, you can make the static one call to its instances. I think it is possible to use an instance function as an event handler, but you'd have to use an awkward and dangerous hack of some sort. (I know that if you wrap the SDK for .NET, you can use delegates that wrap instance functions as handlers.) However, this is a bad idea, and I don't think it will do what you want, especially if you are installing the handler in a class constructor. Think what happens if you create a second instance of the class: it takes over the event handling. Then if you destroy the class, you no longer have a functional handler. You're much better off making a static handler, which need not be a plain C function. Maybe you want an event-handling class with static event handlers, to which your other objects may register as event listeners? Consider deriving classes that will be listeners from an event-listener abstract class. -- Rich [View Quote] VB.NET Timers & AwSdkMar 31, 2005, 8:09pm
Hi Richard-
I'm going to guess that it's because the SDK is in an aw_wait when you're trying to do the say command, and it seems that the wrapper or SDK is synchronizing SDK calls. Try changing that aw_wait in your main loop to use a non-infinite wait time (preferably one that is relatively short). Are you certain the sub is exiting, and not blocking (waiting) on the aw_say call? Is it throwing an exception? If you're going to have a multi-threaded app (yours is multi-threaded already because you are using a timer) you should be synchronizing to make it thread-safe yourself anyway. You could do something like using SyncLock(sdk) around any groups of SDK calls (and do something analagous around any data or other resources that might be shared between threads). Of course, this is only my guess as to what's happening; I've never used the particular wrapper you are using. -- Rich [View Quote] VB.NET Timers & AwSdkMar 31, 2005, 11:24pm
The timer he's using uses an event to signal, specifically the Elapsed event
(this is not a system event). Either way, the handler would run in a different thread from the main loop (in this case a system thread). In fact his code uses at least 3 threads, one in the main execution thread, one to operate the timer, and one for the timer's callback (plus however many the SDK adds). -- Rich [View Quote] VB.NET Timers & AwSdkMar 31, 2005, 11:26pm
VB.NET Timers & AwSdkApr 1, 2005, 1:52am
Sounds more like the thread's going to sleep to me. If you let it run, does
it print that first line each time the timer elapses, or does it only enter the handler and print once? While your debugger is running, turn on Debug->Windows->Threads. If the handler is entered repeatedly (and if you have a breakpoint there), what happens in your Threads window? -- Rich [View Quote] VB.NET Timers & AwSdkApr 1, 2005, 2:08am
When using the System.Timers.Timer timer (as Richard is using), the
application's process gets handles to 2 new threads, one when the timer starts, and one the first time the timer elapses. It gets no new handles to system timer objects or any other system objects, as far as I can tell. Maybe there is a system timer being used that is buried somewhere in a library such that the process never gets a handle for it, but it's much more likely that the timer is implemented as a thread sleep on that first timer-related thread. -- Rich [View Quote] VB.NET Timers & AwSdkApr 2, 2005, 12:24am
Good to know. Did you look at the threads window in the debugger? Is it
creating a new one each time it does this, or is it re-using the same thread? -- Rich [View Quote] beginner. need help.Jul 10, 2001, 6:32pm
Hello,
I need to change the avatar that a user has, by clicking on a definite physical object in my world. Which attribute (AW_MY_TYPE or AW_AVATAR_TYPE) needs to be changed? I am including the code for this action in my event handler for avatar clicks. Is that correct? thanks, scifair214 Passing a Variable to a urlAug 3, 2001, 4:27pm
Does anyone know of a simple way for me to send a variable to a web browser
when pulling up a url from a bot? For example aw_url_send just lets me put in the url, but I need to be able to send a variable (such as to an ASP page) so that a slightly different page could be opened depending on the variable. This is for a bot that I am writing in c++ if that makes any difference. Thanks in advance, Bogey Passing a Variable to a urlAug 8, 2001, 4:06pm
> I think he wants to get the url form the page....therefore woul;dnt want
to > specify it in the URL, becuase in theory, he wouldnt know what the variable > is yet...if you catch my drift. yeh i think that kind of catches what i meant, so i don't think the following would work: since i would use the following to send the url and it would look like: aw_url_send(someuser, "www.somehost.somedomain/somepage.asp?somevariable=somevalue", NULL); I would still have to add a new aw_url_send for each value of somevalue since it wouldn't interpret it as a variable but just as an int or a string or whatever it is. Does anyone know of anyway to get around this?? Thanks, Bogey Passing a Variable to a urlAug 9, 2001, 1:35pm
> If I understand correctly... You want the bot to send a URL to the client,
> along with a variable. The variable will determine which page will be > displayed, or can just fill in certain parts. That's exactly what I want to do. Grimble aqnd faber suggested good solutions to my original post being that since I am sending the URL from the bot, I should build the string in the bot code and then use aw_url_send. The problem is I forgot to mention that in my bot there are 440 different variable values so to do it that way I would have to use 440 different aw_url_send's. If somehow I could get aw_url_send to recognize that what I was sending was a variable holding an integer value as opposed to just a string I could do it with just one aw_url_send. [View Quote] I haven't done anything in CGI or PERL so I'm not exactly sure how they work. I think that I run into the same problem that I did above though. If im looking at that wrong or if anyone can think of a way to get around it I'd appreciate. Thanks for your help so far and sorry if I've been a little confusing . Bogey Public Speaker rights in BotsAug 22, 2001, 6:00pm
I am trying to make a bot that will log all of the conversations that happen
in my world. The only problem is every instance of the bot can only "hear" things that are within 20 degrees of it. Ex. If my bot was at GZ the farthest convo it could pick up would be at 20N 20W. Is there any way around this other than creating a bunch of instances and placing them throughtout the world? I tried giving myself Public Speaker rights and being the bot owner I thought maybe that would do it but it doesnt seem to work, Any suggestions? Thanks, Bogey Public Speaker rights in BotsAug 23, 2001, 3:51pm
I don't suppose that there is any way that I could get other people's
whispers either even being caretaker of the world? Public Speaker rights in BotsAug 24, 2001, 3:35pm
The worlds that I am doing this for are private worlds run in the
Educational Universe that are run on our own servers. People are told that their convo's will be recorded and their used for research purposes. (something about group dynamics in virtual world space, im not really involved in this part) so don't worry no laws are being broken here. :) [View Quote] running a bot 24/7Mar 8, 2002, 6:00pm
Hi,
Has anyone here ever set up their bot to always be running? Ie, you have a world and you need your bot on always... I'm working on the Windows platform. Now sometimes my bot will die for whatever reason. This is somewhat outside the scope of bot programming, but does anyone have a strategy they've been using which keeps their bots going, ie after crash, the bot is restarted immediately... I can think of a few ways, but I was wondering if someone already has an implementation that's been effective in practice. Thanks, Omar Keeping information in "action" fieldOct 29, 2002, 7:48pm
It seems to be some kind of undocumented feature that text in the
"Action" field of an object will be ignored if it does not correspond to an action. Currently, we have one bot that uses this functionality so that it can keep track of its own object, and we are considering using this field as the basis for a system that would track outdated objects. Has anyone else done something similar, and what is the best way of ensuring that the text will not be misinterpreted (e.g. enclosing data in commands)? --Bill Barksdale hellppp! n00b! :)Jul 16, 2003, 4:08pm
cin.get leaves the line terminator in the stream. So each input is reading
the endline immediately. Either use getline, or extract the endline manually between inputs. -- -Rich [View Quote] <no subject>Mar 26, 2005, 9:13pm
Hi Alex-
I've looked into this a bit, and I believe the order is yaw-roll-tilt. You can verify this by manually rotating an object from zero rotation, a known amount in a given order. Then check the resulting angles according the AW, and see if it matches the rotations you made. In cases Gimal Lock you should be able to just choose one of the equivalent values. If you do figure out the math to extract the angles from the matrix, please let me know, as I could use it. I haven't had time myself. I suspect that yaw-only rotation would work fine even on objects that do have tilt/roll, simply by adding the two yaw values. This is only because the yaw is applied first, and the build rotation should get applied before the object rotation. Maybe AWI could be convinced to document the math they use, or better yet expose rotation functions in the SDK? -- Rich [View Quote] <no subject>Mar 27, 2005, 8:35pm
Hi Alex-
See my comments inline. -- Rich [View Quote] I started with 2 objects, and rotated each 2 clicks (30 deg) on each axis. The first I did in the order yaw-tilt-roll, the other I did yaw-roll-tilt. Here are the resulting propdump entries: 41 1111956050 -800 100 250 139 -337 -257 9 13 0 sign3.rwxyaw-tilt-roll 41 1111956095 -788 100 299 300 -300 -300 9 13 0 sign3.rwxyaw-roll-tilt Oddly enough, I rotated left, +x, and +z, and got negative roll/tilt values. I believe this means that when you are trying to come up with angles to give as object properties, you want to extract from the matrix as if applied in yaw-roll-tilt order. In other words, the rotation determined by a set of angles in a propdump is equivalent to the 3 separate rotations applied in yaw-roll-tilt order. When you rotate an entire build, apply the build rotation first, followed by the object rotation, so that the object gets rotated in the build frame. I'm not so sure the avatar pitch problem you mentioned is evidence for a yaw-tilt-roll order. The avatar's roll is always zero. > > Unfortunately, chosing equivalent values does not seem to work or, to > put it another way, alternative values can not be found when Gimbal > Lock occurs - in all other cases, there are always 2 sets of (x, y, z) > values which are equivalent for the same rotation. The reason being > that in the process of extracting Euler Angles, a division occurs by > the cosine of the second angle. If the angle is + or - 90, this cosine > is = 0, and you can't divide by 0. A similar thing occurs when > changing from Euler to Matrix notation. What I mean is choose one of those equivalent sets of angles and use it. Check for gimbal lock and treat it as a special case. This is what I have seen done in other places, though of course I didn't understand it well enough to apply the math quickly to a different rotation order. All you need is one set of angles that results in the desired rotation; it doesn't matter if it's the "original" one. > I have a full set of Delphi routines, including Euler to > Matrix/Quaternion and reverse. These Euler chappies are the > problematic ones. If you request by email (xelag at 3dee.nl) I will send > you the unit. Will do. > > It doesn't, as was reported in a recent email by someone who uses > xelagot to move and rotate groups of builds. When tilt and roll are > present in an object (i.e. <> 0), rotating using only the yaw, as > xelagot does, fails to rotate the object properly. Does your code sum the yaws (or subtract them depending on Xelagot's definition of positive yaw) and leave the tilt/roll as-is? Note that something is funny with the signs of the angles AW expects. A quick test changing the yaws in a propdump by hand seems to behave as expected for me. > > That would be nice, I'd rather have the documentation though :) > > Alex <no subject>Mar 28, 2005, 1:40am
Hi Alex-
The use of the browser is informative. Each rotation in the browser is in fact a separate rotation, applied in the order in which I do them. However, putting a set of angles in an object's attributes (using a bot or loading a propdump) is a compound rotation that will be calculated in the order in which AW applies the rotations. Therefore, if I apply 3 separate yaw, tilt and roll rotations in sequence in the browser, and the propdump shows the rotation as the exact amounts in my manual rotation, then I have used the same order of rotation that AW uses. If I see values that are different, then I must have applied the rotations in a different order. This match occurs with the order yaw-roll-tilt. What you need to do to calculate the angle for an object in a rotated build is first calculate the matrix for the build's overall rotation, and then rotate the object relative to it (of course you also need to calculate the new position, but that's relatively easy). So, lets say you want to rotate a build by angle (yb, tb, rb), and it contains an object at angle (yo,to,ro). To calculate the resulting angle, start with the matrix for no rotation, then apply the rotations yb, rb, tb, yo, ro, to (in other words, apply the entire build angle followed by the object angle, using yaw-roll-tilt order). Then convert the resulting matrix back to angles, checking for and dealing with gimbal lock conditions. Of course, you should save the result of the first rotation because it will be the same for every object and you only need to calculate it once. If you are only applying world-up (world frame) yaw rotation to objects, you can simply do this by adding that yaw value to the one recorded by AW, regardless of tilt/roll values (which should remain unchanged). This is different from opening the browser and clicking the rotate yaw button, in that it is equivalent to applying your additional yaw rotation BEFORE the object's existing tilt/roll. This is because yaw is applied first. The tilt and roll thus occur in the yaw-rotated frame of reference you with to create; this will work regardless of whether tilt or roll is applied first. You must be sure the yaw value you add has a sign that is consistent with the calculation you use for position. The avatar pitch is equivalent to tilting all the objects in the world (about the origin), prior to applying each object's individual rotation. The reason it doesn't help to determine the rotation order is that the avatar's orientation always has a roll of zero, and so you cannot tell whether the tilt or roll is being applied first from this. Note that the order I gave here may seem backwards depending on which way you multiply the matrices; I'm not remembering all the details of transformation matrix stacks very clearly right now. My point about the negative rotation values was that I rotated in what the browser called the positive direction, and yet it actually rotated in the negative direction. A right-handed system makes sense, but labeling +X rotation -X does not, and could lead to confusion in tests. I got the code, thanks. -- Rich [View Quote] Stereoscopic AW?Jan 17, 2005, 5:53pm
We have done this using SciTech's GLDirect, which can convert OpenGL calls
that are not intended to be viewed stereoscopically into Direct3D calls that are displayed in stereo. SciTech removed the forced stereo option after version 3, and you must use one of their supported cards (which include popular nvidia and ati cards from a couple of years back). Their site is www.scitechsoft.com, and you will probably have to contact them to get the old version that supports this. Maybe with enough demand, they will support that feature again. Last I knew, licenses were about $20. It works very well for the most part, though there are some quirks (for example, skyboxes appear too close). -- Rich [View Quote] |