Solved Prevent the game from starting with just one player

Question that is answered or resolved.

kdo

Member
Hello guys! Some time ago I found a post that said something about preventing the game from starting if there is only one player on the character selection screen. I searched the forum several times but didn't find anything about this post.
So I would like to know how I can make the game start leaving the character selection screen only if a second player or more players also choose a character?
If there is only player 1, even if he chooses the character the game does not start until more players enter and choose their characters.
 
Solution
Its similar to a fighting game versus mode that needs one more player to start the game. In this case the player 2 , 3 or 4 or even them all.
@kdo I don't know exactly if it will fit your game, but in this case the key is to lock the "anim select" before it ends, since it controls the select screen duration and the "ready" message.
I coded a simple example using animation scripts.


Code:
void playerCheck(int playerAmount, int loopFrame){

    if(openborvariant("count_players") <= playerAmount)
    {
        updateframe(getlocalvar("self"), loopFrame);
    }
}

Code:
anim select
    loop    0
    delay    16
    offset    38 117
    bbox    20 0 53 119
    frame    data/chars/maxima/idle000.gif
    frame...
This could actually get a little complex. There may be a better way after some thinking, but off the top of my head, I would check for an entity attached to the number of required players. If that requirement is not met, then I would disable the action keys (set the key value to 0) for other player.

DC
 
Hello guys! Some time ago I found a post that said something about preventing the game from starting if there is only one player on the character selection screen. I searched the forum several times but didn't find anything about this post.
So I would like to know how I can make the game start leaving the character selection screen only if a second player or more players also choose a character?
If there is only player 1, even if he chooses the character the game does not start until more players enter and choose their characters.
Are you referring to this one?


Or are you referring to having more than one player joining at the same in the beginning of the select screen?
 
The ideia is if just have one player even he choose the character in select screen the game dont starts,its stucks in select screen, as it waiting for more players join, so if a escond player or more players join and select his chraracters so the game goes to the level as a well.
 
Its similar to a fighting game versus mode that needs one more player to start the game. In this case the player 2 , 3 or 4 or even them all.
 
Its similar to a fighting game versus mode that needs one more player to start the game. In this case the player 2 , 3 or 4 or even them all.
@kdo I don't know exactly if it will fit your game, but in this case the key is to lock the "anim select" before it ends, since it controls the select screen duration and the "ready" message.
I coded a simple example using animation scripts.


Code:
void playerCheck(int playerAmount, int loopFrame){

    if(openborvariant("count_players") <= playerAmount)
    {
        updateframe(getlocalvar("self"), loopFrame);
    }
}

Code:
anim select
    loop    0
    delay    16
    offset    38 117
    bbox    20 0 53 119
    frame    data/chars/maxima/idle000.gif
    frame    data/chars/maxima/idle001.gif
    frame    data/chars/maxima/idle002.gif
    frame    data/chars/maxima/idle003.gif
    frame    data/chars/maxima/idle004.gif
    frame    data/chars/maxima/idle005.gif
    frame    data/chars/maxima/idle006.gif
    frame    data/chars/maxima/idle007.gif
    frame    data/chars/maxima/idle008.gif
    frame    data/chars/maxima/idle009.gif
    @cmd playerCheck 1 0
    frame    data/chars/maxima/idle009.gif
    frame    data/chars/maxima/idle009.gif
 
Solution
@kdo I don't know exactly if it will fit your game, but in this case the key is to lock the "anim select" before it ends, since it controls the select screen duration and the "ready" message.
I coded a simple example using animation scripts.


Code:
void playerCheck(int playerAmount, int loopFrame){

    if(openborvariant("count_players") <= playerAmount)
    {
        updateframe(getlocalvar("self"), loopFrame);
    }
}

Code:
anim select
    loop    0
    delay    16
    offset    38 117
    bbox    20 0 53 119
    frame    data/chars/maxima/idle000.gif
    frame    data/chars/maxima/idle001.gif
    frame    data/chars/maxima/idle002.gif
    frame    data/chars/maxima/idle003.gif
    frame    data/chars/maxima/idle004.gif
    frame    data/chars/maxima/idle005.gif
    frame    data/chars/maxima/idle006.gif
    frame    data/chars/maxima/idle007.gif
    frame    data/chars/maxima/idle008.gif
    frame    data/chars/maxima/idle009.gif
    @cmd playerCheck 1 0
    frame    data/chars/maxima/idle009.gif
    frame    data/chars/maxima/idle009.gif

Giving this an upvote. Good solution @Kratus.

DC
 
Back
Top Bottom