This quest example covers switches and blocks. The complete quest file can be found in the RCE via "Ctrl+P: QquestExample2".

Logic Edit

  1. Rocks block path.
  2. Activate switch to destroy them.

Pseudocode Edit

Variable Edit

  • haveDestroyedRock = false

Events Edit

activateSwitch (linked with "toggle" trigger of NPC Lever)
    set haveDestroyedRock = true
getSwitchState (linked with "getState" attribute of NPC Lever)
    if haveDestroyedRock == false
       return false (not activated)
    if haveDestroyedRock == true
       return true (activated)
canSeeRock (linked with "viewedIf" attribute of NPC Rock)
    if haveDestroyedRock == false
        return true (visible)
    if haveDestroyedRock == true
        return false (not visible)

Maps Edit

  • Spawn block that are visible until the player activates the switch.
  • Spawn the switch

Real Code Edit

Variable Edit


Events Edit

    return s.get(key,VAR.haveDestroyedRock);
    return !s.get(key,VAR.haveDestroyedRock);

Map Edit

//Tiled project as a q1 and q2 spots on layer SPOT

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 variable in n.newVariable().
  4. Copy-paste the events in EVENT_CLASS.
  5. Add the q1 and q2 spots in the .tmx file then "Update Spots". Make sure the q2 lever tile is positioned inbetween tiles as specified in Map Creation Guide.

    • RCE QuestExample2 spots

  6. Copy-paste the npc spawning logic in the map onLoad().
  7. Test the quest. (Ctrl+Shift+P RCE:Test Project)