Author Topic: Building bugs and bad building  (Read 8547 times)

0 Members and 1 Guest are viewing this topic.

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Building bugs and bad building
« on: October 23, 2010, 04:29:19 am »
When we first started 4D, the entire building staff - including myself - were total newbies at our job. I had only built a Clan HQ in my earlier mud when I was made Head Builder. And the code change from Mythran to Circle didn't make things any easier either.
Consequently, whenever I update one of our older zones, I find loads of annoying mistakes - some of which I caused myself.
Even today some mistakes seem to be rather common, since we still have a number of pretty inexperienced builders.
The errors/mistakes/bugs I notice are mostly with resets and shops, and of course, scripts.

This leads me to think that we need to clean up some building routines, and if any of you guys notice any "bad patterns", especially in old zones, please share the knowledge here.

Let me start with some of my own observations of common builder mistakes, and questions that I often get from new builders:

RESETS:
1. If you put a maxload of more than 1 on a reset object, you always need to put in a remove command before the load command, otherwise the objects will pile up in the room until they reach the max number.
Example:
0 - Remove the fir tree [52735] from room.
1 - Load the fir tree [52735], Max : 999


2. The same remove command should be used for fountains, to make sure that they are always filled, and for containers, to ensure that any item loaded inside them reloads each time the zone resets. (Otherwise the content will only load after a reboot or crash).

3. If you want to load more than one on the same object in a room, it's best to put these objects in some kind of container.

4. Don't set the maxload too low, especially if the object is sold in a shop. It's very irritating when an object doesn't load as expected, because the maxload is reached. (Not only to the players, but also to the imms who have to tend to the bugreports). Usually you should set a maxload of at least 200, more if it is a potion that players tend to stockpile.
Artifacts should alwasy be set with a high maxload, otherwise it may screw up the artifact code.

5. If you load the same object or mob in more than one room, make sure that you set the same maxload on all the loading places.

6. Loading the same sentinel mob in more than one room is generally a bad idea. It works at the first reset after a reboot. But when the mobs are killed off, it can lead to a mob-pileup in the first room, while other intended loadplaces are left empty, since the code always starts with the load in the first room. (If the mobs move around this doesn't matter)

SHOPS:
1. Never put more than one shop in the same room, unless you have some special intention with it. Only the first shop will show up on the list command.

2. Always use the mov vnum as vnum for the shop, not the room.

3. If the shopkeeper is moving around, make sure you set all the rooms he can move to in sedit.

4. Make sure that the objects you want the shop to sell have a price set in oedit, and that they are given to the mob in zedit. Otherwise they won't show up on list and cannot be sold.

5. If the shop is a weapon shop, remember that the code makes mobs wield the top weapon in their inventory directly after being loaded. This means that you'll have to reset 2 of the last weapon you give the mob, if you want him to sell all the weapons he has. (The bottom line of the reset list appears on top in the inventory when the zone resets).

6. If you want the shopkeeper to also buy things from players, you need to set what type of items they accept. Also make sure that the buying rate is considerably lower than the selling rate.

SCRIPTS:
A mob /room/object can only have one script of the same type, if the argument is * or there is no argument at all.
Examples:
- If you put two greet scripts on the same mob, only the first one will trigger.
- a speech or command script with a set arg will not trigger if there is another speech script with the arg set as * on the same mob/room/object.