Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Pet? (https://forums.graalonline.com/forums/showthread.php?t=7989)

ownerofbabylon 07-25-2001 12:08 AM

Pet?
 
What would be the best way to do this?

If you make a dog that you want to follow you around shold you use

1.Follow player and canwarp;

or

2.Make it so that it stays exactly 2 x and/or 2 ys away?

I have the gifs for a dog (not the actual pet) and I want it so that it stays about as far from a player as a bomy does when it follows. How would I do this?

ownerofbabylon 07-25-2001 12:52 AM

I would be happy if someone responds

G_yoshi 07-25-2001 02:47 AM

Quote:

Originally posted by ownerofbabylon
I would be happy if someone responds
or you could just be polite and wait patiently for a reply ;)

ownerofbabylon 07-25-2001 09:12 AM

LOL, good idea.

Well, here is what I have


if(created){
setimg idle.gif;
}
if(playerchats&&strequals(#c,come)){
followplayer;
}
if(playerdir==0){
setimg up.gif;
}
if(playerdir==1){
setimg left.gif;
}
if(playerdir==2){
setimg down.gif;
}
if(playerdir==3){
setimg right.gif;
}

For some reason it wont change the graphic when the player does. I asked Shadrock and he said to use functions because followplayer is bad so if anyone can get this working I would be happy. See ----> :)

But seriously does anyone know whats wrong??

Darkspector 07-25-2001 09:22 AM

make a guinea pig in a cage

ownerofbabylon 07-25-2001 10:37 AM

heh =D good idea

Poogle 07-25-2001 10:38 AM

I have got a pet script for Frogs Rabites and Chickens :D

ownerofbabylon 07-25-2001 10:41 AM

me too but i didnt look at them. What do they do?

Falcor 07-25-2001 10:51 AM

OMg like I made dogs and cants and chicken pets on ToT =D And they eat stuff and go night night and I thought it was cool untill Mr. High and Mighty popeple steal the GFX >=(

NO MORE STEALING PLEASE!

ownerofbabylon 07-25-2001 10:53 AM

Sounds cool, are u a good scripter?

grim_squeaker_x 07-25-2001 04:29 PM

The playerdir checks need to be in a timeout loop.

ownerofbabylon 07-25-2001 11:12 PM

uh oh, I dont know how to do timeouts right.

is it like


if(created){
timeout=.5;
setimg idle.gif;
}
if(playerchats&&strequals(#c,come)){
followplayer;
}
if(playerdir==0){
timeout=.5
setimg up.gif;
}
if(playerdir==1){
timeout=.5
setimg left.gif;
}

?? something like that? I understand how they work but I have never used them and im not sure what part goes where.
if(playerdir==2){
timeout=.5
setimg down.gif;
}
if(playerdir==3){
timeout=.5
setimg right.gif;
}

zokemon 07-25-2001 11:19 PM

Quote:

Originally posted by ownerofbabylon
LOL, good idea.

Well, here is what I have


if(created){
setimg idle.gif;
}
if(playerchats&&strequals(#c,come)){
followplayer;
}
if(playerdir==0){
setimg up.gif;
}
if(playerdir==1){
setimg left.gif;
}
if(playerdir==2){
setimg down.gif;
}
if(playerdir==3){
setimg right.gif;
}

For some reason it wont change the graphic when the player does. I asked Shadrock and he said to use functions because followplayer is bad so if anyone can get this working I would be happy. See ----> :)

But seriously does anyone know whats wrong??

LOL!!!!!!!!!!!!!
duh you need aloop like this:

if(created){
setimg idle.gif;
}
if(playerchats&&strequals(#c,come)){
followplayer;
set dogfollow;
}
while (dogfollow) {
if(playerdir==0){
setimg up.gif;
}
if(playerdir==1){
setimg left.gif;
}
if(playerdir==2){
setimg down.gif;
}
if(playerdir==3){
setimg right.gif;
}
if (playersays(stop)) {
unset dogfollow;
}
sleep 0.05;
}

ok!

ownerofbabylon 07-25-2001 11:21 PM

=D thank you. Now i feel like an idiot. I am not good with loops or anything like that but im learning from looking at post with code in them on the message board =D

Thanks again Zokemon.

zokemon 07-25-2001 11:22 PM

np
i script stuff like that all the time

ownerofbabylon 07-25-2001 11:23 PM

I got one more question.

What if you wanted to make a dog do the same thing as bomys do? What I mean is like you know how when you say somthing bomys stop following you? Then they go and stay (or wander) a level until you get back. How would you make it so the server kept them on a level even when the person was not online and playing?

konidias 07-26-2001 11:58 PM

Quote:

Originally posted by ownerofbabylon
I got one more question.

What if you wanted to make a dog do the same thing as bomys do? What I mean is like you know how when you say somthing bomys stop following you? Then they go and stay (or wander) a level until you get back. How would you make it so the server kept them on a level even when the person was not online and playing?

You would need to make it so when the "dog" recieved the command "walk" or something then it would set its x to x and its y to y, and then go into a "walk mode" where it choose a random direction and takes a few steps and then chooses again.. (check the human npc random walking in the editor)

To keep them on seperate levels, you need an NPC SERVER. =)

Also try not to post several topics related to the exact same thing please.

Email me and I can give you some script examples that might help you out

ownerofbabylon 07-27-2001 06:45 AM

Alright, I will talk to ya on AIM or email soon. Right now im at a friends house and im going to a huge concert tommorow (Vans Warped Tour) but I will go home that night and contact you. Thanks alot man!!!


All times are GMT +2. The time now is 11:15 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.