This quest example covers chests and npc tags.

Logic Edit

  1. Open a chest which gives a scroll item and also spawn monsters.
  2. Use the item to kill all the monsters.

Pseudocode Edit

Variable Edit

  • haveOpenedChest = false

Item Edit

  • Scroll (with event useItem)

Events Edit

getChestState (linked with "getState" of chest)
    return haveOpenedChest
openChest (linked with "openEvent" trigger of chest)
    set haveOpenedChest = true
    add item scroll
    spawn 2 monsters with tag "monster = true"
useItem (linked with option of Scroll item)
    for every npc in the map with the tag "monster = true":
        kill the npc

Maps Edit

Spawn a chest that gives a scroll and spawn 2 monsters.

Real Code Edit

Variable Edit


Item Edit

n.newItem(ITEM.scroll, "Scroll", CST.ICON.planEquip,[

Events Edit

    return s.get(key,VAR.haveOpenedChest);
    s.spawnNpcOnTop(key,MAP.main,NPC.bat,attrs => {
        attrs.tag = {[]:true};
    s.spawnNpcOnTop(key,MAP.main,NPC.bat,attrs => {
        attrs.tag = {[]:true};

Map Edit

//Tiled project has a q1 spot on layer SPOT.
m.spawnLoot(mapUid, spots.q1,EVENT.getChestState,EVENT.openChest);

Walkthrough from Quest Template Edit

To create a new quest in the Raining Chain Editor:

  1. Create new quest. (Ctrl+Shift+P RCE:New Project)
  2. Add ids to the enums.
  3. Copy-paste the quest variable.
  4. Copy-paste the item.
  5. Copy-paste the events in EVENT_CLASS.
  6. Add the q1 spots in the .tmx file then "Update Spots". Once again, make sure to put the spot inbetween tiles.
  7. Copy-paste the npc spawning logic in the map onLoad().
  8. Test the quest. (Ctrl+Shift+P RCE:Test Project)
Community content is available under CC-BY-SA unless otherwise noted.