JIFFEE Errors

This page describes in more detail what the various error codes mean, and gives some hints about how to fix them if they happen when you run your game.


J001 - illegal to call with [number] arguments

The checks.validate() function should always be called like this:

this.checks.validate(arguments);

with a single argument, but you called it some other way. Look at the red error message to see how many arguments you actually provided, then change the call in your game so that it has a single argument.


J002 - illegal to call with [number] arguments

You called a function inside your program with the wrong number of arguments. Look at the red error message to see what function you called and how many arguments you actually provided, then look at the definition of the function to see how many arguments you were supposed to use. You need to change the call in your game so it has the correct number of arguments.


J003 - args must be non-empty strings

When you call priorities.add() you must supply two arguments, and both must be strings at least one character long, like this:

priorities.add("before", "after");

Look at the red error message to see what arguments you actually provided, then find the call in your game and correct the arguments.


J004 - cookie string too long

You've tried to set a cookie value which, when combined with the state name and SHA fingerprint, exceeds the normal limit of 4K bytes. This means the game is trying to save the values of too many changeable noun/trait pairs.


J005 - priorities are already started

All your calls to priorities.add() must be completed before calling engine.init(), which in turn calls module.init(). You tried to add another priority after that happened.


J006 - both are already defined

When you called priorities.add(), both of the arguments are already names of existing priorities.


J007 - smallest allowable maximum is 1

You called encoding.addVar() with a maxVal less than one. This doesn't make sense, because the minimum value is always zero.


J008 - largest allowable maximum is [number]

You called encoding.addVar() with a maxVal that is too big for JIFFEE to encode into a cookie.


J009 - called after chunks were built

You called encoding.addVar() after the game started. This is not allowed, because it would change the format of the cookie that stores the game's state.


J010 - tried to build chunks twice.

You called traits.start() twice, which is not allowed.


J011 - called before chunks were built

You called traits.getFingerprint() before calling traits.start(). This won't work, because you haven't finished adding vars, and thus you cannot yet know what the fingerprint will be.


J012 - called before chunks were built

You called traits.getString() before calling traits.start(). This won't work, because you haven't finished adding vars, and thus you cannot yet know what the encoding will be.


J013 - called before chunks were built

You called traits.setString() before calling traits.start(). This won't work, because you haven't finished adding vars, and thus you cannot yet know what the encoding will be.


J014 - string should have length [number] but had length [number]

When you called encoding.setString(), you passed it a string which is the wrong length. The state of each game is stored in a string of a fixed length (determined by the game's fingerprint), and it is an error to try to set it to a string of any other length.


J015 - each object must be a [preposition, condition] list

You called verbs.add(), but the objects (the arguments immediately preceding the action) did not consist of [preposition, condition] pairs.


J016 - illegal varNum

When you called encoding.setVar(), you passed a varNum (the first argument) which is not a number ever returned by a previous call to encoding.addVar().


J017 - smallest allowed value is zero

When you called encoding.setVar(), you tried to set the value of the var to a number less than zero. Only non-negative integers are allowed.


J018 - largest allowed value is [number]

When you called encoding.setVar(), you tried to set the value of the var to a number that is bigger than the maximum you specified when you first added the var.


J019 - illegal varNum

When you called encoding.getVar(), you passed a varNum (the first argument) which is not a number ever returned by a previous call to encoding.addVar().


J020 - neither is already defined

When you called priorities.add(), neither of the arguments was already names of existing priorities.


J021 - no such priority is defined

You are trying to resolve a priority into a number, but the string you passed has never been defined to be a priority.


J022 - priorities already started

You have to finish all your calls to priorities.add() before you can call priorities.start() to resolve all the strings to numbers. Once that's done, you cannot restart it later with a new fingerprint.


J023 - noun must be a string

When you call agenda.addChangeTrigger(), the "noun" argument (the first argument) must be a string.


J024 - trait must be a string

When you call agenda.addChangeTrigger(), the "trait" argument (the second argument) must be a string.


J025 - [direction-name] is not a direction

You called places.connect(), but the second argument was not a valid direction name.


J026 - pattern must be string or RegExp

When you call agenda.addCommandTrigger(), the pattern (the first argument) must be either a string or a regular expression.


J027 - first five arguments must all be of type string

You called verbs.add(), but one of the first five arguments was not a string.


J028 - no job pending

You called agenda.clearJob() when there was no job pending.


J029 - name must be a string

Internal name validation failed. This means you tried to add a noun (person, place, or thing) or a trait whose name was not a string.


J030 - name must contain at least one character

Internal name validation failed. This means you tried to add a noun (person, place, or thing) or a trait whose name was the empty string.


J031 - names may not contain special chars like "[character]"

Internal name validation failed. This means you tried to add a noun (person, place, or thing) or a trait whose name contains special characters, i.e. something other than letters, numbers, space, hyphen, and underscore.


J032 - new names may only be defined before game starts

Internal name validation failed. This means you tried to add a noun (person, place, or thing) or a trait after the game has begun. This is illegal, because it would change the fingerprint of the game.


J033 - that name is already in use for a noun

Internal name validation failed. This means you tried to re-use the name of a noun (person, place, or thing) for another noun or for a trait, but a name in JIFFEE can only be used for a single thing.


J034 - that name is already in use for a trait

Internal name validation failed. This means you tried to re-use the name of a trait for another trait or for a noun (person, place, or thing), but a name in JIFFEE can only be used for a single thing.


J035 - needs at least 3 arguments

You called traits.addEnum() with fewer than 3 arguments. This means the trait can only have 0 or 1 possible values, which would make it useless.


J036 - value "[value-name]" occurs twice in list

You called traits.addEnum() with a list of possible values, but one value appeared twice in the list. You must ensure that each value appears only once in the list.


J037 - game is already started

You called traits.start() more than once.


J038 - no such noun exists

You called traits.addSlot_() but supplied a non-existent noun.


J039 - no such trait exists

You called traits.addSlot_() but supplied a non-existent trait.


J040 - set() cannot be called after another set() or change()

If you call traits.set() it fixes the value of the trait forever. That means you can only call it once, and you cannot call change() on the same noun/trait combination.


J041 - set() cannot be called after the game starts

If you call traits.set() it fixes the value of the trait forever. That means you must make the call before the game starts, so that the value will be available as soon as the game begins.


J042 - change() cannot be called after set()

You cannot call traits.change() to alter the value of a trait which has been set forever with traits.set().


J043 - change() must be called once before the game starts

Even if the value of a trait is going to change, it must have some value as soon as the game begins. Therefore you must call traits.change() on it before the game starts.


J044 - refTrait value must be the name of a noun

You are trying to set() or change() a refTrait to a value which is not the name of any noun. Check to make sure you've spelled the name of the noun correctly.


J045 - rangeTrait value must be integer between zero and [number]

You are trying to set() or change() a rangeTrait to a value which is either too small (less than zero), too big (greater than the maximum allowed for that trait), or is not an integer (whole number) at all.


J046 - enumTrait value must be one of the enumerated values

You are trying to set() or change() an enumTrait to a value which is not one of the allowed (enumerated) values for that trait. Check that you have spelled the name of the value correctly.


J047 - game is already started

You called traits.addVarsToEncoding() after the game started. This may be an internal error in JIFFEE.


J048 - Translation tables differ:

This is used during testing. It indicates that the translation table (inside a Display object) being tested is either missing keys or has extra keys. This needs to be fixed (by adding or correcting display.translateTo calls) in order for translation to work correctly.


J049 - no such trait

You called traits.findNouns() but named a trait that does not exist.


J050 - there are more commands left to get(), like "[some-command]"

You called parser.notifyUserInput() before letting JIFFEE process the previous input.


J051 - first arg must be string or RegExp

You called parser.translateTo(), but the first argument was not a string or a regular expression.


J052 - action is the wrong type to be performed

Something (e.g. a trait value or an argument to a trigger routine) is supposed to be an action, but you've defined it to be something other than a string or a function.


J053 - argument must be a string

You called display.sanitize() with an argument that was not a string.


J054 - player has no location

This indicates an internal error where the player was never assigned a location.


J055 - you have an argument but no $[number] to match

You called display.show() with too many arguments for the template you supplied.


J056 - too many calls to addXXXTrigger()

There is an upper limit to the total number of triggers (both commandTriggers and changeTriggers) that may be added to a single game. The limit is approximately one million, and you have exceeded this limit, which usually means your program is stuck in a loop.


J057 - argument must be Boolean

You called translate.setStrict() with an argument that is not "true" or "false".


J058 - [condition-name] is not a legal condition

You called verbs.add() and supplied [preposition, condition] pairs for the objects, but the condition part of one object was not a legal value.


J059 - The following modules failed to initialize: ...

When you called engine.init(), JIFFEE was unable to initialize all the modules that you had added to the engine. The error message provides a list of each module that was not initialized, and the dependencies that could not be satisfied. This often means that you simply forgot to add some module which is needed by some other module that you're using. If you are writing a new module, this message could also indicate that you've accidentally created a circular dependency, which JIFFEE does not allow.


J060 - both arguments must be strings

You called display.translateTo() with an argument that was not a string.


J061 - A translation is already defined for this output.

You called display.translateTo() twice for the same "from" string, which is not allowed. Only a single translation may be defined for any given string in canonical form.


J062 - duplicated module [module-name]

You've used engine.add() to add two modules which have the same NAME. JIFFEE requires each module to have its own unique name.


J063 - Help has no support for language [language-name]

You called engine.init() with a language for which the module "com.jiffeegames.Help" has no translation defined.


J064 - argument must be a string

You called display.translate() with an argument which is not a string.


J065 - no translation defined for this output

You called display.translate() with a string for which you never defined a translation with display.translateTo().


J066 - module has no NAME

Every module must have a NAME. You passed a module to engine.add() which does not have this property defined.


J067 - [place-name] is not a place

You called places.connect(), but either the first or third arguments were not the names of places.


J068 - Verbs has no support for language [language-name]

You called engine.init() with a language for which the module "com.jiffeegames.Verbs" has no translation defined.


J069 - Places has no support for language [language-name]

You called engine.init() with a language for which the module "com.jiffeegames.Places" has no translation defined.


J070 - Things has no support for language [language-name]

You called engine.init() with a language for which the module "com.jiffeegames.Things" has no translation defined.


J071 - you have a $[number] but no argument to match

You called display.show() without enough arguments to match every $[number] in the template.


J072 - Persistence has support for language [language-name]

You called engine.init() with a language for which the module "com.jiffeegames.Persistence" has no translation defined.


J073 - internal cookie error - inconsistent save

A sanity check inside JIFFEE failed. This may indicate a bug in JIFFEE itself, or at least inside the core modules. This particular failure indicates that reading a cookie immediately after writing it does not return the original value.


J074 - argument must be a string

When you called encoding.setString(), you passed it an argument that is not a string.


J075 - game has not yet started

You called traits.getVarsFromEncoding() before the game started. This may be an internal error in JIFFEE.


J076 - module [module-name] has no DEPENDENCIES

Every module must have its DEPENDENCIES specified. You passed a module to engine.add() which does not have this property defined. Even if the module doesn't depend on anything else, you still have to explicitly state that fact by setting DEPENDENCIES equal to an empty list "[]".


J077 - module [module-name] cannot locate [short-module-name]

You called this.locate() with a short-module-name that was never included in the module's DEPENDENCIES list.


J078 - at least 6 arguments required

You called verbs.add() with insufficient arguments.


J079 - [game-name] has no support for language [language-name]

You called engine.init() with a language for which the actual game module has no translation defined.


J080 - new score of [number] exceeds maximum score of [number]

Your score has increased to a value greater than the declared maximum score for this game.


J081 - new score of [number] is less than zero

Your score has decreased to a value less than zero, which is illegal.


J082 - unused

unused


J083 - unused

unused


J084 - unused

unused


J085 - unused

unused


J086 - unused

unused


J087 - unused

unused


J088 - unused

unused


J089 - unused

unused


J090 - unused

unused


J091 - unused

unused


J092 - unused

unused


J093 - unused

unused


J094 - unused

unused


J095 - unused

unused


J096 - unused

unused


J097 - unused

unused


J098 - unused

unused


J099 - unused

unused