1 (edited by andres 2022-06-27 07:21:04)

Topic: SelectCharacter is the same as GoToMainMenu?

So, I've been adapting the engine to our fighting game (I've said it many times: one of best assets out there). And now that I'm including the online pvp feature I've come across something.
The character selection callback is:

this.TrySelectCharacter(characterIndex, UFE.GetLocalPlayer());

Which points to this function:

UFE.fluxCapacitor.RequestOptionSelection(localPlayer, (sbyte)characterIndex);

That works and is something I still haven't managed to understand, but also have managed to make it work (sort of) with our screen flow. So far, so good.
Now, since I get some weird interferences from other players while in online games I've figured out that I'm not doing things right when disconnecting/finishing online games. One of the responses I got when calling for help was "check the example scenes" which seems the most sensible thing to do. So I did. I searched for the moment in which the online game "ends". Still haven't found the correct way to finish an online pvp game, but I have come across this weird thing. The "Go to Main Menu" button has this callback:

public virtual void GoToMainMenu()
        {
            this.TrySelectOption((int)OnlineModeAfterBattleScreen.Option.MainMenu, UFE.GetLocalPlayer(), true);
        }

Well, this TrySelectOption seems similar to the TrySelectCharacter code... Let's check it's code for the online mode:

UFE.fluxCapacitor.RequestOptionSelection(player, (sbyte)option);

What?
It... does the same thing for selecting a character and changing menus?

public virtual void RequestOptionSelection(int player, sbyte option){
        if (player == 1 || player == 2){
            this._selectedOptions[player-1] = option;
        }
    }

So, I'm guessing this is not the part that checks for the end of the online game (you know, the proper way of "closing" the online search and stuff). Where can we find the part that finishes all the online functions?

EDIT: I've found this:

protected void OpenMenuAfterBattle()

The only thing related to end the online mode is UFE.EnsureNetworkDisconnection();

Share

Thumbs up Thumbs down

Re: SelectCharacter is the same as GoToMainMenu?

So... anything on this?
I'm having a ton of problems with deselecting characters after each online game and I can't see how using the same array works. Also code is not fully documented (at least at the spots that I believe are useful to me, other parts are fine).
Is there any place where I can see which option to set to, let's say, change the stage (or the background) using the RequestOptionSelection or... well, anything else?

Share

Thumbs up Thumbs down