mob/var
PetStorage1 = 0
mob
NPC
PetStorage
icon = 'NPC.dmi'
icon_state = "PetStorage"
Click()
if(src in oview(1))
if(usr.action)
return
else
usr.action = 1
if(usr.move == 0)
usr.action=0
return
else
usr.move = 0
var/R = input("What do you want to do","[src]")in list("Freeze","Revive","Cancel")
switch(R)
if("Freeze")
if(usr.Pet)
usr.PetStorage1 = usr.Pet
del usr.Pet
else
usr << "You dont have a pet to freeze"
usr.move=1
usr.action=0
if("Revive")
if(usr.PetStorage1 == 0)
usr << "You dont have a pet to Revive"
else
if(usr.Pet)
usr << "You already have a pet Out"
else
usr.Pet = usr.PetStorage1
usr.PetStorage1 = 0
usr.Pet = new(usr.loc)
usr << "You revive [usr.Pet]."
usr.move=1
usr.action=0
if("Cancel")
usr.move=1
usr.action=0
return
ID:147389
Jun 16 2004, 9:03 am
|
|
It stores the pets but when i Revive the pet its named "mob" and it doesnt revive the Pets variables either for some reason.This is my code,ive been trying this for about 5 days so any help would be appreciated.
|
Jun 16 2004, 9:14 am
|
|
May I see the var "Pet" from usr.pet? My guess is that you aren't saving all the variables under usr.pet, and that's why they don't come up when the pet is revived.
|
In response to Dragon of Ice
|
|
You mean this?
mob and i make the Pet variables here. mob |
Ok...I had a problem with this awhile ago, and I found a cheap way out of it. Just add the pet to the mob's contents, and set usr.Pet to null. It will save properly, and to take the pet out, just search through the mob's contents for it. Oh, but if you're displaying the mob's contents in a statpanel, you'll have to make sure it only displays objects.
mob |
In response to SSJ Radditz
|
|
Im getting the same problem.Should it be like this?
mob |
In response to Turles9000
|
|
usr.Pet = new(usr.loc) Change that to usr.Pet.Move(usr.loc) |
In response to SSJ Radditz
|
|
Im having 2 More problems.1 is that If i try to Revive and have no Pets in my Inventory its suppose to say "You have no Pets to Revive" But instead it does nothing.Another problem im having is depending on the amount of Pets i have stored it gives me that many "You already have a pet Out"
Messages if i try to revive with a pet. mob/var |
In response to Turles9000
|
|
I know the reason its giving me more then one "You already have a pet Out" is because im Checking for every Pet in his inventory and its doing that everytime it finds one But i have no idea how to fix it.
|