ID:267793
 
#include // Must Have Deadrons character handling im to lazy to code a whole login, but ill have one in the next version.
client/base_num_characters_allowed = 3
world
mob = /mob/create_character
mob/create_character
var/mob/character
Login()
NameStart
var/charactername = input("Please choose a name.","New Character",src.key)
if(!charactername)
src << "You are required to have a name."
goto NameStart
switch(input("Please choose a race.","New Character?") in list("Tea","Vec","Latu","Cor","Cenex"))
switch(input("Please choose a class.","New Character?") in list("Super","Hero","Warrior","Monster","Hydra","Griffon","W iz"))
if ("Tea")
character = new /mob/characters/tea()
if ("Vec")
character = new /mob/characters/vec()
if ("Latu")
character = new /mob/characters/latu()
if ("Cor")
character = new /mob/characters/cor()
if ("Cenex")
character = new /mob/characters/cenex()
character.name = charactername
src.client.mob = character
del(src)
..()

mob/characters/tea
icon='charas.dmi'
density = 1
mob/characters/vec
icon='charas.dmi'
density = 1
mob/characters/latu
icon='charas.dmi'
density = 1
mob/characters/cor
icon='charas.dmi'
density = 1
mob/characters/cenex
icon='charas.dmi'
density = 1


I do not know how to make it so that, well say they pick Latu than Hero, I want their stats to be different.

ex:

Hero: Str: 5 Spd: 3
Super: Spd: 6 Str: 2

Stuff like that, but I get this warning:

Login.dm:14::warning: empty switch statement

which isn't the problem I need to know how to seperate the races while the classes aswell.
Previous message, answer questions please.

How do you have a RolePlay command?

And I am working on an RP and I want it so when people log in they are sent to a room called Main and a command called enter and a list that comes up with home and some other rooms and they click on it and are redirected to that room. Also how can I have only people in that room hear each other. Also how can I set a limit for users per room, like 5 people allowed in each room.]

Thank You!!!!!!
In response to Shiba Arai
Shiba Arai wrote:
Previous message, answer questions please.

How do you have a RolePlay command?

What exactly do you mean by a "roleplay" command? Do you mean something like an emote?
And I am working on an RP and I want it so when people log in they are sent to a room called Main and a command called enter and a list that comes up with home and some other rooms and they click on it and are redirected to that room. Also how can I have only people in that room hear each other. Also how can I set a limit for users per room, like 5 people allowed in each room.]
Make a map and set client.view to -1. (I'm assuming this is text-only.) Also, be sure to make all directional functions (North(), South(), ect..) return instead of doing their default actions. In your enter command, check to see what rooms are adjacent (make rooms 1 tile on the map). When they try to move, do a:
var/players=0
for(var/mob/M in next_room)
players++
if(players>=5)
return 0

And to make people only hear those nearby, do this:
for(var/mob/M in loc)
M<<message


Thank You!!!!!!

No prob.
In response to Loduwijk
I don't want to make a map. Yes an emote command. I don't want anything to do with a map.
Something like this:

area
var/area
north_exit
south_exit
east_exit
west_exit

Entered()
usr << name
return ..()

Castle
Main_Gate
north_exit = .Castle_Entryway
south_exit = .Moat_Bridge
Castle_Entryway
south_exit = .Main_Gate
Moat_Bridge
north_exit = .Main_Gate
south_exit = .Village/Guard_Post
Village
Guard_Post
north_exit = .Castle/Moat_Bridge
south_exit = .Square
Square
north_exit = .Guard_Post

//handle movement
client/Move(Dest,Dir)
var/area/room = usr.loc
if(istype(room)) //in a room
switch(Dir)
if(NORTH) Dest = room.north_exit
if(SOUTH) Dest = room.south_exit
if(EAST) Dest = room.east_exit
if(WEST) Dest = room.west_exit
return ..()

//set the starting position for new logins
mob/Login()
if(!loc) Move(locate(/area/Castle/Main_Gate))
return ..()


except a command called enter instead of arrow directions. Also I do not like that, its a disfunctional code.
In response to Shiba Arai
To make an emote, simply do this:
mob/verb/emote(msg as text)
group_of_people<<"[name] [msg]"

As for the locations in your game, either you have to have a map or do some serious old-fasioned programming which would be more difficult and time consuming. If you really do not want a map then you need to change everything, like that Entered() you have there, to work totally different than you do. I have to go now and don't have the time, but tomarrow I will reply to this and write up a lengthy post about text games and not using the map. Something like you want to do.
In response to Loduwijk
Please help me on this subject. I simply need to know how to have a command called Enter which brings up a list that asks them what room to go to. Like in Chatters. That exact room. Also a command that only the host gets called start RP where they start the RPing and the users in that ceratin room cannot use the say command. Also if they are in the Home room, the host cannot use the start Rp command and users cannot use the RP command.

Hopefully that made snse and please help me, I am in need.
Thank you.

Also if the RP has already started in a room and some tries to join, they are denied and are kept in their current room.
In response to Shiba Arai
Oh. I have come to make the reply I promised, but I find this. Now what I think you want is not what I thought you wanted before. This will be much easier.
var/global/list/rooms=list()//list the room names here
world
New()
..()
for(var/room in global.rooms)
global.rooms[room]=list()
client
var/room
New()
..()
room=//put the name of the room you want them to start in when they join
global.rooms[room]+=mob
verb/Enter()
var/new_room=input("Enter which room?","Enter")in global.rooms
var/list/occupants=global.rooms[room]
if(occupants>5)
src<<"That room is full."
return
occupants<<"[key] has left this room."
occupants-=mob
room=new_room
occupants=global.rooms[room]
occupants+=mob
occupants<<"[key] has entered this room."
mob/verb/emote(msg as text)
occupants<<"[name] [msg]"

There is a quick example. I think you can get the idea from that.
In response to Loduwijk
mob/var
occupants
room


var/global/list/rooms=list()//list the room names here
world
New()
..()
for(var/room in global.rooms)
global.rooms[room]=list()
client
var/room
New()
..()
room="Main"
global.rooms[room]+=mob
verb/Enter()
var/new_room=input("Enter which room?","Enter")in global.rooms
var/list/occupants=global.rooms[room]
if(occupants>5)
src<<"That room is full."
return
occupants<<"[key] has left this room."
occupants-=mob
room=new_room
occupants=global.rooms[room]
occupants+=mob
occupants<<"[key] has entered this room."
mob/verb/emote(msg as text)
occupants<<"[name] [msg]"


Rooms.dm:11:error:room:undefined var

global.rooms[room]=list() (where error takes me)
In response to Shiba Arai
Shiba Arai wrote:

var/global/list/rooms=list()//list the room names here
world
New()
..()
for(var/room in global.rooms)
global.rooms[room]=list()

Rooms.dm:11:error:room:undefined var

global.rooms[room]=list() (where error takes me)

You need to indent that line in.
>     New()
> ..()
> for(var/room in global.rooms)
> global.rooms[room]=list()


[edit]
I see other things that will cause problems too. If that is because I did the same thing in my example, sorry. It was just some quick code typed up as an example to get you in the right direction, not for exact copying.

mob/var
occupants
room


var/global/list/rooms=list()//list the room names here
world
New()
..()
for(var/room in global.rooms)
global.rooms[room]=list()
client
var/room
New()
..()
room="Main"
global.rooms[room]+=mob
verb/Enter()
var/new_room=input("Enter which room?","Enter")in global.rooms
var/list/oldroom_occupants=global.rooms["[room]"]
var/list/newroom_occupants=global.rooms["[new_room]"]

if(new_occupants>5)
src<<"That room is full."
return
oldroom_occupants<<"[key] has left this room."
oldroom_occupants-=mob
room=new_room
newroom_occupants+=mob
newroom_occupants<<"[key] has entered this room."
mob/verb/emote(msg as text)
global.rooms["[client.room]"]<<"[name] [msg]"


There, that version should actually be copy/pastable.
In response to Loduwijk
I got all of that finished, now please help me on this:

#include <deadron/characterhandling> // Must Have Deadrons character handling im to lazy to code a whole login, but ill have one in the next version.
client/base_num_characters_allowed = 3
world
mob = /mob/create_character
mob/create_character
var/mob/character
Login()
NameStart
var/charactername = input("Please choose a name.","New Character",src.key)
if(!charactername)
src << "You are required to have a name."
goto NameStart
switch(input("Please choose a race.","New Character?") in list("Tea","Vec","Latu","Cor","Cenex"))
switch(input("Please choose a class.","New Character?") in list("Super","Hero","Warrior","Monster","Hydra","Griffon","W iz"))
if ("Tea")
character = new /mob/characters/tea()
if ("Vec")
character = new /mob/characters/vec()
if ("Latu")
character = new /mob/characters/latu()
if ("Cor")
character = new /mob/characters/cor()
if ("Cenex")
character = new /mob/characters/cenex()
character.name = charactername
src.client.mob = character
del(src)
..()

mob/characters/tea
icon='charas.dmi'
density = 1
mob/characters/vec
icon='charas.dmi'
density = 1
mob/characters/latu
icon='charas.dmi'
density = 1
mob/characters/cor
icon='charas.dmi'
density = 1
mob/characters/cenex
icon='charas.dmi'
density = 1


I do not know how to make it so that, well say they pick Latu than Hero, I want their stats to be different.

ex:

Hero: Str: 5 Spd: 3
Super: Spd: 6 Str: 2

Stuff like that, but I get this warning:

Login.dm:14::warning: empty switch statement

which isn't the problem I need to know how to seperate the races while the classes aswell.
In response to Shiba Arai
First of all, you are going to have problems with your room entering code since you seem to have copy/pasted my example just how I put it. It was only meant as an example, and was buggy since I just banged it out quick to get you on the right path. Since you used that exact code, you need to change it. Check out my reply before this one, I edited it with the fix.

Shiba Arai wrote:
switch(input("Please choose a race.","New Character?") in list("Tea","Vec","Latu","Cor","Cenex"))
switch(input("Please choose a class.","New Character?") in list

You get that error about the switch because of the class-selection switch there. You jump right into the next switch without having anything for the first one. If you mearly want to set the character's race without doing anything based on it, then do something like:

race=input("Please choose a race.","New Character?") in list("Tea","Vec","Latu","Cor","Cenex")

(Of coarse, you will need to define a race variable for the character if you have not allready done so.)
In response to Loduwijk
Edited:

#include <deadron/characterhandling> // Must Have Deadrons character handling im to lazy to code a whole login, but ill have one in the next version.
client/base_num_characters_allowed = 3
world
mob = /mob/create_character
mob/create_character
var/mob/character
Login()
NameStart
var/charactername = input("Please choose a name.","New Character",src.key)
if(!charactername)
src << "You are required to have a name."
goto NameStart
race=input("Please choose a race.","New Character?") in list("Gui")
race=input("Please choose a class.","New Character?") in list("Fighter")
if ("Gui")
character = new /mob/characters/gui()
character.name = charactername
src.client.mob = character
del(src)
..()

mob/characters/gui
icon='charas.dmi'
density = 1


Login.dm:14:error:list:undefined proc
Login.dm:15:error::invalid expression
In response to Shiba Arai
Shiba, you need to tell us where line 14 and 15 are, since you did not provide line numbers in the output
In response to digitalmouse
race=input("Please choose a class.","New Character?") in list("gui")
if ("gui")
In response to Shiba Arai
I said change the first switch to "race=input()". The second switch was fine. If you want to be able to keep track of the class as well in a variable, then make a variable called class and put class=input() for the class part instead of race=input().