# Pass a Verse Mod result to a BlueprintCallable integer parameter

- **Status:** current.
- **Engine:** ue6-main `61e2877e`, Linux x86_64, Epic clang 23.1.5 (v27 SDK).
- **Context:** Standalone UE6, BPVerse in project Content.
- **Prerequisites:** [C++ actor and BPVerse bridge](/docs/recipes/bpverse-actor-in-headless-editor/) and the [reflection type module](/docs/known-issues/bpverse-missing-versereflectiontypes/) on this checkout.

## Symptom

A call passing a native object and the result of `Mod[Day, Count]` to a C++ `int32` parameter fails with `Script error 3509`. The compiler expects `tuple(?coop_chicken,type{_X:int where -2147483648 <= _X, _X <= 2147483647})` and sees `tuple(?coop_chicken,int)`.

## Smallest example / reproduction

In Coop Zero Step 10, declare `UFUNCTION(BlueprintCallable) bool ScareBird(ACoopChicken* Bird, int32 Spot);` on the fox actor. In its Verse subclass, bind `Spot := Mod[Day, SpotCount]` in a failure context and call `ScareBird(option{Bird}, Spot)` on success. Run the headless editor commandlet with the project Verse content enabled. The failing call is in `Content/fox.verse`.

## Solution

Change the BlueprintCallable parameter to `int64 Spot`. Check `Spot < 0 || Spot >= HidingPoints.Num()` in C++ before casting the index to `int32` for the array access. Keep the modulo selection in Verse.

## Why it works

The native reflection layer presents `int32` as a bounded type. The compiler treats the result of `Mod[]` as `int`, including when the divisor comes from a native `int32` setting. On this engine the reflection bridge presents `int64` as `int`. An explicit check against the native array length validates the index before narrowing.

## Verified

- **Evidence level:** runs in packaged build.
- **How:** `bash Saved/step10-editor-lane.sh place-retry Scripts/build_slice_map.py` compiled and placed the corrected actor. After BuildCookRun, `bash Scripts/prove_night_save.sh` ran the packaged rule and logged `FOX victim=Hen1 spot=1` in `Saved/step10-proof.e5jQ8v/open.log`. Coop Zero commit `155ed14` records the package command in `REPORT.md`.
- **Date / by:** 2026-11-25, Coop Zero Step 10.

## Limits and assumptions

The fixture covers a nonnegative day number and an authored three-element array. It does not exercise values outside the representable native `int64` range.
