Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
LordSoren
Beginner


Joined: 01 Aug 2001
Posts: 12
Location: Canada

PostPosted: Fri Feb 01, 2002 1:52 am   

Name->Description script
 
Alright, I play on Shattered Kingdoms, a high RP mud (on mud.vividnet.com:1996) and part of this mud are people having adjectives when you look around the room, such as:
Obvious exits: E, N, S
A pale male drow is here
A dark male human is here
A black-haired female sprite is here

But once you get to know a character, the character can greet now, and no longer do you see the character adjective/sex/race, but now you see the characters name:
Jojo is here
Meh is here
Guy is here

However, in emotes, I like to use peoples race/sex/adjective - because not everyone knows a character by their name:
emote points at a pale male drow.
> You point at a pale male drow.

HOWEVER, I would like a script that takes emotes, searches though it for names in a database or array variable, and if the name is found in that array, instead of using the name, it replaces it with the adjective/sex/race of the person:
emote points at Jojo.
> You point at a pale male drow.

I would also like an easy way to add a person to this database/array of people, if possiable...

I dont even have a clue where to begin on a script like this, so any help you can provide would be most graciousally accepted...

LordSoren

(PS: If you log on the mud to see what the adjective thing is like/test the script, feel free to drop me a line if I am on - look for Isendel or Dorsel, and send me an OOC tell, and I will be of what help I can from that end.)
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Feb 01, 2002 4:08 am   
 
The key is to grab the outstanding features
of the player when you name him/her/it.

An easy way to do this is to construct an
alias when you name.

Most LP type muds only allow you to name
players with one word and in the range of
[A..Z,a..z]

So I suggest you do something like the
following (untested):

Syntax:
do_name name reference description
do_name Jojo male a pale male drow


#ALIAS do_name {
name %2 as %1
#VAR %1_desc "%-3"
}

The reference becomes important when there
are many players in the room.

That should create a variable called
#VAR Jojo_desc "a pale male drow"

so then you can easily:

emote points to @Jojo_desc.

If no one beats me to it, I'll check the
code when I get home.

TonDiening
Uses 6.16
Reply with quote
LordSoren
Beginner


Joined: 01 Aug 2001
Posts: 12
Location: Canada

PostPosted: Fri Feb 01, 2002 5:43 pm   
 
Yes, that would appear to work just from my glancing at it, however as time goes on, I am going to end up with a huge number of variables, and that still does not solve the problem with wanting it to do it automatically (if it can be done at all?) I would like just simply to type:
emote points at jojo.
and the script to read though that line, pick up jojo and would find that in its database or w/e, and then replace the string "jojo" with "a pale male drow" before it sends it to the mud.

LordSoren
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Feb 01, 2002 6:14 pm   
 
Instead of using one variable for each person, you can use a record variable. The keys would be the names of the each person and the values the adjective/sex/race. Example:
players.jojo = "A pale male drow"
players.meh = "A dark male human"
players.guy = "A black-haired female sprite"

Now, to figure out the adjective/sex/race, use the functions zMUD has to work with record variables and look for the person's name as the key.

Kjata
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Feb 04, 2002 5:54 am   
 
No matter what you do, if you want your
mud client to start storing pieces of
information there will be a lot of it. I
jam all my player info into a folder and
never peak in it.

For automatic resolving for things like:

emote points at jojo.

Your main issue will be speed. I haven't
played there but there is most likely PK
and you don't want to have a slowly parsing
issue which gets you killed.

I recommend either an alias

#ALIAS dp {emote points at @{%1_desc}.}

or

Change it so @jojo is always the description
which is fast to type instead of a record.

What I have found that works is that you only
name a person once so that can easily be
refered to with a variable. I find it
tedious to type record.item .

I log the desc/equipment with timestamp
everytime I look at people to a file which I
can click on a button to get a quick view of.

TonDiening
Uses 6.16
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net