Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Need help with fashion police mob program

Need help with fashion police mob program

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Deadinthepark   (5 posts)  Bio
Date Tue 14 Jun 2005 10:03 AM (UTC)
Message
Hello, I'm having problems with mobs.


I want to create a guard mob who checks to see if you're wearing
clothing and if you are nude, he gives you clothing and forces you to wear it.

Any help would be appreciated.





Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Wed 15 Jun 2005 02:50 AM (UTC)
Message
You'd want to use a mob program for that. I'm not sure how exactly 'nudity' would be defined; probably something along the lines of not having anything besides a weapon equipped. You might have to write your own ifcheck e.g. is_nude($n) if yuo want more precise control. Are you familiar with mud progs? That would be a good place to start; then you can fine tune your ifcheck later.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Deadinthepark   (5 posts)  Bio
Date Reply #2 on Wed 15 Jun 2005 10:07 AM (UTC)
Message

if ispc($n)
mea $n The automation says "Greetings $n!"
if OvnumWear (9003) == 0
mea $n The automation says "You are violating this cities nudity laws, $n"
mptransfer $n 10308
endif
else
mea "Greetings $i"

endif


---


Object 9003 is trousers and room 10308 is a "prison cell".

This works great.
Thanks for posting.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Wed 15 Jun 2005 10:12 AM (UTC)
Message
Well, the only problem with code like this is that it makes everybody wear the trousers identified by 9003. What if you make a different vnum for trousers, and somebody wears that instead? Your code would send them to jail for that... :P

I don't remember off-hand if there's an ovnumwear for wear locations. If there isn't one, it should be quite easy to add to the ifchecks in mudprog.cpp.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Wed 15 Jun 2005 04:05 PM (UTC)
Message
Actually OvnumWear checks the mobile, not the victim.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Deadinthepark   (5 posts)  Bio
Date Reply #5 on Wed 15 Jun 2005 10:13 PM (UTC)

Amended on Wed 15 Jun 2005 11:04 PM (UTC) by Deadinthepark

Message
I know plenty of ways to screw up my program.

Infact it's easy to do it on accident even.

And I appreciate, knowing what I'm doing wrong(it does help to a degree).

However, the amount of problems which can occur is virtually infinite.
I'm not sure that I can find out how to do what I want by going through every possible method of messing it up until I find the right way by accident.


Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Wed 15 Jun 2005 10:55 PM (UTC)
Message
Is this a roundabout way of saying that you're not sure how to go about adding a new ifcheck? :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Deadinthepark   (5 posts)  Bio
Date Reply #7 on Wed 15 Jun 2005 11:10 PM (UTC)
Message
Well, I tried adding an ifcheck.

I was attempting to use the above command(ovnumbwear) as a template for the new command.

Even if that did "work" it would just tell me whether or not the mob had an item type(armor) in the wear_legs location.

So I scrapped that, because I didn't know how to point it at the player.


I think making this thread is a rather direct way of saying I don't know how to do what I need to do.


Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #8 on Wed 15 Jun 2005 11:52 PM (UTC)
Message
I meant adding an ifcheck to the C code, not the mudprog. Do you know how to write C? If so, look at mudprog.c and look for the ifcheck code. E.g., search for ovnumwear. You'll want one that takes a character as its argument, such as name($n). If you know C, it should be fairly easy to make your own ifcheck that makes sure the person is wearing something at the legs/arm/etc. locations. If you don't know C, then this will be a lot more difficult; I'd suggest you learn it. Nick Gammon has some excellent material on this site - look around in the sections for links to documentation. You can also search on the web for C tutorials. But a word of warning: it's not something you can pick up in a day or two.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Deadinthepark   (5 posts)  Bio
Date Reply #9 on Thu 16 Jun 2005 08:12 AM (UTC)
Message
Yes, I was attempting to make it in a C source file, by using a predefined mob prog command, with changes applied so that it focused on the PC rather than the NPC.
However, I couldn't find a way of directing it. I may re-look it over.
Mud_prog.c is where I was looking.

I'm somewhat familiar with C.

Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #10 on Thu 16 Jun 2005 09:09 AM (UTC)
Message
Look at the ifchecks for e.g. name($n) or class($n). That will show you how to get the character variable passed to the ifcheck 'function'. (Function is something of a misnomer in mudprog, but whatever.) You don't want to look at mudprog commands, rather, there's a big function that executes if statements that you'll want to find. I think it has 'ifcheck' in the function name. But you could just search for 'name' (or better yet ovnumwear) and you'll find the function eventually.

Once you have the character pointer, it should be pretty easy to see if s/he's wearing something in all the right wearlocs.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


26,256 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.