ID:266254
 
I have tried time and time again to set the usr to /mob/human, but the verb for human doesn't show up, Why? I have tried this:

usr = new /mob/human
usr = /mob/human
Those ^^^ don't give me errors, but these v do.
usr.mob=/mob/human
usr.mob = new /mob/human

I also have tried making a var thingy:
var/mob/mobrace
mobrace= new /mob/human
It doesn't work either! HELP!!!
VERY puzzled and confused,
Air _King
What exactly are you trying to do?
In response to Sariat
Sariat wrote:
What exactly are you trying to do?

Set the user's type to /mob/human
In response to Air _King
Try setting usr.client.mob instead of usr.mob or whatever your doing

Alathon
In response to Alathon
Alathon wrote:
Try setting usr.client.mob instead of usr.mob or whatever your doing

Alathon

Ok this keeps reseting the login menu:
usr.client.mob = new /mob/human
It changes them to /mob/human though.
And this makes the statpanel not show up and doesn't set their type to /mob/human
usr.client.mob = /mob/human
In response to Air _King
Air _King wrote:
Ok this keeps reseting the login menu:
usr.client.mob = new /mob/human

That's because mob Login() is called each time you connect a client to a mob. You should either make it so that only the sign in mob's Login() proc allows selections, or place it in client/New() so it only happens when the client connects to the game.
In response to Air _King
Air _King wrote:
Alathon wrote:
Try setting usr.client.mob instead of usr.mob or whatever your doing

Alathon

Ok this keeps reseting the login menu:
usr.client.mob = new /mob/human
It changes them to /mob/human though.
And this makes the statpanel not show up and doesn't set their type to /mob/human
usr.client.mob = /mob/human


That has something to do with your Login() code, I have no idea what that is, so I cant help you there.

When you switch a clients mob, it calls mob.Login(), and the old_mobs.Logout()

Alathon
In response to Shadowdarke
Shadowdarke wrote:
Air _King wrote:
Ok this keeps reseting the login menu:
usr.client.mob = new /mob/human

That's because mob Login() is called each time you connect a client to a mob. You should either make it so that only the sign in mob's Login() proc allows selections, or place it in client/New() so it only happens when the client connects to the game.

Ok, but how would I add my Login Menu into the game? Should I post my code for the login?
In response to Air _King
Air _King wrote:
Shadowdarke wrote:
Air _King wrote:
Ok this keeps reseting the login menu:
usr.client.mob = new /mob/human

That's because mob Login() is called each time you connect a client to a mob. You should either make it so that only the sign in mob's Login() proc allows selections, or place it in client/New() so it only happens when the client connects to the game.

Ok, but how would I add my Login Menu into the game? Should I post my code for the login?

Also I have tried:

var/mob/mobrace
mobrace= new /mob/human
In response to Air _King
yes post your Login() code and maybe its beacause you done have a selection menu here is what you do:mob
Login() // this is what happens when somone logs into your game.
var/race = input("Welcome to Knights n'Wizards who do you want to be?") in list ("Wizard","Knight","Mage") // var/race means that you are making a new variable called "race". input means that you are asking your user for somthing. in list gives them the choice of what to be.
switch(race) // this makes it so that, depending on what they chose for "race", somthing happens.
if("Wizard") // If it's a dragon, you set their icon to dragon. Of course, you would need a dragon icon to do this.
icon='Wizard.dmi'
if("Mage") // same here, look above.
icon='Mage.dmi'
if("Knight") // and, the same thing here.
icon='Knight.dmi'
In response to Air _King
Air _King wrote:
Shadowdarke wrote:
That's because mob Login() is called each time you connect a client to a mob. You should either make it so that only the sign in mob's Login() proc allows selections, or place it in client/New() so it only happens when the client connects to the game.

Ok, but how would I add my Login Menu into the game? Should I post my code for the login?

I just told you, "You should either make it so that only the sign in mob's Login() proc allows selections, or place it in client/New() so it only happens when the client connects to the game."

To affect only the sign in mob's Login() proc, you put your menu in Login() under the sign in mob. For example:

world
mob = /mob/signin
// makes /mob/signin the default mob that every client will connect to when they log in IF there isn't already a mob assigned to thier key.

mob
signin
//any declarations you need
Login()
// this Login() proc belongs to signin mobs, but won't affect any mobs derived from the base mob class.
// your menu goes here

In response to Vegetto5748
Vegetto5748 wrote:
yes post your Login() code and maybe its beacause you done have a selection menu here is what you do:mob
Login() // this is what happens when somone logs into your game.
var/race = input("Welcome to Knights n'Wizards who do you want to be?") in list ("Wizard","Knight","Mage") // var/race means that you are making a new variable called "race". input means that you are asking your user for somthing. in list gives them the choice of what to be.
switch(race) // this makes it so that, depending on what they chose for "race", somthing happens.
if("Wizard") // If it's a dragon, you set their icon to dragon. Of course, you would need a dragon icon to do this.
icon='Wizard.dmi'
if("Mage") // same here, look above.
icon='Mage.dmi'
if("Knight") // and, the same thing here.
icon='Knight.dmi'


Heres the code:

mob
Login()
switch(input("Hi Welcome to THE REALMS!","Menu")in list("Create New Character","Continue A Quest","Quit"))
if("Create New Character")
usr.name=input("What is your characters name","Name",usr.name)
switch(input("What is your class?","Class")in list("Fighter","Mage","Wizard","Rouge","Bard","Paladin","Ran ger","Monk","Barbarian","Cleric","Druid"))
if("Fighter")
usr.Class="Fighter"
MP=0
MaxMP=0
HP=10
MaxHP=10
if("Mage")
usr.Class="Mage"
MP=25
MaxMP=25
HP=4
MaxHP=4
usr.verbs+=/proc/Magic_Missile
if("Wizard")
usr.Class="Wizard"
MP=25
MaxMP=25
HP=4
MaxHP=4
if("Rouge")
usr.Class="Rouge"
HP=6
MaxHP=6
MP=0
MaxMP=0
if("Bard")
usr.Class="Bard"
HP=6
MaxHP=6
MP=10
MaxMP=10
if("Paladin")
usr.Class="Paladin"
HP=10
MaxHP=10
MP=5
MaxMP=5
if("Ranger")
usr.Class="Ranger"
HP=10
MaxHP=10
MP=0
MaxMP=0
if("Monk")
usr.Class="Monk"
HP=8
MaxHP=8
MP=0
MaxMP=0
if("Barbarian")
usr.Class="Barbarian"
HP=12
MaxHP=12
MP=0
MaxMP=0
if("Cleric")
usr.Class="Cleric"
HP=8
MaxHP=8
MP=15
MaxMP=15
if("Druid")
usr.Class="Druid"
HP=8
MaxHP=8
MP=15
MaxMP=15
switch(input("What is your race?","Race")in list("Human","Elf","Half Elf","Dwarf","Gnome","Half Orc","Halfling"))
if("Human")
usr.loc=locate(1,1,1)
usr.client.mob = /mob/human
Strength=roll(3,6)
Wisdom=roll(3,6)
Dexterity=roll(3,6)
Constitution=roll(3,6)
Intelligence=roll(3,6)
Charisma=roll(3,6)
Race="Human"
Experience=0
MaxExperience=100
Level=1
AC=10
if("Elf")
usr.loc=locate(1,1,2)
usr=new/mob/elf
Strength=roll(3,6)
Wisdom=roll(3,6)
Dexterity=roll(3,6)+2
Constitution=roll(3,6)-2
Intelligence=roll(3,6)
Charisma=roll(3,6)
Race="Elf"
Experience=0
MaxExperience=100
Level=1
AC=10
if("Half Elf")
usr.loc=locate(1,1,2)
usr=new/mob/half_elf
Strength=roll(3,6)
Wisdom=roll(3,6)
Dexterity=roll(3,6)
Constitution=roll(3,6)
Intelligence=roll(3,6)
Charisma=roll(3,6)
Race="Half Elf"
Experience=0
MaxExperience=100
Level=1
AC=10
if("Dwarf")
usr.loc=locate(1,1,3)
usr=new/mob/dwarf
Strength=roll(3,6)
Wisdom=roll(3,6)
Dexterity=roll(3,6)
Constitution=roll(3,6)+2
Intelligence=roll(3,6)
Charisma=roll(3,6)-2
Race="Dwarf"
Experience=0
MaxExperience=100
Level=1
AC=10
if("Gnome")
usr.loc=locate(1,1,4)
usr=new/mob/gnome
Strength=roll(3,6)-2
Wisdom=roll(3,6)
Dexterity=roll(3,6)
Constitution=roll(3,6)+2
Intelligence=roll(3,6)
Charisma=roll(3,6)
Race="Gnome"
Experience=0
MaxExperience=100
Level=1
AC=11
if("Half Orc")
usr.loc=locate(1,1,5)
usr=new/mob/half_orc
Strength=roll(3,6)+2
Wisdom=roll(3,6)
Dexterity=roll(3,6)
Constitution=roll(3,6)
Intelligence=roll(3,6)
Charisma=roll(3,6)-2
Race="Half Orc"
Experience=0
MaxExperience=100
Level=1
AC=10
spawn()orcintcheck()
if("Halfling")
usr.loc=locate(1,1,6)
usr=new/mob/halfling
Strength=roll(3,6)-2
Wisdom=roll(3,6)
Dexterity=roll(3,6)+2
Constitution=roll(3,6)
Intelligence=roll(3,6)
Charisma=roll(3,6)
Race="Halfling"
Experience=0
MaxExperience=100
Level=1
AC=11
if("Continue A Quest")
var/savefile/F = new(usr.name)
Read(F)
if("Quit")
Logout()
return ..()

src.realname=src.name
.=..()
In response to Shadowdarke
Shadowdarke wrote:
Air _King wrote:
Shadowdarke wrote:
That's because mob Login() is called each time you connect a client to a mob. You should either make it so that only the sign in mob's Login() proc allows selections, or place it in client/New() so it only happens when the client connects to the game.

Ok, but how would I add my Login Menu into the game? Should I post my code for the login?

I just told you, "You should either make it so that only the sign in mob's Login() proc allows selections, or place it in client/New() so it only happens when the client connects to the game."

To affect only the sign in mob's Login() proc, you put your menu in Login() under the sign in mob. For example:

world
mob = /mob/signin
// makes /mob/signin the default mob that every client will connect to when they log in IF there isn't already a mob assigned to thier key.

mob
signin
//any declarations you need
Login()
// this Login() proc belongs to signin mobs, but won't affect any mobs derived from the base mob class.
// your menu goes here

Ok i did this:

world
mob=/mob/mobc
mob/mobc
Login()
It logs them in fine, but their stats that I set in the login are gone.
In response to Air _King
that is mainly all correct but the dm wont be able to identify it because you need to include an icon='w/e.dmi' or the computer will put a blank icon onto the screen so, under ur indivdual race stats put an icon='whatever.dmi'

~Vegetto5748
In response to Vegetto5748
Vegetto5748 wrote:
that is mainly all correct but the dm wont be able to identify it because you need to include an icon='w/e.dmi' or the computer will put a blank icon onto the screen so, under ur indivdual race stats put an icon='whatever.dmi'

~Vegetto5748

Im leaving out the icons for now, but it doesn't switch their mob to /mob/human.
In response to Air _King
One crucial point that you seem to be missing throughout this thread:

The login proc that is being run when the player connects to the game belongs to a certain mob. This is an instance of the default mob, also known as world.mob, that is created when the player does connect. If you tell the computer to change this mob's client.mob to a new mob, all of a sudden, instead of one mob, we have two mobs. You've just done a bunch of attribute initialization on the one mob, and now you've created a second mob.

As far as

mob = /mob/human

if you knew your basics, you would know this is always wrong notation. But then, if you knew your basics, you would be able to look at this problem, think logically about what's happening, and come up with a solution, instead of just trying things that "look right".
In response to Air _King
Air _King wrote:

It logs them in fine, but their stats that I set in the login are gone.

That's because the code you have for modifying the attributes modify the attributes of the sign in mob while doing absolutely nothing to the new mob you just created.

Let me try to explain:
You join the game and connect to a sign in mob. We'll call him Mob A.
You choose Mob A's class.
The code assigns Mob A's heealth and magic points.
You choose a race.
You move Mob A someplace.
You create a new mob of race type for the player. We'll call him Mob B.
You assign race, stats, exp, and all those goodies to Mob A.

MobA is now ready to play. Too bad the player is connected to Mob B, who is a bare bones mob of it's type. Mob B gets none of the values you generated. Indeed, some of the values are decided before Mob B was even created.


Looking over your code, I don't see why you are even using a new mob. Most likely you saw someone else's code that did it and figured you needed it without understanding why.

You should really work on small projects until you learn how to use the language.
In response to LexyBitch
LexyBitch wrote:
One crucial point that you seem to be missing throughout this thread:

The login proc that is being run when the player connects to the game belongs to a certain mob. This is an instance of the default mob, also known as world.mob, that is created when the player does connect. If you tell the computer to change this mob's client.mob to a new mob, all of a sudden, instead of one mob, we have two mobs. You've just done a bunch of attribute initialization on the one mob, and now you've created a second mob.

As far as

mob = /mob/human

if you knew your basics, you would know this is always wrong notation. But then, if you knew your basics, you would be able to look at this problem, think logically about what's happening, and come up with a solution, instead of just trying things that "look right".

Ok, I will just use vars instead of if(istype Blah) i will use if(usr.race=="Human")blah. I will use that until i can figure it out or you will help me out.
In response to Air _King
Air _King wrote:
LexyBitch wrote:
One crucial point that you seem to be missing throughout this thread:

The login proc that is being run when the player connects to the game belongs to a certain mob. This is an instance of the default mob, also known as world.mob, that is created when the player does connect. If you tell the computer to change this mob's client.mob to a new mob, all of a sudden, instead of one mob, we have two mobs. You've just done a bunch of attribute initialization on the one mob, and now you've created a second mob.

As far as

mob = /mob/human

if you knew your basics, you would know this is always wrong notation. But then, if you knew your basics, you would be able to look at this problem, think logically about what's happening, and come up with a solution, instead of just trying things that "look right".

Ok, I will just use vars instead of if(istype Blah) i will use if(usr.race=="Human")blah. I will use that until i can figure it out or you will help me out.


Actually they already helped you out with everything you need to know.