Skip to content

Answer Value In Array on a non-array operand as a missing element #97

Closed

Description

@e54-bot

Problem

After #93 and #95, Bastion on athena main (docs/scenario-examples/valid/bastion.json plus buttons for every slot on both players) ends not_modeled at tick 0:

{ "status": "not_modeled", "construct": "valueInArray on Null", "tick": 0,
  "location": { "rule": 167, "name": "[Event/先知] Collapse undecided next event under observation", "eventPlayer": "p2", "condition": 1 } }

Condition 1 evaluates Value In Array(First Of((Event Player).playerTitles), True). playerTitles is unset (Null), so First Of returns Null and Value In Array receives a non-array. call.rs returns Null for an out-of-range index but stops not_modeled for any non-array operand.

Catalog evidence

  • valueInArray: "The value found at a specific element of an array. Results in 0 if the element does not exist."
  • firstOf: "The value at the start of the specified array. Results in 0 if the specified array is empty."

A non-array operand has no element at any index, so the catalog sentence for "the element does not exist" covers it. The catalog does not state this case explicitly.

Scope

  • Make Value In Array on a non-array operand (Null, number, text, vector, player, bool) answer the same value as an out-of-range index does today (Null, which compares equal to 0 as for the existing out-of-range case). Check that First Of on Null and on an empty array already answer the same way and make them consistent.
  • Record this in docs/findings.md as modeled, not measured, with the two catalog sentences as the basis, and add a probe request line if the repo keeps one for modeled-not-measured choices (follow the existing entries for out-of-range index).
  • Update the modeled-values list in docs/scenario-format.md or docs/simulator-interface.md wherever it states that a non-array operand stops the run.

Acceptance

  • Tests: non-array operand of each type; First Of of Null and of an empty array; the out-of-range cases unchanged; use inside Compare and Is True For Any.
  • Bastion rerun with the scenario above: report the new first stop, or completion. Parent: Run Bastion to completion on athena-sim #45.

Activity

  1. added a commit that references this issue on Oct 26, 2026
    9c0eb32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions