Using Verse to change teams through UI.

We are looking to use verse and the Class and Team Selector to create a UI that will allow our players to choose their team, and then their class.

After making it through the UI tutorial, I’m looking to add the Class and Team Selector device to the UI button created in the tutorial.

My roadblock is coming at the point where I need to call “Change Team”. I’ve attached the .verse file below.


VS_UI_AddingAWidget.verse (2.5 KB)

agent type is also a player type so you should be able to just pass the player:
Team2.ChangeTeam(Message.Player)

Nice, thank you. OK next question. Can you please explain why? I’m still working on wrapping my head around these concepts.

Also, trying this now to see if it works. Update to come.

You can ctrl-click on Verse types (at least in VS Code you can) and it will bring up the digest showing the Verse API.

Screenshot (45)

This shows that the player type derives or is based from the agent type.

2 Likes

THAT IS AN AMAZING TRICK! Love the ctrl+click trick.

Got it up and working. Check out this link to see it in action.

and .verse file prototype
VS_UI_AddingAWidget.verse (2.8 KB)

1 Like