Skip to content

Pass a Verse Mod result to a BlueprintCallable integer parameter

Section titled “Pass a Verse Mod result to a BlueprintCallable integer parameter”

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).

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.

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.

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.

  • 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.

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