mob/Login()
src.icon='player.dmi'
src<<'Iced Earth.ogg'
src.addname("[src.key]")
src.icon_state="default"
src.loc=locate(7,9,1)
maxplayers += 1
if(maxplayers < 8)
spawn(5){usr<<("Welcome to The Floor Is Always Lava!");}
world <<"[usr] has joined the game!"
else
if(maxplayers >= 8)
src<<("This server is full. Go find another homie.")
del usr
Problem description: There's the login code, but I'm trying to figure out a way the host can choose a map before starting the actual game. Currently there's only two playable levels in the game at the moment.
When the host boots up the game I want him to choose the map, and then once chosen that's where the players will spawn, etc. However, at the end of every round the host can choose if he wants to change the level.
Here's the current host based code.
var/game_started=0
world/New()
{
..();
spawn()
{
do
{
sleep(10);
}
while(players<8&&!game_started);
}
if(game_started){return;}
world<<"Starting the game in 30 seconds!";
spawn(300) //number / 10 = seconds.
{
if(game_started){return;}
world<<"Beginning game!";
spawn(){generateLava(locate(8,8,1), 10);}
}
}
mob
{
host
{
verb
{
Start_Game()
{
if(game_started){return;}
game_started=1
world<<"Game starting in 5 seconds!";
spawn(50)
spawn(){generateLava(locate(8,8,1), 10);} //HERE IS WHERE YOU ALTER THE CODE!
}
}
}
}
client
{
New()
{
..();
if(address==world.address||!address)
{
src.mob.verbs+=new/mob/host/verb/Start_Game;
}
}
}
var/players
var/center
var/radius
I'd be eternally grateful if someone could help me out.
Also, did you know you can add procs as verbs as well?
So instead of
As far as choosing a map goes, I'd use a global list of maps and pick from that. Allowing the host to change maps at the end of the round is pretty much the same deal. Maybe something like this.