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 10-25-2002, 09:58 AM   #1
savege
New Member
 
Join Date: Oct 2002
Posts: 2
savege is on a distinguished road
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.
savege is offline   Reply With Quote
Old 10-25-2002, 10:29 AM   #2
Brianna
Member
 
Join Date: Apr 2002
Location: Bel Air, MD USA
Posts: 81
Brianna is on a distinguished road
Send a message via AIM to Brianna Send a message via MSN to Brianna Send a message via Yahoo to Brianna
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.
Brianna is offline   Reply With Quote
Old 10-25-2002, 11:30 AM   #3
savege
New Member
 
Join Date: Oct 2002
Posts: 2
savege is on a distinguished road
The code base is Rot 1.4
savege is offline   Reply With Quote
Old 10-25-2002, 11:47 AM   #4
Brianna
Member
 
Join Date: Apr 2002
Location: Bel Air, MD USA
Posts: 81
Brianna is on a distinguished road
Send a message via AIM to Brianna Send a message via MSN to Brianna Send a message via Yahoo to Brianna
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)
Brianna is offline   Reply With Quote
Old 10-25-2002, 12:18 PM   #5
Azhon
Member
 
Join Date: Apr 2002
Posts: 50
Azhon is on a distinguished road
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.)
Azhon is offline   Reply With Quote
Old 10-25-2002, 12:21 PM   #6
Noximist
New Member
 
Join Date: Apr 2002
Location: New Brunswick, Canada
Posts: 27
Noximist is on a distinguished road
Send a message via ICQ to Noximist Send a message via MSN to Noximist
Arrow

Noximist is offline   Reply With Quote
Old 10-25-2002, 01:54 PM   #7
Sapphar
 
Posts: n/a
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!"
  Reply With Quote
Old 10-25-2002, 11:56 PM   #8
ScourgeX
Member
 
ScourgeX's Avatar
 
Join Date: Aug 2002
Location: Midwest
Home MUD: Scourge of Time
Posts: 89
ScourgeX is on a distinguished road
Just wondering, but have you tried used '==' instead of '='? I believe that's what the version I use requires.
ScourgeX is offline   Reply With Quote
Old 11-12-2002, 10:49 AM   #9
Torren
New Member
 
Join Date: Apr 2002
Posts: 28
Torren is on a distinguished road
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
Torren is offline   Reply With Quote
Reply




Mprog - Similar Threads
Thread Thread Starter Forum Replies Last Post
mprog src code Titania MUD Coding 0 04-12-2003 08:02 PM
Incomplete mprog snippet Jherlen MUD Coding 0 03-18-2003 05:08 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 07:50 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