ID:149981
 
Is there any way to do this? Everything I put in the standard mob (the one with the login, etc) is tacked on to ALL mobs in the game, and it looks silly when you can whisper to a NPC!
You can do this, the same way you'd put different verbs for different objs or turfs... it just depends on where you define is.

turf
verb/stomp()
usr << "You stomp up and down."
grave
verb/dance()
usr << "You dance on the grave."

The important thing to remember, though, is that with mobs (unlike turfs and objs), the default src is the mob itself. If you have your whisper verb defined so that the person with the verb is the one doing the whispering, you'll need to change this.

I suggest you read the Guide, there's a link at the left. You seem to have some idea about programming, and you're willing to learn... this is a good place to start.
Well, I am guessing that you are doing something like this:

mob
verb/whisper(var/text as text)
set src in world
src << "[usr] whispers to you: [text]"
player/icon = 'player.dmi'
npc/icon = 'npc.dmi'

This would make it so that you can whisper to anyone, regardless of if they are a NPC or a player. Instead of a code like the example above, try something more like this:

mob
npc/icon = 'npc.dmi'
player
icon = 'player.dmi'
verb/whisper(var/text as text)
set src in world
src << "[usr] whispers to you: [text]"

That would make it so that only players can be whispered to. Good luck!
In response to Lord of Water
I tried something like this, but got 77 errors. After 'fixing' all 77 of them, I tried it, and ended up invisible starting at the bottem-left corner of the screen. when i say that, all my usr.'s stop working. And considering thing game is around 500 lines, it's not a pretty site.
In response to Dreq
Heh. You sure have something screwed up! I had a few things like that happen during my first few projects. Hope you can get it sorted out!
In response to Lord of Water
Yup theres no way in HELL i'm re-writing this :p After only 3 days (everything in the game - artwork, and music) is all origional, and a lot of people say this is an awsome game already ^_^ So i'm gonna spend hours trying to fix it :)
In response to Dreq
Whoever told me to use src because 'usr' is unprodictable will die..

RancerZero.dmb - 202 errors, 16 warnings (max count reached) (double-click on an error to jump to it)

In response to Dreq
Dreq wrote:
Whoever told me to use src because 'usr' is unprodictable will die..

RancerZero.dmb - 202 errors, 16 warnings (max count reached) (double-click on an error to jump to it)


Whoever told you to use src because 'usr' is unpredictable was absolutely right... although it still takes some thought to determine where usr is appropriate (it has its uses) and where src is. You remember that guide I suggested you read? I still suggest that you read it. And I suggest you re-write your code... if the music and graphics and basic ideas are cool, keep them, by all means. But the code you write when you're learning to code isn't going to be worth keeping, usually.
In response to Lesbian Assassin
I actuially figured out what i'm doing wrong. now I have it like:

mob
player
verb
stuff()
verb
StandardMobVerb()


Which works great. I just have to figure out how to set the player as mob type player ^_^
(And btw, I've read that starting tutorial, but I guess that's not what you meant, so i'll look at the other guides too.

[edit]
Ah, i looked at the Developer's Guide, and figured out how!:
world
mob = mob/player

Thanks for the help though!
In response to Dreq
I think you found the Guide I meant... when I said Guide, link at left, I meant the link at the left that's labelled "Guide". Would that be where you found this tidbit? Anyways, I'm sure you'll agree it's full of basic useful information on all sorts of things that aren't obvious.
One of the things I used to run into all the time is having multiple copies of a verb assigned to a mob. This became very disconcerting when I wanted to remove verbs. I started working on how to make sure that mobs only had the verbs I wanted them to have.

I ended up solving this by creating a (fairly) complex system which removes all verbs in the mobs verb list, takes a look at the mobs current state and assigning to the mobs verb list whatever verbs it should have. I was trying to simplify the process when I stopped working on the project but in theory it wasn't that hard to understand.

- I never assigned a verb by using the mob/verb code.
- All verbs are mob/proc which are assigned to the mobs verb list
- I created a process which removed all verbs from the mobs verb list (required a certain amount of looping to ensure that no duplicates existed)
- I created a process called mob/CheckVerbs() which would check certain variables in the mob and determine by if() statements if the verb should exist or not.
- Whenever I created a new verb process, I added to the CheckVerbs() code which would then assign it if it should exist

I did the same thing with objects. This gave me a certain amount of flexibility in regards to doing things like hiding objects (certain mobs knew the location of the object, and some don't - add a verb to pick it up if the mob knows it's location; also allowed a lot of flexibility; the only thing that made an object hidden was a variable (hidden= 0|1) and each object maintained a list of mobs that knew it's location. Thus I could code specific verbs that only some mobs had access to until something changed - like a mob searching, finding the object, and being added to it's list).

There's probably an easier way of doing it than this way, but this was the easiest way for me at the time.