Skip to content
Max Leuthaeuser edited this page May 10, 2026 · 6 revisions

Frequently Asked Questions and Common Pitfalls

This site collects some typical problems and pitfalls users of SCROLL might encounter.

SCROLL never finds the correct player / role instance!

SCROLL uses a custom equal and hashCode implementation for role-playing objects. If you are using Scala case classes make sure you understood their identity / comparison mechanism (see the official documentation).

SCROLL is never executing my role methods but simply jumps over them!

For a regular Compartment, dynamic role method calls return Either[SCROLLError, E] where E is the return type of your role method.

For MultiCompartment, calls return Either[SCROLLError, Seq[Either[SCROLLError, E]]]. The public scroll.MultiDispatchResult alias and sequenceResults helper can be used to flatten successful results.

If you assign a role call directly to an expected value type, SCROLL also offers implicit unwrapping. In that case, typed SCROLLErrors are rethrown on failure instead of being returned as Left(...).

You may want to check the return value explicitly:

import scroll.Compartment

val core = new Core()

new Compartment {
  val someRole = new Role()
  core play someRole
  val result = +core someRoleMethod()
  result match {
    case Left(error) => handle(error)
    case Right(returnValue) => // do something with it
  }
}

Clone this wiki locally