I got stuck with an issue, was hoping someone might know the solution. I’m trying to apply a grind powerup to the activating player’s opposing team. I have a button, when the player activates it, I get his team and find the enemy team by comparing it using an if statement. Then I want to apply the grind powerup to all players on that team, but this gives the no_rollback error due to the if statement.
Hello. I did a little debugging on my end to try to figure out what your issue could be. When you get the “no_rollback error” verse us trying to let you know that your code will unable to be restored to a previously defined state when a failed expression occurs.
I spelled Teams as Teamss on my end, because I have an existing class that I created called Teams so you can go ahead and change the spelling for that.
Wow, I had no idea you could skip the parentheses and format like that. (Fifteen minutes after seeing your example, I saw that Epic used the same formatting in their ‘Stronghold’ map code.)
You guys are amazing, thanks a lot to both of you! It works perfectly!
Edit: So I’m probably a dummy, but how do you end a "do: " section? I don’t seem to find any examples of this format (I checked the Stronghold map as well) and anything I put after this, it treats as if it were part of the for loop, no matter the indentation.
Btw, are there any good examples of using these TeamCollection functions? I have a hard time cracking what the data is behind them and how to properly interact with them by just looking at the Digest.
Have you tried writing any additional code you have on the same Indentation line as the if: and then: ?
I haven’t used much of the TeamCollection functions in verse as of yet. There is a team_settings_and_inventory_device that let’s you create and configure a team. I’m not too sure on how well those two interact, but I would give them a try.
Could you post a screenshot of what the error is saying? Also is there any other code below the block: in GiveExtraGold1() method? If so post that as well.
There is nothing under it (just emply space and comments but I also deleted them to be sure). It say: Functions declared at this scope are not supported.(3502)
That is a different issue than if: or do:.
A block expression is a concurrency expression. Therefore, the <suspends> effect specifier must be added to the function name.
Daaaamn! Well this was pretty lame from my side, my eyes are really not accustomed to noticing little rogue whitespaces. Thanks for the help again (both of you)!