# Problem with array  

**URL:** <https://forums.unrealengine.com/t/problem-with-array/2369919>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, bug-report, question, fortnite\
**Created:** [March 2, 2025, 6:49pm UTC](https://forums.unrealengine.com/t/problem-with-array/2369919 "2025-03-02T18:49:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tr\_DesTroy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tr\_DesTroy](https://forums.unrealengine.com/u/Tr_DesTroy)\
**Post date:** [March 2, 2025, 6:49pm UTC](https://forums.unrealengine.com/t/problem-with-array/2369919/1 "2025-03-02T18:49:04Z")

</div>

Error “message”: “This invocation calls a function that has the ‘decides’ effect, which is not allowed by its context. The ‘decides’ effect indicates that the invocation calls a function that might fail, and so must occur in a failure context that will handle the failure. Some examples of failure contexts are the condition clause of an ‘if’, the left operand of ‘or’, or the clause of the ‘logic’ macro.”,  
Code:

```auto
using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org }
using { /Verse.org/Random }
using { /Verse.org/Simulation }

# A Verse-authored creative device that can be placed in a level
Random_module := class(creative_device):
    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=
        var RandomX: int = GetRandomInt(0, 5)
        var RandomY: int = GetRandomInt(0, 4)
        Print("Test")
        var GameStatus:logic = false
        var GameStop:logic = false
        var Nole:int = 0
        
        var GameField : [][]int = 
            for (Row := 0..5):
                for (Column := 0..4):
                    0
                
        loop:
            if (GameStatus = true):
                set GameField = 
                    for (Row := 0..5):
                        for (Column := 0..4):
                            0
                
                for (i := 0..8):
                    set RandomX = GetRandomInt(0, 5)
                    set RandomY = GetRandomInt(0, 4)
                    set GameField[RandomX][RandomY] = GetRandomInt(1, 3)
                    
                    
            if (GameStop = true):
                break

```

Help pls

---

<div class="post-metadata">

**Author:** ![btwixer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@btwixer](https://forums.unrealengine.com/u/btwixer)\
**Post date:** [March 2, 2025, 7:05pm UTC](https://forums.unrealengine.com/t/problem-with-array/2369919/2 "2025-03-02T19:05:01Z")

</div>

Which line gets the error, this one?

> [@Tr\_DesTroy](#):
>
> `set GameField[RandomX][RandomY] = GetRandomInt(1, 3)`

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [March 3, 2025, 9:36am UTC](https://forums.unrealengine.com/t/problem-with-array/2369919/3 "2025-03-03T09:36:42Z")

</div>

```auto
option:
    set ...

```

---

<div class="post-metadata">

**Author:** ![Tr\_DesTroy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tr\_DesTroy](https://forums.unrealengine.com/u/Tr_DesTroy)\
**Post date:** [March 10, 2025, 5:13pm UTC](https://forums.unrealengine.com/t/problem-with-array/2369919/4 "2025-03-10T17:13:48Z")

</div>

> [@Tr\_DesTroy](#):
>
> set

yep

---

<div class="post-metadata">

**Author:** ![Loups.Idlez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Loups.Idlez](https://forums.unrealengine.com/u/Loups.Idlez)\
**Post date:** [March 12, 2025, 7:20am UTC](https://forums.unrealengine.com/t/problem-with-array/2369919/5 "2025-03-12T07:20:16Z")

</div>

Hey,

Try to change  
set GameField[RandomX][RandomY] = GetRandomInt(1, 3)  
with  
if (set GameField[RandomX][RandomY] = GetRandomInt(1, 3)):
