Help understanding verse syntax on race w/ verse persistance template

Hello, can anyone help me understand these bits of code?

how can the function that returns void be returning a logic?

also, I was not aware that we could skip using the ‘return’ keyword as a shortcut but it is done a lot in this code; is there a reason for it?

In the next function I see how I would expect it to look, even with a skipped ‘return’ keyword : at least the return type is defined so I can understand how the function knows what to expect

though this entire syntax is unfamiliar to me for an if statement. seems like it is just a shortcut in syntax I’m not aware of?

when adding ‘return’ to both functions, the one with designated return type does fine, but the other throws an error, is this correct?

afaik function doesn’t need ‘return’ keyword if it’s last line is of expected return type

as for void returning function accepting logic instead, I think it’s because of the ‘decides’ thing which forces calling it in ‘if’ statement anyways

1 Like

also having difficulty understanding this bit here; it says it returns an integer, but the only call in the function is Left < Right

That sounds like a boolean check to me? this code is all written so much different than anything else I’ve seen lol

edit : ah well maybe for a later day in the year , thanks for the help :slight_smile:

Hi.
The inequality in the “decides” function acts like an exception checker.

FuncA(arg1:int)<decides><transacts>:void = 
    arg1 > 0

If “arg1 > 0” is true, nothing happens.
If “arg1 > 0” is false, the function fails (like an exception call).

2 Likes

ah awesome thanks :smiley:

1 Like

With greater than / less than expressions, if it doesn’t fail the value on the left is returned :+1:

2 Likes

that was exactly my next question :smiley: thanks so much for the addition!

1 Like

oh goodness, with 30.30 came documentation updates and I am astounded at how detailed and awesome they are. Bravo and thanks so much !!! These are so amazing.

and

1 Like

I have another question regarding the template if anyone is able to help :smiley:

I was able to successfully implement the template and created the island Dusty Diner Dirtbike Dash. I am really thrilled with the quality of this template, and how everything worked so well right out of the box.

The only thing I can’t get to work is skipping the lobby visit on any round after the first - it doesn’t detract from gameplay, and in fact I think I want to ensure that this is how it happens, but in the code it is mentioned that if it isn’t the first round, the lobby visit should skip directly to the starting cinematic.


However, my racers always respawn in the lobby at the start of the round and the pre-game timer sequence is initiated. I am not worried about it because I think it provides a little breathing room between races, but am curious if it is working correctly for others.

Thanks again!
Cheers

Well nevermind, it appears that in my most recent release it is working correctly :sweat_smile: I don’t think I changed anything… So maybe it was a problem with private vs published version? Thanks though

seems that there are differences. in my game when trying to end it, it quits to editor but when testing it on private island nothing really happens

1 Like