Game Development Community

RealmWars map clycling

by Ace · in General Discussion · 03/24/2002 (9:17 am) · 8 replies

hey it works awesome when implimented in my demo,,,,what im wordering is there a way to only let it cycle when in multiplayer and not in singleplayer?

in singleplayer i need it to cycle only when contacting a trigger or somthing so the player has a chance to finish the level.

(im not that great with script)

thanks

#1
03/25/2002 (6:45 am)
ok heres a better explaination of what i need to do,,,,

this is in my game.cs:

// Game duration in secs, no limit if the duration is set to 0
$Game::Duration = 20 * 60
:::

i need something like this:
// Game duration in secs, no limit if the duration is set to 0
if (ML_multiplayer){
$Game::Duration = 20 * 60
}else{
$Game::Duration = 00 * 00
}

but im not sure if ML_multiplayer is the correct call to use ,and im not sure how to right it in script.

thanks.

[edit]hmmm this may have something to do with it:
// Start the game timer
if ($Game::Duration)
$Game::Schedule = schedule($Game::Duration * 1000, 0, "onGameDurationEnd" );
$Game::Running = true;
}

ill play with it [/edit]
#2
03/25/2002 (7:03 am)
If you look into startMissionGui, you see how the single-/multiplayer stuff is initialized:
if ($pref::HostMultiPlayer)
      %serverType = "MultiPlayer";
   else
      %serverType = "SinglePlayer";

   createServer(%serverType, %mission);
   localConnect($pref::Player::Name);
which means if the user selects the multiplayer checkbox, %serverType is set to "MultiPlayer"...
You could set your game duration here or just make the %serverType variable global ($serverType) and access it from your game.cs...
Does that help?
#3
03/25/2002 (7:33 am)
heh, ya , i noticed that and am still messing with it i tried (in game cs)

if ($pref::HostMultiPlayer) {
$Game::Duration = 05 * 05;
}else{
$Game::Duration = 00 * 00;
}

and it does do the
$Game::Duration = 05 * 05;

but has no effect on single player,,,im going to try

if ($pref::HostMultiPlayer)
%serverType = "MultiPlayer";
$Game::Duration = 05 * 05; //this is for devtesting
else
%serverType = "SinglePlayer";
$Game::Duration = 00 * 00;


in the startmission gui and see what happens

thanks
#4
03/25/2002 (7:52 am)
heh i just dont get it....but am still tring
#5
02/19/2004 (3:34 am)
Wouldnt a game cycle normally in multiplayer?
cycleGame();
#6
02/20/2004 (11:15 pm)
Old thread, dude. :)
#7
02/28/2004 (11:53 am)
Oh lol
#8
02/28/2004 (9:00 pm)
I have mine set up, so when a certain gametype is read from the mission file, it loads the corinspoding game play type, i ripped it out of realmwars, so it should work.