Pass a Verse Mod result to a BlueprintCallable integer parameter
Section titled “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 and the reflection type module on this checkout.
Symptom
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “Verified”- Evidence level: runs in packaged build.
- How:
bash Saved/step10-editor-lane.sh place-retry Scripts/build_slice_map.pycompiled and placed the corrected actor. After BuildCookRun,bash Scripts/prove_night_save.shran the packaged rule and loggedFOX victim=Hen1 spot=1inSaved/step10-proof.e5jQ8v/open.log. Coop Zero commit155ed14records the package command inREPORT.md. - Date / by: 2026-11-25, Coop Zero Step 10.
Limits and assumptions
Section titled “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.