How to Add a Scroll With Text on an Alcove

It is not possible to define parameters, like the text for a scroll, for items that are added on alcoves or inside containers by using the inspector alone but it is possible to work around these limitations by scripting. First, let’s place an alcove into the level and set its ID to scrollAlcove and then let’s add the following script into a script_entity:

local message = spawn("scroll")
message:setScrollText("This is an important\nmessage!")

scrollAlcove:addItem(message)

The first line of script defines a local variable called message which contains a spawned entity: a scroll item. On the next line, we set the text for the entity in the message-variable. The \n in the middle of the string is a line break. Then, on the last line, we add the item onto the alcove. This same method can be used to place items into containers such as sacks or wooden boxes too (the container can also subsequently be placed on an alcove too).