Oblivion Mod:Cobl/Modding/Home Plate
This page covers how home modders can use the place dinner plate (aka Home Plate). Modders interested in adding foods and/or supporting hunger mods should see Dinner Plate instead.
Home Plate[edit]
Cobl's dinner plate is usually accessed through the "+Dinner" misc item in inventory, but it can also be accessed through external activators. When the cobEatHomePlateOS script is placed on an activator (e.g. on the provided cobEatHomePlateMC), it will cause the Dinner Plate menu to be shown when that object is activated.
If the object has no "enable parent" reference, then food for the dinner plate will be drawn from the player's inventory. However, if an enable parent is set then that parent reference will act as a food larder -- i.e. foods for the dinner plate will be drawn from it instead of from the player's inventory.
If you're using a food larder, then:
- The food larder must be a permanent reference.
- Make sure that the dinner plate is parented to the food larder container, and not to some other reference!
- If the house has buyable packages, then you should make sure that the food larder reference is part of the same package that includes the table that the food plate is resting on. (Otherwise, you may end up with the dinner plate floating in midair!)
- Make sure that the Food larder does not respawn!
- If you have an alchemical sorter nearby, you may want to use that as the food source. (This is fairly natural since the sorter will store all foods when you tell it to "Put Away Ingredients".)
You should give the player some clue as to where the dinner plate is drawing food from:
- If the source is nearby and is labeled "Food Larder" that's probably sufficient.
- If it draws from an alchemist sorter, then you might label the plate "Alchemist's Dinner Plate". Again, the sorter should be pretty close.
- And/or you might include a note by the dinner plate which says where it draws foods from.
Pub Plate[edit]
Later, Cobl will include a Pub Plate which can be placed in restaurants, etc. The Pub Plate will work just like the home plate, but players will be charged for any foods that they eat.
Auto-Stocked Food Larders[edit]
If you would like to auto-stock food larders for home or pub plates, then you should:
- Set the parent container to one that the player can't access. (Don't want the player to restock it themselves!)
- Manually restock the container using a script.
- Use container.removeAllItems to clear current contents.
- Use container.addItem to add items from leveled list, etc.
You would want to script this so that it happens every day or so. Note that while you could use a respawning container, that container would specifically not reset if the player keeps visiting the location before the cell respawn time occurs. Manual respawn is more reliable if you want to make sure that the container restocks on a regular basis.