ID:261293
 
I'm using Deadron's character Handling and it works perfectly, but theres one problem. I cant make it so you start off in a certain place, unless I use coordinates, and if I use coordinates, I can only have one start off point, but I want tags for different classes or sexes and the other stuff. Can somone help me please?
If you name one tag "Start" and go and name another one "Start" also one will be overwritten you have to make every tag different and use something like this

src.loc=locate("tagname")
In response to Light
Yeah, I already knew about that, it's just that I can't have different mobs start off in different locations using Deadron's CHaracter Handling. I can do it if I dont use it, but then it wont save people.
In response to Philipe The Bard
Philipe The Bard wrote:
Yeah, I already knew about that, it's just that I can't have different mobs start off in different locations using Deadron's CHaracter Handling. I can do it if I dont use it, but then it wont save people.

You can have the mobs start off wherever you want. The library doesn't have anything to do with that.

In your mob's Login() proc, put the mob wherever you want.
In response to Deadron
I guess it's not the one I'm thinking of, but I can't find the one I used, but here's the parts that's messing me up.

new_mob.name = char_name

// Now switch the player
src.client.mob = new_mob
var/turf/first_location = locate(1, 1, 1)
new_mob.Move(first_location)
del(src)

When I get rid of the "var/turf/first_location..." part and the line under it, I dont get any errors. Then when the person picks their character, I put, src.loc = locate("Start"), but there's just a black screen.
In response to Philipe The Bard
Philipe The Bard wrote:
When I get rid of the "var/turf/first_location..." part and the line under it, I dont get any errors. Then when the person picks their character, I put, src.loc = locate("Start"), but there's just a black screen.

That's a problem with how you are using tags then, or where you are setting it.

What function do you put this code in?
In response to Deadron
WHat do you mean function? Do you need to see some coding?
In response to Philipe The Bard
Philipe The Bard wrote:
WHat do you mean function?

A function is another word for proc.


Do you need to see some coding?

The code where you are trying to move the character. In particular, what proc you are doing it in.
In response to Deadron
mob/creating_character
base_save_allowed = 0 // If player quits before choosing, don't want to save this mob.

Login()
// Spawn here to avoid problems with calling prompts during login.
spawn()
src.CreateCharacter()

proc/CreateCharacter()
// In this case, the code creates a /mob/human or /mob/ogre with the specified attributes.

// Get the character information from them. (You would probably want to do with this a browser page.)
var/prompt_title = "New Character"
var/help_text = "What is the name?"
var/char_name = input(src, help_text, prompt_title) as null|text

if (!char_name)
// Guess they don't want to create a new character after all, so send them to choose a character.
client.base_ChooseCharacter()
return

// Make sure there isn't already a character named that.
// Character names are stored as ckey, so get the ckey version of the name.
var/ckey_name = ckey(char_name)
var/list/characters = client.base_CharacterNames()
if (characters.Find(ckey_name))
alert("You already have a character named that! Please choose another name.")
src.CreateCharacter()
return

var/list/classes = list("Paladin","Wizard")
help_text = "Which class would you like to be?"
var/char_class = input(src, help_text, prompt_title) in classes

var/mob/new_mob
switch(char_class)
if ("Paladin")
icon = 'Paladin.dmi'
src.loc = locate("Church")
new_mob = new /mob/Paladin()

new_mob.name = char_name

// Now switch the player client over to the new mob and delete myself since I'm no longer needed.
src.client.mob = new_mob
var/turf/first_location = locate(1, 1, 1)
new_mob.Move(first_location)
del(src)

The problem are these lines
var/turf/first_location = locate(1, 1, 1)
new_mob.Move(first_location)
del(src)

Even with the tag set at "Church" When you pick the Paladin, you still start at the "first_location". When I get rid of those 3 lines, when the paladin logs in, it takes them to a black screen. And yes I realize that I dont have a switch for the Wizard, I just wanted to include stuff that would help. I left the comments in so if you didnt know what something did, you might get it from the comments.
In response to Philipe The Bard
This is the problem:

var/mob/new_mob
switch(char_class)
if ("Paladin")
icon = 'Paladin.dmi'
<font color=yellow>src.loc</font> = locate("Church")
new_mob = new /mob/Paladin()

You changed the loc of the creating_character mob, not of the new_mob you are going to put the player in. Try changing the new_mob loc.

In response to Deadron
Here's what I put
var/mob/new_mob
switch(char_class)
if ("Paladin")
icon = 'Paladin.dmi'
new_mob.loc= locate("Church")
new_mob =new /mob/Paladin()

Then I get this runtime error

runtime error: Cannot modify null.loc.
proc name: CreateCharacter (/mob/creating_character/proc/CreateCharacter)
source file: Login.dm,107
usr: Guest (/mob/creating_character)
src: Guest (/mob/creating_character)
call stack:
Guest (/mob/creating_character): CreateCharacter()
Guest (/mob/creating_character):
In response to Philipe The Bard
Philipe The Bard wrote:
Here's what I put
var/mob/new_mob
switch(char_class)
if ("Paladin")
icon = 'Paladin.dmi'
new_mob.loc= locate("Church")
new_mob =new /mob/Paladin()

Then I get this runtime error

runtime error: Cannot modify null.loc.

Look at the code you wrote carefully. Walk through it step by step. Here is what it does:

1: Move the new_mob to a location.
2: Create the new_mob.

See any problem with that?
In response to Deadron
Okay okay, I changed it to this;
var/mob/new_mob
switch(char_class)
if ("Paladin")
icon = 'Paladin.dmi'
new_mob =new /mob/Paladin()
new_mob.loc= locate("Church")

I was still transported to the "first_location" thing, then I got rid of that part. I didn't get any errors, but then I was still transported to a black screen when I logged in.
In response to Philipe The Bard
Your indentation is off. It's probably just in the forum, but I felt it was worth pointing out.
In response to Evilkevkev
Yes, I know that the indentatin was messed up. I thought that people would overlook that, and realize that if the indentation was like that in my coding, that I wouldnt be able to test out what I did.
In response to Philipe The Bard
This is the point of the <DM> tag..
In response to Philipe The Bard
Philipe The Bard wrote:
Okay okay, I changed it to this;
var/mob/new_mob
switch(char_class)
if ("Paladin")
icon = 'Paladin.dmi'
new_mob =new /mob/Paladin()
new_mob.loc= locate("Church")

I was still transported to the "first_location" thing, then I got rid of that part. I didn't get any errors, but then I was still transported to a black screen when I logged in.

Probably something to do with your mob.Login() or proc. You'll have to debug this one -- it has nothing to do with the library or demo, especially if you removed the new_mob.Move() statement from the demo.