Login | Register  
Latest 20 PostsMinimize
04 Sep 2010 05:25 PM
28 Aug 2010 08:51 PM
RE: MONO - Fastalanasa
28 Aug 2010 01:51 AM
RE: MONO - Taliesen
28 Aug 2010 01:31 AM
RE: MONO - Fastalanasa
27 Aug 2010 04:10 PM
RE: MONO - Taliesen
27 Aug 2010 03:16 PM
RE: MONO - Fastalanasa
27 Aug 2010 09:26 AM
RE: MONO - Karak
27 Aug 2010 05:04 AM
RE: MONO - Taliesen
25 Aug 2010 04:00 PM
RE: MONO - Fastalanasa
25 Aug 2010 04:49 AM
RE: MONO - Taliesen
23 Aug 2010 04:19 AM
RE: MONO - Fastalanasa
23 Aug 2010 02:57 AM
23 Aug 2010 02:54 AM
RE: MONO - Taliesen
23 Aug 2010 02:52 AM
RE: MONO - Fastalanasa
23 Aug 2010 02:36 AM
RE: MONO - Fastalanasa
23 Aug 2010 02:13 AM
RE: Stat System - Fastalanasa
23 Aug 2010 01:57 AM
23 Aug 2010 01:34 AM
23 Aug 2010 01:32 AM
23 Aug 2010 01:30 AM
ForumsMinimize
Problem with take all command
Last Post 03 Jul 2010 09:13 PM byfeverdream. 9 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:705
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
Advanced Member
Advanced Member
Send Private Message
Posts:501
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
Advanced Member
Advanced Member
Send Private Message
Posts:501
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.

FeverdreamUser is Offline
Basic Member
Basic Member
Send Private Message
Posts:177
Avatar

--
03 Jul 2010 08:21 AM  
Getting EVERY item is an issue.. after all, they may not have the skills to see or otherwise detect a given object in the room, even if they happen to step over it.

If somebody drops an invisible sword of hurting, for example, how do they detect its there to take if they cant see spelled or otherwise invisible objects?
KarakUser is Offline
Locutus of WheelMUD
Advanced Member
Advanced Member
Send Private Message
Posts:501
Avatar

--
03 Jul 2010 09:38 AM  
This is why it's especially important to have shared/reusable code for thing like "give me a list of all perceivable objects in the room" rather than repeating all this sort of logic inside each action; the action itself would then further get down to the objects it needs, and of course context-resolution mechanisms would have to work with this too. 'get sword' when you only see two swords should only list those two for resolution, even if a third is invisibly there.
FeverdreamUser is Offline
Basic Member
Basic Member
Send Private Message
Posts:177
Avatar

--
03 Jul 2010 09:13 PM  
I agree.

The code should be smart enough to take the persons/players/mobs context into account.
You are not authorized to post a reply.

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