Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   Mprog (http://www.topmudsites.com/forums/showthread.php?t=316)

savege 10-25-2002 09:58 AM

I know the basic for mprog, but I'm having a little trouble with this mprog I'm trying to make. I'm trying to get my mprog to work in drow city. When a person enters the area, the guards are supposed to greet them if they are drow and attack if they aren't. Here is what I did sofar.

If $n race = drow
say Welcome to Drow City, $n.
else
yell Intruder! $n has enter the city!
kill $n
endif


I would a appreciate any help and I thank anyone in advance for your help with this.

Brianna 10-25-2002 10:29 AM

Savege,

It may help if you let everyone know what codebase you are using.

I also think it would make more sense to post this in the builders forum since its more of a building question than a code question.

In any event, the syntax looks right. did you purge the old mob or reset the zone?
Sometimes this affects them not working. I have also found that if another mprog in the entire game is messed up it will cause the rest not to work either.

Hope this helps a bit. I am still learning progs myself a bit and have received quite a bit of help from the forums getting them to work.

savege 10-25-2002 11:30 AM

The code base is Rot 1.4

Brianna 10-25-2002 11:47 AM

okay I work with ROM and ROT

I wonder if you take out $n in the if line if that will clear it up.

If race = drow

The documentation on my website is for ROM/ROT bases so it might help you.

Where is my pal Tavish when I need him? (He is my mentor on mprogs)

Azhon 10-25-2002 12:18 PM

The example looks like smaug to me, so I'll give it a try. Since you're not on smaug it may not work though.

When you're scripting a mob the game considers it a player character, and therefore you cannot kill it, you must "murder".

If it is like smaug, replace kill with mpkill $n.

If this doesn't work, I don't have any idea. (Never tried anything other than smaug.)

Noximist 10-25-2002 12:21 PM


Sapphar 10-25-2002 01:54 PM

First, potential very simple fix: If your mob doesn't have dark_vision (or whatever see all type flag you toggle on your mud), you may lose the entire mprog based on one of two things happening: using a trigger that doesn't react to all PCs, regardless if the mob can see them; or if checks and actions failing because the mob is unable to see the $n.

Little trick that might be helpful. If you have an mprog that isn't functioning, often it is good to figure out just which part of it is having problems. To do this, put a "say" in after each if or else. Also put a say at the start of the mprog. If nothing happens at all, you know your trigger is faulty. If you get your first say and nothing else, your entire if check (or all of them, if there are multiple in the prog) is faulty. If something else is said by the mob but the action that follows never happens, you know the action triggered by the if check is faulty. Example:

say Mprog Trigger check. Trigger works.
If $n race = drow
say Mprog check. I have discovered you're a drow.
say Welcome to Drow City, $n.
else
say Mprog check. It appears you are not a drow.
yell Intruder! $n has enter the city!
kill $n
endif

If the problem is "kill $n", you would see your mob say this:
Drow guard guy says, "Mprog Trigger check. Trigger works."
Drow guard guy says, "Mprog check. It appears you're not a drow."

A little extensive for this small of an mprog, but such checks can be a sanity saver with more complex mprogs and starting off using them with your smaller mprogs is a great learning tool.

Sapphar

p.s. Don't forget to remove them. Nothing like having a dark, dreary slave hall, with the mobile locking a pc in chains and pushing them against the wall and then saying, "Mprog check! Gotcha!"

ScourgeX 10-25-2002 11:56 PM

Just wondering, but have you tried used '==' instead of '='? I believe that's what the version I use requires.

Torren 11-12-2002 10:49 AM

Ok I'm going out on a limb here, I run a rom 2.4 code base and we added the mob/obj/room code so I'm not sure how far off I'm going to be. But Rom2.4's mob program doesn't have a say command if I wanted a mob so say something I'd have to use the code
mob echo
Now I'm not 100% on the mob part as I said about we've added mud programs for rooms and objects. check mob_cmds.c for a say command. If rot works like rom's you'd have to either use the commands that are coded in or you'd have to try and force them to do a say. Also Kill is coded for rom mob programs.
and you might want to check you mob_prog.c for the right syntax for you race statment. in rom it would be if race $n drow

Hope this helps more then it hurts

Torren


All times are GMT -4. The time now is 11:30 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022