TO BE TITLED

or

"A logic language for RPG games"

2024-09-30

references {
  actor:hero "Protagonist",
  actor:npc "Jumbo Jack",

  prop:artifact "Ancient Artifact",
  background:village_square "Village Square",
  scene:start_quest "Start Quest",
}

# sequence: the equivalent of a function. Bundles of functionality that can be reused.
sequence HeroSayHi {
  actor:hero say "Hello!"
}

sequence SomeoneSayHi(actor:who) {
  arg:who say "hello!"
}


scene MainScene {
  # ensure: use the most fitting method for making the given equalities true.
  #   If ensure is at the start of a scene:
  #     - if the scene is entered though a transition, teleport all actors to desired positions and set desired props and backgrounds.
  #     - if the scene is entered seamlessly, make all actors walk to the desired positions and smoothly transition props and backgrounds.
  ensure {
    scene background is scene:village_squre,
    actor:hero position is (50, 50),
    actor:npc position is (200, 150),
  }

    move actor:hero to actor:npc { distance: 10, facing: front, pace: walk }
    actor:npc say "Welcome, Young Hero!"
    camera zoom in on actor:hero { duration: 2s}
    camera pan to actor:npc { duration 1s }

  # parallel: execute all commands at the same time.
  parallel {
    move actor:hero to (100, 100) { duration: 2s }
    camera pan to (150, 150) { duration: 2s }
  }

  # The following block will wait 1 second after the player dismisses the dialog.
  repeat 3 times {
    actor:npc say "Hello!"
    wait 1s
  }

  # The following block will wait 1 second if the player dismisses the dialog immediately.
  repeat 3 times {
    parallel {
      actor:npc say "Hello!"
      wait 1s
    }
  }

  timeline {
    at 0s: actor:hero say "Let's go!"
    at 2s until 5s: move actor:hero to (100, 100)
    at 4s: camera zoom out
  }

  set flag:artifact_found to true
  if flag:artifact_found is true {
    actor:npc say "You've done well to find the artifact."
  } else {
    actor:npc say "The artifact is still out there somewhere."
  }
}

event HeroNearNpc {
  actor:npc look at actor:hero
  actor:npc say "Hello there!"
}

dialogue FirstMeeting {
  actor:npc say "Are you ready for your quest?"
  choice {
    "Yes, I am ready." => start quest:start_quest
    "No, I need more time." => nothing
  }
}