Verse is great!

Verse is great!

You can just do
if. set CurrentFastestLaps[Index] = RunTime

Also you can make a function which can make it failable and you can have as many failables that would normally require an if, then again if you do something like accessing an array out of bounds and you didn’t “if” it, just like most languages the entire function will fail

I dont think you can though, I put it in an if statement and still got an error. Arrays are immutable, you need to make a copy of it, then replace the original array with the copy. That is like the entire point of verse. Maybe you can do that if there is nothing in the array but this is for an array that is already populated with elements.

Make a wrapper class that does what you want and use it instead.

I understand thats the proper way. But like we are making fortnite maps you know? Why do I need to make a wrapper class and the most perfect failsafe editing of a single element to make my fortnite map that will likely not even be shown to more than 10 players a month? Like what if I just want to simply change the element in an array without making a wrapper class or a separate function? What if I’m someone that doesnt have a ton of programming experience then what? Theres not a ton of solutions yet to verse and having to rely on the AI to make a wrapper class seems unreliable. I find it would be easier to just hardcode in half this stuff than actually trying to make some expandable and decent code in the future.

There’s a reason why it is designed the way it is. If you want something to manage ugly details, then make a class to do that and give it a nice easy interface to use.

Arrays are immutable, however if you assign an array to a var the individual elements are mutable.

So, if you want to do this:

set CurrentFastestLaps[Index] = RunTime

As @Mineblo said, the proper way of doing it is like this:

if( set CurrentFastestLaps[Index] = RunTime ) {}

1 Like

^^^^^^^^^ This

I understand it is failable and needs to be within an if. But simply doing what you say do is not all that’s needed to be done. If it was then I wouldn’t need to do this. Instead I need to copy the array, change the value in the copy, and replace it.

image

And what does that red squiggly say?

Yeah Im just gonna delete the entire thread but thanks for the help I finally got it! This was just supposed to be meant as a joke and a little crazy of a post because the AI was giving me some unreasonable response and I dont understand the entire immutable thing but thanks for the help!!

(post deleted by author)