ID:173320
 
Does anyone know where i can get a demo that has the code that can show me howto make a pet system like the one in mystic journey or like it?
Kavumaster wrote:
Does anyone know where i can get a demo that has the code that can show me howto make a pet system like the one in mystic journey or like it?


Use The 'Search' option,i dont think people will just hand you the code.
I saw an Pet System demo!

http://developer.byond.com/hub/KitKate20/PettingZooDemo

But it's pretty simple to do it yourself...

mob
pet
icon = 'pet.dmi'
Click()
view() << "[usr] leashes [src]!"
walk_to(src,usr,1,1)
player
icon = 'player.dmi'
Click()
switch(alert(src,"Would you like to follow [usr]?","","Yes","No"))
if("Yes")
walk_to(src,usr,1,1)
if("No") usr << "[src] has not accepted.;return


Here you go, one follow code! You can click an pet or player, and on an pet it'll "leash" it and make it follow you, while on an player it'll ask first.

Also, be aware that if the pet/player MOVES while following, the following will stop automaticly. (So you can move while following, and if you do, you'll stop following!)
In response to PBYOND
if you wanted a better grip on your pet, you could substitute walk_to for step_towards(src,usr) couldn't you?
mob
player
var
tmp//better make it a temp variable so you don't save the pet too!
mob
pet//reference to pet
Move()
..()
if(src.pet)//if the pet variable isn't null
step_to(src.pet,src,1)//make it follow you when you move
pet
name="Pooky"
verb
Claim()//We gotta get our pet, don't we?
set src in oview(1,usr)
var/mob/player/P=usr//defines the right type path for the user
P.pet=src//makes this animal into the users new pet - enjoy!
In response to XzDoG
XzDoG wrote:
Kavumaster wrote:
Does anyone know where i can get a demo that has the code that can show me howto make a pet system like the one in mystic journey or like it?


Use The 'Search' option,i dont think people will just hand you the code.

i wouldnt ask if i dint alrdy try that kitkats one was the only one i found and it not a demo with the code thx for the help from the rest
In response to Kavumaster
Plain out, you can get that pet code by going to programs, users (what ever your user is) then hub then pick that persons name and the source should be in the folder, I got that code yesterday, ill just publish that demo if you want.