Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 05-06-2003, 04:49 PM   #1
Verboden Faction
 
Posts: n/a
When we use switch to switch into a mob, we don't see all of the things we do when we are ourselves.  I heard it had something to do with putting a check for a descriptor or something.  I need someone to explain everything in detail for me.  Thanks.
  Reply With Quote
Old 05-07-2003, 11:13 PM   #2
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
What codebase are you asking about (although I imagine most handle this the same - just a guess)

My understanding of how circleMUD handles it is:
do_swicth (the actual command run) only transfers the descriptor to the targeted mob, none of the other information is copied across (flags, prompt, prefs...) this is done for simplicity, you could copy all these accross, OR have any of the checks (Look for an IS_NPC check) test if for a NPC, and if it is then test if it has the pointer to the original character, then use those settings. and that is all too much work.

does that help?
karlan is offline   Reply With Quote
Old 05-08-2003, 08:27 AM   #3
jornel
Member
 
Join Date: Sep 2002
Location: Canada
Posts: 73
jornel is on a distinguished road
Mobs just don't enjoy the same quality of life as players.   Here are some of the major differences:

1) mobs don't receive ansi color
  Color is stripped out to make mprog trigger checks easier.

2) mobs don't autolook when they walk into a new room.
  In most games, mobs move around all the time. To send full room descriptions to all mobs moving every time is a lot of 'internal spam' that raises CPU usage needlessly - since mostly, mobs can't do anything with the info they would receive in a room description.

3) mobs don't receive player-based global channels (ex: ooc, auction)
  Again, same reason.  Mobs aren't known to bid on auctioned items, nor do they offer any items for sale.  And you almost never hear them participate in chat.

4) mobs don't even have the same 'SCORE'
  You don't believe me?  Switch into a mob and type SCORE.  Most of the personal stats that players see are kept in a structure called pcdata that mobs just don't have - which explains why you always see all these tests in the code involving IS_NPC(ch)


Hope this sheds some light.
jornel is offline   Reply With Quote
Old 05-08-2003, 09:39 AM   #4
markizs
Member
 
Join Date: Jan 2003
Location: Riga, Latvia
Posts: 36
markizs is on a distinguished road
Send a message via ICQ to markizs
Hmm. Switch to a mob. sounds interesting. Could do it by simply mobe_object(find_object(this_player(),"soul"),find _object(mob_name)) or somthing like that, LPC differs from mud to mud. And ofc mobs dont get ansi color cos its usualy coded in player.c they can still hear shouts and stuff ofc, becouse they are global. and ofc mobs get the same SCORE as players :)

well maybe you werent talking about lpmud at all, maybe you again forgot that there is somthing besides ur favored codebase :)

oh well :P
markizs is offline   Reply With Quote
Old 05-08-2003, 05:02 PM   #5
kaylus1
 
Posts: n/a
As you said, depends on the code. On most MudOS ran muds you can use the efun exec():

[code] exec(object to, object from);[/quote]

Which should handle that for you, of course you'll want a few checks for admin =) I'm not sure if I remember but Amylaar and LD drivers can use exec() as well. Makes it a whole lot easier to do things. Of course it sucks if you don't put checks on the command that calls it and exec() into a hammer object.

*chuckle*
b.t.w I put any color parsing data in simulefuns instead of in the objects =)
  Reply With Quote
Old 05-11-2003, 08:49 PM   #6
Verboden Faction
 
Posts: n/a
I am using ROM2.4b6, with color. But what I am talking about is that when we use switch, we don't see anything that goes on, no full descriptions, nothing that happens in the mud, the fights, nothing. It's just a prompt, and the room title. I read part of the FAQ at the ROM site, but it didn't help.
  Reply With Quote
Old 05-14-2003, 04:13 AM   #7
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
Arrow

I Imagine ROM handles it in a fairly standard fashion, in those functions/sections there is probably a check something like IS_NPC(ch) or IS_MOB(ch) or something like this, if the condition (not really the right word) that indicates if a character is based on an index, or identitiy number then you are a mob regardless of if switched or not, if the check is based on the presence of a descriptor then switching into a mob would in effect turn that mob into a player (YES! I know there are other issues like the presence of pcdata/mobdata structures internal to it, but this is a simplified explanation)

For example - most of the colour handling routines I have seen have a check [code] if(!IS_NPC(ch)) {
  // parse the colour codes
} else {
  // strip the colour codes <-- really a parse too
}[/quote]
this is a trivial example, but if that check "IS_NPC" only checks for the condition/index/id/BIG_SIGN/whatever that marks it as a mob it will always strip the codes. If IS_NPC checks for a descriptor then it would parse the codes, BUT then you get issues with having to copy prefernecs and so on <- see earlier post.
karlan is offline   Reply With Quote
Old 05-14-2003, 04:20 AM   #8
markizs
Member
 
Join Date: Jan 2003
Location: Riga, Latvia
Posts: 36
markizs is on a distinguished road
Send a message via ICQ to markizs
i suggest you to read code instead of faq.
how can u code a mud without knowing inner stuff of it.
*ponders*
markizs is offline   Reply With Quote
Old 05-15-2003, 09:31 PM   #9
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
Thumbs down

I don't imagine even a lot of coders look at ALL of the minutae of ALL of the functions, I had the same question as Verboden and so I looked into do_switch, but for some of the other functions, they work, I have changed nothing so far that affects them, so I do not care how they work at this stage.
karlan is offline   Reply With Quote
Reply


Thread Tools


Switch command - Similar Threads
Thread Thread Starter Forum Replies Last Post
Features of a MUD command parser. Drealoth Advanced MUD Concepts 15 04-27-2006 02:08 PM
command processor Dubthach MUD Coding 4 10-26-2004 11:01 PM
Jog Command Jaegar MUD Coding 4 04-09-2004 04:41 AM
Command trigger for progs Jaegar MUD Coding 1 04-03-2003 06:41 PM
Chown Command Verboden Faction MUD Coding 9 03-23-2003 07:12 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 01:13 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2022