ID:178344
 
I have another problem once again with my pet thingy. This time it is very important towards my game though. I want it so that after the CreateCharacter() proc is done it does my PetCreation() proc. Both procs work just how they should but there is still a problem that I have no clue how to fix. It is the fact the CreateCharacter() proc is the only one it does and even if I take out the CreateCharacter() proc and only use the PetCreation(0 proc, it make the usr be the pet you choose. So I guess I have a couple problems.
1)Both procs aren't used if they are both in.
2)The PetCreation() proc makes the usr be the pet.

All I need to know is how I can make it so that you can do both of them and it won't make you the pet but you will still get the pet and you will be the mob yo choose.

Heres my code:

mob/creating_character


Login()
// Spawn here to avoid problems with calling prompts during login.
spawn()
src.CreateCharacter()
usr << alert("It can get lonely out there on that farm all by yourself, so how about a pet?")
src.PetCreation()

proc/CreateCharacter()

var/prompt_title = "New Character"
var/help_text = "What do you want to name the character?"
var/default_value = key
var/char_name = input(src, help_text, prompt_title, default_value) as null|text

if (!char_name)

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/races = list("Guy","other guy")
help_text = "Choose your gender"
default_value = "Guy"
var/char_race = input(src, help_text, prompt_title, default_value) in races

var/mob/new_mob



// Okay we have enough information, so it's time to create the character and switch the player to it.

switch(char_race)
if ("Guy")
new_mob = new /mob/PC/Vegeta()


// Set the attributes.
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,2,1)
new_mob.Move(first_location)
del(src)


proc/PetCreation()
var/mob/pet/new_pet
var/pet_create = input("So do you want a pet or not? Just give me a yah or nay.","Pete's Pet Shop") in list("Yah","Nay")
switch(pet_create)
if("Nay")
return
if("Yah")
var/choose_pet = input("ok. So which kind of pet do you want?","Pete's Pet Shop") in list("Bunny","Dog")
switch(choose_pet)
if("Bunny")
var/bcolor = input("We have differnt colors for the Bunny. Which one would you like?","Pete's Pet Shop") in list("Black Bunny","White Bunny")
switch(bcolor)
if("Black Bunny")
var/pname = input("Now you get to name your pet!","Pete's Pet Shop")
new_pet = new /mob/pet/bunny/black(locate(7,6,1))
new_pet.name = pname
src.client.mob/pet = new_pet

I know it is long but I will REALLY appreciate anyone who sincerely helps me.

-Little Kid
hrmm...I think you need to put the
>           usr << alert("It can get lonely out there on that farm all by yourself without a bitch to fuck, so how about a pet for a nice alternative?")
> src.PetCreation()

>

part at the bottom of your CharacterCreation proc...if not tell me


usr << alert("It can get lonely out there on that farm all by yourself without a bitch to fuck, so how about a pet for a nice alternative?")

If you're going to put crap like this in your game, that's your business... but keep it off the forum. I will never, ever try to help you with coding again... but if you need help finding traffic to play in, give me a page.
It's not your code that needs fixing...
In response to Foomer
Foomer wrote:
It's not your code that needs fixing...

My bad, I forgot all about that. I had to put something in it, I was bored and I had just watched Jay and Silent Strike Back before that, so thats what I did.

and anyways the content that is in it is not what matters, is the simple fact that I need help.
In response to LittleKid15
LittleKid15 wrote:
Foomer wrote:
It's not your code that needs fixing...

My bad, I forgot all about that. I had to put something in it, I was bored and I had just watched Jay and Silent Strike Back before that, so thats what I did.

and anyways the content that is in it is not what matters, is the simple fact that I need help.

The content matters in that people are less likely to help someone make a game if they're bothered by something in the game. At least instead of sitting here and arguing, you've admitted that it was bad... I'll tell you how to fix your other problem now. Please use the edit button on your post to take out the bad language.
In response to Emperor Beld
Emperor Beld wrote:
hrmm...I think you need to put the
> >             usr << alert("It can get lonely out there on that farm all by yourself without a bitch to fuck, so how about a pet for a nice alternative?")
> > src.PetCreation()
>
> >
>

part at the bottom of your CharacterCreation proc...if not tell me


No, I'll tell him where he needs to put it...
In response to Lesbian Assassin
Lesbian Assassin wrote:

The content matters in that people are less likely to help someone make a game if they're bothered by something in the game. At least instead of sitting here and arguing, you've admitted that it was bad... I'll tell you how to fix your other problem now. Please use the edit button on your post to take out the bad language.


There you go, I took it out and I am sorry for all of you who seem to have a problem with it. Oh yea! I REALLY need my other post answered too if any one of you who read this would take it into cosideration, I would appreciate that.

Thanx,
Little Kid

You are expecting CreateCharacter() to return, but since the user switches to another mob inside there, you've got to do the next step (the pet) in a proc on the other mob. Another strategy would be to do it all in a client proc, which you could call from your mob/Login() proc. That way, the "src" variable would not get deleted when the user switches mobs.

In response to Dan
Dan wrote:
You are expecting CreateCharacter() to return, but since the user switches to another mob inside there, you've got to do the next step (the pet) in a proc on the other mob. Another strategy would be to do it all in a client proc, which you could call from your mob/Login() proc. That way, the "src" variable would not get deleted when the user switches mobs.

I have no clue what that means. I think a example may be a little better. or put it in words that may make it easier for me.