Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Arnvorax

Pages: [1]
1
Dead Souls Support / Re: Need Some Coding Help/Advice
« on: March 14, 2007, 04:16:06 pm »
First off, I'd just like to say thanks for all of your replies and for trying to help at least.

As for line 7 of the code I pasted, I didn't make that, just the bit further down where it returns the correct recognized name for the player.  I guess Cratylus (spelling?) or someone helping him who coded the function originally added that part of the code. 

What I am doing is adding a mapping to each player that holds the name they know "bob" or everyone else as - the keyname of said player (bob in this case) being the key in the mapping that would return the name a particular player knows bob or any other player as. 

I managed to track down the eventPrint() function in interface.c and edit the message a player is receiving so that if bob types the command "look" in a room then every player in the room who gets the eventPrint function called on them will see the name they know bob as, without having to change a lot of code that's already in place. 

It works good, except in the case of something like

"look at george" - then it doesn't work so good, but I believe I'm on the right track. 

The mud I know where this system is implemented is on a mud called Shadowgate and it works good - it uses a very heavily modified version of nightmare running on some older version of Mudos - I was wondering if maybe something has changed since that version of mudos or since that version of nightmare (not sure which in either case, but they are old - game has been up since like 94 or something) - that has made what I'm wanting to do more difficult. 

I apologize if my post is hard to follow - I am not good very good at explaining what I'm trying to do - one of the reasons I hardly ever post on forums - the code seems to bounce around in my head in a way that makes sense in my mind but not so much when I try to tell someone else. 

Arnvorax

2
Dead Souls Support / Need Some Coding Help/Advice
« on: March 13, 2007, 11:09:57 pm »
I've recently discovered the Dead Souls mudlib and have gotten back into LPC coding after quite a long break, it's very addicting.  Anyway, on to my question,

Background :

I'm trying to implement a recognization system - IE - a player on the mud wont know the "name" of anyone until they recognize them as some name, can be pretty much any name they choose to recognize them as.  I've got that part mostly completed, as well as modifying ids so that if you know the player 'bob' as 'junior' you can see/kill/otherwise interact with them if they are in the same room with you using the string 'junior'. 

I modified the GetShort() function in /lib/props/description.c to the following

string GetShort() {
   string tmp = "";
    if( !Short ) {
   return 0;
    }
    if( functionp(Short) ) {
   if( functionp(Short) & FP_OWNER_DESTED ) {
       return "Error in evaluating function pointer.";
   }
   return evaluate(Short);
    }
    else if( arrayp(Short) ) {
   return Short[query_night()];
    }
    else {
      if(objectp(this_object()) && objectp(this_player())) {
         if(this_object()->is_player())
         {
            tmp += TP->GetRecognizedName(this_object()->GetKeyName());
            if(tmp != "")
            {
               tmp += ", ";
            }
            tmp += this_object()->GetAdjective();
            return tmp;
         }
      }
      return Short;
    }
}

it works correctly for things like "look" or "who" - displaying other peoples name as the name you know them by plus their Adjective (a string players can input that describes what you might see at a first glance toward them) or just their Adjective if you've never met them before and/or never recognized them. 

Problem/Question:

What I need help with is that it doesn't work sending messages - take the look command for instance,
it executes the following code,

this_player())->eventPrint(this_player()->GetShort() +
     " looks around.", this_player());

and this causes everyone in the room to see your Short description as you would see it, not as they would see if. 

I've seen this same system implemented on an older version of the nightmare mudlib that has been heavily modified, so I know its possible, but I have no clue how to go about getting it to work without having to change a lot of stuff and possible create a new sefun to deliver messages.

Any ideas?

Pages: [1]