Login | Register  
Latest 20 PostsMinimize
09 Mar 2010 06:23 AM
09 Mar 2010 01:29 AM
08 Mar 2010 09:25 AM
08 Mar 2010 09:16 AM
08 Mar 2010 08:46 AM
08 Mar 2010 08:38 AM
07 Mar 2010 10:57 PM
07 Mar 2010 10:51 PM
07 Mar 2010 06:37 PM
07 Mar 2010 06:05 PM
07 Mar 2010 06:01 PM
07 Mar 2010 05:38 PM
07 Mar 2010 10:57 AM
07 Mar 2010 10:40 AM
07 Mar 2010 10:12 AM
07 Mar 2010 09:56 AM
07 Mar 2010 09:39 AM
07 Mar 2010 06:28 AM
07 Mar 2010 01:17 AM
06 Mar 2010 11:37 PM
ForumsMinimize
Problem with take all command
Last Post 24 Dec 2009 05:22 PM byjlechem. 6 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
AuthorMessages
JustinUser is Offline
New Member
New Member
Send Private Message
Posts:15
Avatar

--
22 Dec 2009 01:48 AM  

Ok so I finally got the whole project compiled and running and managed to telnet on my localhost and was able to create a new character.  Upon doing so I found the game is a lot futher along than I thought.  That is good!  However many of the commands are not complete or only work halfway.  My biggest one is take all.  It should take everything you can grab in the room.  However it looks for an all object and not finding it says you can't find it.  I would be glad to fix this but I'm not sure where to start in the code.  If someone could point me in the right direction I would appreciate it.

Justin

FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:555
Avatar

--
22 Dec 2009 05:39 AM  
Yes, that's true about the commands. The MUD engine framework is in a constant state of flux, so we been trying to upgrade the commands as much as possible. Bengecko just put the new help system for commands, but the data for that system is not in yet.

I'm busy for the rest of the week, with Christmas stuff, but I'll see if I can take a look at that part of the code base. Is there anything specific that you are having trouble with?
KarakUser is Offline
Locutus of WheelMUD
Basic Member
Basic Member
Send Private Message
Posts:320
Avatar

--
22 Dec 2009 06:18 PM  
Take.cs in WheelMUD.Actions would be the place to start.
JustinUser is Offline
New Member
New Member
Send Private Message
Posts:15
Avatar

--
23 Dec 2009 03:42 PM  
Karak has given me a good starting point, I seem to have some time this week so I will see what I can do!
JustinUser is Offline
New Member
New Member
Send Private Message
Posts:15
Avatar

--
24 Dec 2009 03:56 AM  
Ok after looking at the code, the issue is in the Get.cs file in the Actions section. When a take/get command is issued this code is called and the all parameter passed in. The problem is this code is expecting to get a single item. Code can be put into place to deal with the all in the Get.cs file but I feel this isn't the right place for it. It needs to be dealt with where the Get is called and the item name is passed into the execute method but I can't seem to figure out where this is happening.
KarakUser is Offline
Locutus of WheelMUD
Basic Member
Basic Member
Send Private Message
Posts:320
Avatar

--
24 Dec 2009 06:23 AM  

However, what 'all' means is context-sensitive.  For instance 'get all from bag' means 'all' should be replaced with all items which are contained in the container object identified with the keyword 'bag' whereas 'get all' would be referring to all items in the same room as the player.  There are other ways an 'all' keyword might come up, such as 'read all unread' or whatnot with in-game message boards or email systems.

Parameters are also always passed to the command as strings in order to keep the command system clean/generic.  We can certainly utilize common/shared code for something meaning, say, 'give me a List[Item] of player-accessible things that this list of args is referring to'.  (I believe this is already done with a single-Item version?)  The Get command's local Item reference could be replaced with List[Item], and reuse the List[Item] even when a single Item is identified, so that only one set of code (the foreach iteration) has to be written.  IMO it makes most sense for argument pattern recognition to generally be implemented in the command, with liberal usage of reuseable helper methods for common interpretations of common keywords/patterns.

Perhaps some more powerful means of interpreting sentences typed from users could be employed;  some kind of crazy tokenization scheme would be one such idea.  On top of everything else, a generic system would have to take into consideration all kinds of permissions things rather than letting behaviors be determined completely dynamically;  IE if we supported "examine joe's helmet" to get the description of a helmet item upon joe's paperdoll, then typing "get joe's helmet" would have to be blocked due to the command's specific context, whereas "get helmet from chest" (where chest is an open container in the current room) is OK.  As is, by requiring the command to define the behavior of an explicit pattern, such behavior is generally "opt in" rather than "opt out", meaning a MUD admin is less likely to find out that "clever" players are (as per this example) stealing from others in such a way.

JustinUser is Offline
New Member
New Member
Send Private Message
Posts:15
Avatar

--
24 Dec 2009 05:22 PM  
Posted By Karak on 23 Dec 2009 11:23 PM

Parameters are also always passed to the command as strings in order to keep the command system clean/generic.  We can certainly utilize common/shared code for something meaning, say, 'give me a List[Item] of player-accessible things that this list of args is referring to'.  (I believe this is already done with a single-Item version?)  The Get command's local Item reference could be replaced with List[Item], and reuse the List[Item] even when a single Item is identified, so that only one set of code (the foreach iteration) has to be written.  IMO it makes most sense for argument pattern recognition to generally be implemented in the command, with liberal usage of reuseable helper methods for common interpretations of common keywords/patterns.

 

After some more thought on this I had this thought as well.  If you move the check to where the Get action is executed you end up with parsing every command to check what kind of parameter(s) are being passed to it, etc.  It keeps the object model and code cleaner to deal with it in the action class itself.  A simple List would solve the problem.  However I think other code would have to be changed to deal with the possibility of getting more than 1 item.

You are not authorized to post a reply.

Active Forums 4.1
Copyright 2007-2009 by WheelMUD  | Terms Of Use | Privacy Statement
Google Analytics Alternative