Skip to content
Max Leuthäuser edited this page Nov 18, 2021 · 5 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!

The return type of role method calls is always Either[SCROLLError, E] where E is the return type of your role method. Understand how the Either type works.

You may want to check the return value explicitly:

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