Board ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
grimble // User Search
grimble // User SearchOn-Line Owner Privilege RightsNov 11, 2000, 12:33pm
Thanks anduin.
That makes me a lot more confident in what I want to do in the world. What you said makes a lot of sense, but just wanted to make sure (still trying to catch up with the rest of ya ... lol). Grims. [View Quote] On-Line Owner Privilege RightsNov 11, 2000, 2:27pm
TH,
The bots are one of the things I want to play with "to destructon", and the world will probably initially just be an environment in which I can achieve that. Thanks for the offer though. Grims. [View Quote] HmmNov 12, 2000, 1:35pm
Hey c'mon. We have enough ppl being rude in here without you joining the
fray TH. I think the point that is being made here is that the RWX file format SHOULD be proprietary to RenderWare and AW shouldn't be bastardising it. If additional object features are to be provided within AW, they should be implemented outside the core object definition, especially with new object formats being supported (i.e. COBs). Ideally, there should be an AW script that defines the AW specific information plus some form of server-side include equivalent to pull in the RWX/COB/etc. file. I think that boats been missed now though. BTW, does anyone know what happens to the shabangs when you load the files into RW and save them again? Grims [View Quote] Need Help..Mar 19, 2001, 7:42pm
OK ... ONE quick lesson ... since you're leaving soon.
If you don't predeclare your variables within a scope, and there is no appropriate letter range defined for a variable's name(using DefBool, DefInt, DefStr, etc.), the variable will be defined as a variant. Variant data types are "anything"s and take their characteristics from the source value when assigned. For example, if you assign it from a string value, the variant will act as a string, if you put a number in there, it will act as a number. The recommendation is to force predeclaration of all variables using "Option Explicit" (look it up in the help) by setting the "Require Variable Declaration" flag under Tools | Options | Editor. Then, all variables used in your code must be declared within the scope in which it is used. You should ALWAYS know what your variable's behaviour is going to be. In your example, you have managed to set the value of the variable from a string value (maybe from a textbox ??) and for strings, the "+" operator acts in the same way as a "&" operator. Use "Require Variable Declaration" and add "Option Explicit" to the top of all your existing forms, modules and classes and do a full recompile (CTRL=F5) and sort any new errors you may get. Good programming practice dictates that you predelcare all variables anyway ... VB's ability to override it is one of those little quirks that is there purely for supporting legacy code - its an old BASIC thing. Its a little annoying that the default setting is "off" really. All other programming languages I have dealt with DEMAND that predecs are made. Read the VB help files for Dim, Public, Private and Option Explicit. I would say that any chance of a decent programmer "buying" one of your bots has just gone out of the window, "bud". Grims [View Quote] MaybeNov 13, 2000, 8:33pm
The question has to be asked ...
If its and OLD OLD message........ why post a response? You just looking to get a rise out of Eep or what? 'cuz there's really no need for it is there? [View Quote] Maybe this message doesn't fit in this group, but look what I found in an OLD OLD message by Eep. AW_AVATAR_DELETE and JoiningApr 3, 2001, 9:56am
I may just be the unluckiest person in AW, with SDK messages being dropped
at key times, but I don't seem to get an AW_AVATAR_DELETE notification when an avatar joins someone in another world. I works ok if they join people in the same world, but joining someone in a different world seems to miss an important part of the process. The avatar finally get's lost after a while - a bit like your bot still being there after a short period when you don't terminate the instance properly and it ends up timing-out. Anyone else experience this? Grims. AW_AVATAR_DELETE and JoiningApr 3, 2001, 2:42pm
Great. That gives me a frame of reference anyway. I'll poke around, but I
don't see that it can be anything in the Bot code ... Perhaps he was just having a bad day. Thanks Xelag. Grims. [View Quote] MaybeNov 14, 2000, 5:10am
I don't think you have the same concept of a script as everyone else TH. At
the end of the day, he object definition within an RWX file is simply the file format that RenderWare used to describe its objects. Its not really a script any more than a JPEG file is a a script for the definition of an image. Its a structured file format - just not compressed - that object builders in AW edit. Most people's definition of a script is a run-time interpreted language. What is yours? Grims [View Quote] -- - Tony56 (aka Chandler56) "Freedom: That's What The Government Wants You To Believe!" ____________________________________________________________ [View Quote] Javascript is a SCRIPTING, not a programming, language, Dth. Besides, I sure as hell wouldn't learn programming just to make silly AW bots... Unfortunately I can's stand thinking programmatically and having to express it logically so until a more visual/graphic/symbolic programming "language" (method, process, etc) comes along, I won't be programming any time soon. All I can do is express my ideas and home some programmer(s) like them enough to implement 'em. Look at all these errors, and out of Eep? A & B)JavaScript (not Javascript) is NOT a scripting language. It is not RenderWare style, nor Perl style (which is more programming than some things) BASIC is not a scripting language, it just isn't object-oriented. This is top down programming either way. C)Is there something wrong with learning to make "silly" AW bots? I did. D)Thinking programmatically? What the hell is this supposed to meen? Programming is, at a basic level, write one thing, it does this, continue. E)What's the matter? Visual Basic isn't infantile enough for you? Now for spelling and grammer (SP :-) 1)can't, not can's 2)"programming, language," 3)hope, not home And now we have the AW SDK in all sorts of simple programming languages, yet I haven't found any bots out of Eep yet. -Twisted Horizon THENNov 13, 2000, 8:34pm
Re: Anyone know how to make a bot respond in VB?Apr 3, 2001, 2:39pm
Build 20, Delphi? Anyone?Apr 4, 2001, 2:39pm
Re: Anyone know how to make a bot respond in VB?Apr 6, 2001, 9:38pm
new bot? good idea? or not?Nov 19, 2000, 8:18am
I think a lot of people who write their own bots use this method anyway once
they've worked out the basics - applying some form of function library or class structure (depending on the type of language you use) and expanding that to their needs. Since you seem to sell your bots, why not keep your infrastructure to yourself (I don't mean that how it might sound lol) to enahance the capabilities of the your bots, give you a perceived advantage and make just your life easier? Grims [View Quote] new bot? good idea? or not?Nov 19, 2000, 8:23am
Twist, you ever tried distributing a tiny VB application? A simple bot in VB
requires a setup install set that is well over 1MB ZIPPED. If you add a little database processing in there, its up to 2MB because of the DAO, ADO and/or RDO libraries. Then you put some fancy controls on the user interface from one of the Windows Control Libraries (like the List control) and up it goes even more. When you're up to 3MB, you're talking about potentially a 30 minute download on a dial up :O(. Grims [View Quote] Exact Positioning of Avatars (Browser vs SDK)Apr 7, 2001, 11:45pm
Hi there people, I have something that I would probably have posted to the
Beta NG if I could have done, so I'm going to try my luck here. I have two identical areas setup in a world ... right next to each other. They each have an "anchor point" which I use for some calculations. I also have a bot tracking a single avatar (me ... the only one in the world), maintaining its location through the usual AW_AVATAR_CHANGE events. On clicking an object (when the avatar is stationary and has been for a good few seconds), the bot takes the avatar's X, Y and Z offsets from that area's anchor point and teleports the it to the same X, Y and Z offsets from the other area's anchor point (positioned in exactly the same relative position within the area). The Yaw is retained ... that's no problem. Sounds straight forward right? Pah! The first time I do the teleport (as the avatar), after using the browser to move the avatar into the first area, the avatar is teleported to a position slightly further along the line of last movement. The ONLY way I am updating the avatar's position within the bot is through the AW_AVATAR_CHANGE events. I know its not my code, because if I teleport back and forward between the areas afterwards (without moving the avatar in the browser), it gets EXACTLY the right position. So I can only see that the browser is sending at least one more avatar movement notification to the server without carrying it out itself properly. I'm sure the world server wouldn't be trying to trick me by inventing movements (perhaps I'm just not paranoid enough yet). This is in v3.0 (build 354). I'm going to try it on v3.1 (Build 370) later on to see if this is still apparent, but in the meantime if anyone has any comments on this I'd be grateful (preferably like someone noticed it before and its fixed in Build 370). It may sound trivial, but I am relying on these messages to be correct and, if anything, I would expect the SDK to be behind the movement if it was going to be incorrect at all .... not ahead of it. I'm using is Build 19 of the SDK. I hope I managed to explain myself clearly enough. If anyone thinks its appropriate, please post this on to the Beta NG for me. Thanks, Grims. Exact Positioning of Avatars (Browser vs SDK)Apr 8, 2001, 12:33am
Thanks Xelag,
Have to agree with you there. Shame it screws me 7 way from Sunday though!. Grims. [View Quote] There seems to be a permanent problem with the last step of the avatar in the browser... the routine for that should really be checked. Exact Positioning of Avatars (Browser vs SDK)Apr 8, 2001, 2:22am
Done a little more playing on this, tracing the messages against where the
browser says it is in the title bar (in a very high-tech fashion .... gradually stepping over a cell boundary and watching the messages) and the messages to the bot are actually very consistent with the position reported by the browser. The problem comes (still from the browser unfortunately) with what it does with the teleport. Although the teleport specifies the position in centimeters (as the web-help says it supports that precision), the AW_AVATAR_CHANGE message comes back to the bot with pretty much a 1 meter precision. For example, the Z-coordinate before the teleport was 3250 (centimeters) and was notified after the teleport as 2900 when it was actually set to 3250 - 400 = 2850. So I played some more ... 2909 + 800 = 3700, 3700 - 800 = 2900 (yay!!!), and 3030 + 800 = 3799. Its the same with the Z-coordinate AND the Y-coordinate .... 1 meter precisions. So what gives?? This doesn't look like a complicated calculation problem anymore (although I guess we can blame rounding issues for the 99's ... they had to get in there somewhere with so much going on ... but that's close to irrelevant). Going to try 3.1 now ... its (potentially) such a small thing that it may have been fixed. Grims Exact Positioning of Avatars (Browser vs SDK)Apr 8, 2001, 11:18am
And another thing ... how come you don't get an AW_EVENT_OBJECT_CLICK if the
object has an activate action command on it? Maybe its a technical reason, maybe its an oversight, but either way its a pain in the butt LOL. Grims. new bot? good idea? or not?Nov 20, 2000, 7:43am
HEY!.... there was no malice intended in that post ... Geesh! This is
turning into bitch-city. Perhaps I am getting you mixed up with someone else - in which case I apologise. There are a lot of "I have a bot page" posts here. It was more of a recommendation than anything - you build your own infrastructure and make the most of it. [View Quote] new bot? good idea? or not?Nov 20, 2000, 7:48am
What I have found (for the simple bots - my C/C++ is a little old and rusty
nowadays) is that bots can be DEVELOPED/DEBUGGED VERY quickly and easily in VB, but distribution (free or otherwise) is best made in a less managed language where you have more direct control over as much of the environment as possible. If the VB code is structured properly in a manner that will suit quick conversion of syntax to the new language, this works well. Just a bot of additional ime investment at the end of it all. [View Quote] Seprating words in a ListBoxApr 9, 2001, 10:08pm
makaveli,
There are a number of key problems with this code. The two major ones are listed below: Firstly, its bizarre! What's with the timer?? Ever heard of a loop? That timer is running asynchronously along side the retrieval of the AW events, so its going to be totally arbitrary which messages are going to be checked. The code is basically going to check for the next word in the list (after the current one), in the last chat message received, every second. Chat messages will often be missed completely and ONLY be scanned for all the words if no-one says anything else while it goes through the loop. Secondly, (apart from the fact that it's not an answer to what TrekkerX wants because of the previous point), ListIndex is only used to position the selection. Its a UI thing and not something for setting the current record so that you can use the Text property. This isn't a difficult task ... The code you really want goes something like this ... which isn't how I would actually do it - see point later in post - but its comparative to your example (again, in VB with your control names for continuity): Private Sub sdk_EventChat() Dim messageChat As String Dim indexEjectWord As Long messageChat = LCase(sdk.AwChatMessage) For indexEjectWord = 0 To lstWord.ListCount - 1 If InStr(messageChat, LCase(lstWord.List(indexEjectWord))) Then '<do eject handling code here> End If Next indexEjectWord End Sub This is still going to fall foul of words within words (there's a place in the UK called Scunthorpe!!) so additional logic needs to go in there to check for whole words including handling the start/end of the chat message and punctuation - so you can't just check for " " & lstWord.List(indexBadWord) & " " either. Personally, I am a believer in user interface components being JUST for user interface purposes ... displaying/entering information and interactivity. My view is that the prime copy of the data belongs in the guts of the application, not in a visual control. So actually, I would have a ReDim'd array of Strings or a Collection holding the words, and that store is then used to populate the listbox on startup. Just my upbringing I guess ... different people do things in different ways. BTW, a small piece of advice. See the Dim statements? Use them ... Variants suck! You should never find code like this ANYWHERE in an application ... large or small ... it just doesn't make any sense. If X = "" Then X = 0 If you MUST use variants (which is extremely lazy and unnecessarily adds to the underlying processing), use the IsEmpty(varName) to do this check. Grims. [View Quote] Seprating words in a ListBoxApr 9, 2001, 10:12pm
Ack!!!
'<do eject handling code here> should read '<do eject handling code here> Exit For Sorry .... Grims [View Quote] Seprating words in a ListBoxApr 9, 2001, 10:16pm
GRRRR .... it took me so long to type my post that you beat me to it !!
Just for the reader ... (accidental omissions I'm sure - MrGrimm is better that this) For i = 0 To lstBox.ListCount -1 and If ContainsWord(lstWords, LCase(AwSdkOcx.AwChatMessage)) <> "" Then Grims :o) [View Quote] Help Bas File For Visual Basic (Attachment)Apr 13, 2001, 8:30am
LOL .... You like to put yourself out there to be shot at don't ya. EIGHT
functions?? And by the way ... you forgot to actually teleport the session in "teleport " ;o). [View Quote] Making a Bot Join a PersonApr 14, 2001, 11:58am
This ALWAYS the case. The only attributes that are populated as part of the
AW_EVENT_CHAT message are AW_AVATAR_NAME, AW_CHAT_MESSAGE, AW_CHAT_TYPE and AW_CHAT_SESSION. There's no "for some reason" about it ... as documented on http://www.activeworlds.com/sdk/AW_EVENT_CHAT.htm. If you want to do anything beyond the basic coverage of the AW events you have to remember all the settings from the AW_EVENT_AVATAR_CHANGE messages. I don't have time right now to knock up a sample application for you unfortunately, but basically you need to do manage a session table ... something like this: On an AW_EVENT AVATAR_ADD, you take all the attributes supplied by the SDK and create a new entry in some form of list. How you implement this list is vvery much dependant on your programming style, preferences and how you want to use the list afterwards ... it could be a (large) fixed array (not recommended), a dynamic array, a collection, a linked list, etc. The important thing is that you store the avatar's location information against its session number. Personally, I always use a class called CAWAvatar that holds the avatar's information and the owning citizen information once its resolved from the AW_CALLBACK_CITIZEN_ATTRIBUTES ... but it can be simple Session Number plus the X, Y, Z and Yaw coordinates if you want. On an AW_EVENT_AVATAR_CHANGE, you need to look up the session number in your list and adjust the location information held against it (X, Y, Z and Yaw). On an AW_EVENT_AVATAR_DELETE, you can throw the entry relating to that session away. When you get your AW_EVENT_CHAT message, you can lookup the avatar's location from the list to establish where the avatar really is ... NOT the leftovers of the previous event that updated the avatar's X, Y, Z and Yaw attributes in the SDK stores. As far as getting the bot to go in front of the avatar, you need to apply some simple maths. Simply adding 100 to the coordinates will always put the bot at 100 further north and 100 further west. You need to use circle formula to get it 1m away from the avatar in the directionthe avatar is LOOKING. 0 Yaw is looking North, 900 is looking West, so to find the X offset, you do the radius of the circle (the distance away fromt he avatar ... 100 in this case) and multiply it by Sine(Yaw/10). For the Z offset, you use Cosine instead. Therefore: botPosX = avatarPosX + (JOIN_DISTANCE * Sin(avatarPosYaw/10) botPosZ = avatarPosX + (JOIN_DISTANCE * Cos(avatarPosYaw/10) To make the bot "look at" the avatar ... you simply reverse the avatar's Yaw with simething like ((avatarPosYaw + 180) Mod 360). "The Derek" ... you amaze me ... I have only just removed you from my filter list (which you originally earned membership of because I was tired of your continual crap responses) and you immediately demonstrate the same old inability to read the documentation and insistance on making uninformed assumptions instead of finding things out. Back on the list for you. Hope this helps TrekkerX. As I said, I'm a bit puched for time right now so I can't make up a sample application for you. After Easter is over, if you're still stuck, let me know and I'll put something together for you quickly to demonstrate how to handle session tables. This post is using the event names in the actual SDK as documented (for C) but the names in the AwSdkOcx2 and 3 are close enough for you to make the connection. Grims [View Quote] Making a Bot Join a PersonApr 14, 2001, 12:11pm
Sorry ... typing is crap today ... formulas should read as follows:
botPosX = avatarPosX + (JOIN_DISTANCE * Sin(avatarPosYaw/10)) botPosZ = avatarPosZ + (JOIN_DISTANCE * Cos(avatarPosYaw/10)) Just a quick note ... it might be crap maths in this machine, but I use Visual Studio 6 with Service Pack and COS(90) ... I think ... is never calculated correctly, so watch for that. I seem to remember from my school days that Cos(x) = 1/Sin(x) so you can use that if you get this problem. Grims/ [View Quote] |