- A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z -
Other
.:. |
Mob programs are scripts written to instruct NPCs (Mobs) on how to interact with players in an automated way. These scripts are event based, reacting to events in the MUD by the use of triggers. (See: 'help mob triggers') To specify that a script should be run when a certain event is triggered for a certain mob, you use the 'mprogadd' command to add a trigger to a mob. (See: 'help mprogadd') You can also just type 'mprogadd' with no arguments to see the syntax. To see a list of triggers that are available, see: 'help mob triggers' You can add existing scripts to any mob. One script can be re-used by many mobs if properly written. They key is to try and not hard code anything specific to one mob in a script. The scripts are identified by vnums, just as rooms, objects, and mobs are. And also just like you can have both a room and object by the same vnum, you can have a mob and a script/program by the same vnum. The mob program editor (mpedit) uses a different type of OnLine Creation (OLC) than rooms, objects, or mobiles. Instead of trapping you inside an inflexible menu, when you enter mpedit, you are given a command interpreter that is no different than the MUDs command interpreter aside from the fact that ithas different commands. (Once inside mpedit, type 'commands' for a list of mpedit specific commands.) While inside mpedit, your commands are first interpreted by mpedit and then if there is no match they are sent to the MUD main command interpreter. This allows you to continue carrying on a conversation with someone while still working inside mpedit. To write code for a mob program you will need to understand the language. Basically a MUD script can call regular MUD commands (say, emote, socials, etc) and there are also special 'mob commands' available. (See: 'help mob commands') Mob programs also have some logic flow control methods available so that you can have your mob program make decisions based on whatever criteria you like. For example the mob can decide to greet an aiel differently than a seafolk or greet higher ranked guild members differently than lower ranked ones. To see a tutorial on how this 'logic' works, see: 'help mob logic'. For a list of 'functions' available to make decisions on, see: 'help mop functions'. Inside the code, there are ways to refer to different 'actors'. For example, the player who triggered the script vs other players in the room vs the mob himself. To see a list of these 'act' codes, see: 'help mob act codes' Remember that each script can be used by more than one mob, and each mob can use multiple scripts and have multiple triggers. You can have triggers that greet people for entering a room, or triggers that stop people from leaving. You can have triggers that react when people say certain keywords, etc. |
:: Beginning |