# New Warnings in Verse Code

**URL:** <https://forums.unrealengine.com/t/new-warnings-in-verse-code/1636387>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite\
**Created:** [January 23, 2024, 11:23am UTC](https://forums.unrealengine.com/t/new-warnings-in-verse-code/1636387 "2024-01-23T11:23:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidpkami](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/davidpkami/32/1040403_2.png) [@davidpkami](https://forums.unrealengine.com/u/davidpkami)\
**Post date:** [January 23, 2024, 11:23am UTC](https://forums.unrealengine.com/t/new-warnings-in-verse-code/1636387/1 "2024-01-23T11:23:16Z")

</div>

This started to appear as a warning in my code

> This expression in the right operand of ‘set … = …’ can fail, but the meaning of failure here will change in a future version of Verse. To preserve the current meaning of this code in future versions of Verse, you should move the expression that can fail outside the ‘set’.  
> For example, if you have the expression:  
> set Variable = ExpressionThatMightFail,  
> you can change it to the following two expressions to preserve the meaning:  
> Value := ExpressionThatMightFail  
> set Variable = Value

For example with this code:

`if(set LastTick = AllMultipleAgentEliminationTick[EliminatingAgent]):`

So, just to be clear, the correct way should be this?

`if(NewTick := AllMultipleAgentEliminationTick[EliminatingAgent], set LastTick = NewTick):`

With this one, the warning dissapears, but I don´t see the improvement of this

---

<div class="post-metadata">

**Author:** ![JamieDeGamie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JamieDeGamie](https://forums.unrealengine.com/u/JamieDeGamie)\
**Post date:** [January 23, 2024, 11:26am UTC](https://forums.unrealengine.com/t/new-warnings-in-verse-code/1636387/2 "2024-01-23T11:26:08Z")

</div>

Yes this fixes it. This is just a safety feature so future updates of Verse won’t mess up your code

---

<div class="post-metadata">

**Author:** ![Death-Streak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/death-streak/32/551311_2.png) [@Death-Streak](https://forums.unrealengine.com/u/Death-Streak)\
**Post date:** [November 7, 2024, 6:19pm UTC](https://forums.unrealengine.com/t/new-warnings-in-verse-code/1636387/3 "2024-11-07T18:19:49Z")

</div>

This Fixes the Issue,  
also this issue is in UEFN Tutorial

> **[8. Final Result | Unreal Editor for Fortnite Documentation | Epic Developer...](https://dev.epicgames.com/documentation/en-us/uefn/team-elimination-game-8-final-result-in-verse)**
>
> Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.

---

<div class="post-metadata">

**Author:** ![LosesoIcanwin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LosesoIcanwin](https://forums.unrealengine.com/u/LosesoIcanwin)\
**Post date:** [February 7, 2025, 12:49am UTC](https://forums.unrealengine.com/t/new-warnings-in-verse-code/1636387/4 "2025-02-07T00:49:59Z")

</div>

We are having the issue with the .Length part of the code. Do you know how I could rewrite this to make it work?

BalanceTeams() : void =  
AllPlayers := GetPlayspace().GetPlayers()  
for (TeamPlayer : AllPlayers, CurrentTeam := GetPlayspace().GetTeamCollection().GetTeam[TeamPlayer]):  
# Assign Players to a new team if teams are unbalanced  
var TeamSize:int = 0

```
            if(set TeamSize = GetPlayspace().GetTeamCollection().GetAgents[CurrentTeam].Length):
                Print("Size of this player's starting team is {TeamSize}")

```

---

<div class="post-metadata">

**Author:** ![Savicii\_381](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Savicii\_381](https://forums.unrealengine.com/u/Savicii_381)\
**Post date:** [February 8, 2025, 12:20am UTC](https://forums.unrealengine.com/t/new-warnings-in-verse-code/1636387/5 "2025-02-08T00:20:32Z")

</div>

S1(Agent:agent):void=

```
  {
    Print("jumppow")
  if(YU:= Agent.GetFortCharacter[]):
    Print("jumppoLLw")
    if(set PlayerPowerNum[1]=player[Agent]):
          NormGranter.GrantItem(Agent)
      YU.JumpedEvent().Subscribe(Jump2)
      if(G:= player[Agent]):
        PowerUi(G,5)
  }

```

Is my code with this faulty warning, how do I rewrite it?
