Features and items

The pesky goblin is going to run away into a small room full of items it's stolen over the years. We'll have it hide there. First, add erase_char(6); to the end of the INIT_STATE in z1hideout.txt, after the if statement. erase_char is a function call that removes a specified character from the game (until the player returns to the town). We'll be placing another copy of the pesky goblin later.

Next, create the dead end where the goblin will be hiding. Place a box at the far end, as well as a bunch of crates and barrels. The box is a terrain, but crates and barrels are special features which need to be placed using the "Place Crate" and "Place Barrel" buttons. Other examples of special features (which have their own buttons in the Editor) are cobwebs, barriers, and blood stains. You can remove features with the "Clear space" tool.


Place a special encounter rectangle at the entrance (linked to state 10), and write the corresponding state in the town script:

beginstate 10;
  if (get_flag(1, 1) == 0) {
    set_flag(1, 1, 1);
      "You reach a dead end containing a chest and a haphazard assortment of crates and barrels.",
      "Clearly items that the goblins have stolen in the past. But where is the last goblin hiding?"

Next, place a bunch of items in the dead end. You place items by selecting one from the item menus (I1 to I10) then clicking on the square where you want the item to be. Start by placing various trash items (numbers 196, 197, and 198). You can even place trash in one of the crates or barrels. Put one or more pieces of trash on top of a barrel, then select it with the "Select/edit placed object" button (if more than one item is in a stack, keep clicking to access each item in turn). Click "Not Contained" so it changes to "Contained". Now it's inside the barrel. You'll also see "Not Property" listed; in towns, you'll often want to change this to "Property" to indicate that the item does not belong to the player (and will anger the town if a character sees it being stolen).


Add a variety of items to the crates and barrels: bottles of cheap wine (166), poor furs (179), pears (397), apples (398), maybe even a boardgame (406). Don't add anything to the chest, though: that's where the goblin will be hiding.