dim3 Forum

Full Version: Multiplayer game time limit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I make a multiplayer game have a time limit and goes to the next map when the time limit is up.

I tried this:
Code:
function gameConstruct(game,obj)
{
        // set the scaling factor for the bitmaps
    
    iface.screen.widthScale=640;
    iface.screen.heightScale=480;
    
        // if not a network game, then set start map and
        // position, otherwise get that info from the host
        
    if (!map.setting.multiplayer)
        map.action.setMap('Training course','Start','Player');
    else
        map.action.setHostMap();
    
    game.event.chain(50,'loadNewMap');
}

function loadNewMap(game)
{

map.action.setMap('Towers','Start','Player');

}

It says setMap is illegal for Client games.
Sam Shiels Wrote:How can I make a multiplayer game have a time limit and goes to the next map when the time limit is up.

I tried this:
Code:
function gameConstruct(game,obj)
{
        // set the scaling factor for the bitmaps
    
    iface.screen.widthScale=640;
    iface.screen.heightScale=480;
    
        // if not a network game, then set start map and
        // position, otherwise get that info from the host
        
    if (!map.setting.multiplayer)
        map.action.setMap('Training course','Start','Player');
    else
        map.action.setHostMap();
    
    game.event.chain(50,'loadNewMap');
}

function loadNewMap(game)
{

map.action.setMap('Towers','Start','Player');

}

It says setMap is illegal for Client games.

There's no way to do this right now, it'd have to be coded on the server. I can add that.

[>] Brian
Code:
function gameConstruct(game,obj)
{
        // set the scaling factor for the bitmaps
    
    iface.screen.widthScale=640;
    iface.screen.heightScale=480;
    
        // if not a network game, then set start map and
        // position, otherwise get that info from the host
        
    if (!map.setting.multiplayer)
        map.action.setMap('Training course','Start','Player');
    else
        map.action.setHostMap();

        game.event.chain(50,'gameOver');
}

function loadNewMap(game,obj)
{

map.action.setHostMap();
iface.bitmap.hide('Game Over');
game.event.chain(50,'gameOver');
}

function gameOver(game,obj)
{
iface.bitmap.show('Game Over');
game.event.chain(70,'restart');
}

function restart(game,obj)
{
map.action.setHostMap();
game.event.chain(50,'gameOver');
iface.bitmap.hide('Game Over');
}

I've done that for now (it just loads the host map every now and then).

I'm wondering if people that join late would that timer start over for the late joiner?

One more thing: Is it possible to make a maximum score in multiplayer, so the person to get to 25 points wins then the match restarts?
Sam Shiels Wrote:I've done that for now (it just loads the host map every now and then).

I'm wondering if people that join late would that timer start over for the late joiner?

That code above (as you noted) could cause a bunch of synch problems as it'll happen on the client without server interaction.

Sam Shiels Wrote:One more thing: Is it possible to make a maximum score in multiplayer, so the person to get to 25 points wins then the match restarts?

No, that's also a good idea, though, and that should be in server too.

[>] Brian
Can you PLEASE do that? Thanks for the help.
Reference URL's