Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-27-2001, 05:03 AM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
Fluffy needs some fine tuning.

Quote:
// NPC made by Tgf_guy
// NPC improved by Tyne

//Basic Animal Template Version 0.1

timeout = .05;

if (created) {timeout = 0.05;timereverywhere;}
if (playerenters) {show;this.mode = 0;}
if (timeout)
{
//Moving
if (this.mode == 0)
{
if (this.dir == 0) {y=y-.5;}
if (this.dir == 1) {x=x-.5;}
if (this.dir == 2) {y=y+.5;}
if (this.dir == 3) {x=x+.5;}

// Animation
if (this.dir == 0)
{
if (this.frame == 0) setgif squirrel1.gif;
if (this.frame == 1) setgif squirrel2.gif;
}
if (this.dir == 1)
{
if (this.frame == 0) setgif squirrel7.gif;
if (this.frame == 1) setgif squirrel8.gif;
}
if (this.dir == 2)
{
if (this.frame == 0) setgif squirrel3.gif;
if (this.frame == 1) setgif squirrel4.gif;
}
if (this.dir == 3)
{
if (this.frame == 0) setgif squirrel5.gif;
if (this.frame == 1) setgif squirrel6.gif;
}
if (this.frame >1) {this.frame = 0;}

if (this.changedir > 50)
{
this.dir=int(random(0,4));
this.changedir = 0;
}
this.changedir ++;
this.frame ++;
} // End of mode checking
}

if(onwall(x + 0,y)) {this.dir=int(random(0,1));}
if(onwall(x -0,y)) {this.dir=int(random(1,4));}
if(onwall(x,y +2)) {this.dir=int(random(0,2));}
if(onwall(x,y -0)) {this.dir=int(random(2,4));}

if (was*hit) {hide;this.mode = 1;}
Tyne helped me with it, but the onwall is still a little rusty. The animal sometimes will go straight through a wall.

How can I fix it so that he doesn't?
Reply With Quote
  #2  
Old 09-27-2001, 05:07 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
if (this.mode==0) {
if (!onwall) {
Reply With Quote
  #3  
Old 09-27-2001, 05:09 AM
SSj_Link SSj_Link is offline
Registered User
Join Date: Jul 2001
Location: i r live in texas
Posts: 244
SSj_Link is on a distinguished road
Send a message via ICQ to SSj_Link Send a message via AIM to SSj_Link
Hmm Might Not Be Right....

I might be able to help but not much,

maybe if it was like


if (onwall(x,y)) {
this.oldx




or somethin like that, like in the skateboard script
__________________
-People with my Password: Me (Boozy), Ghostface Killa, bgraven, Freaky Carnie, Dark Warlock, and SoulReaver.
-So they can all post.-

-I hate my account name -

~Old Names: Link, Darklink, Neo, then Boozy when Bravo died. (So some people will recognize me)~

AIM: boozyneo
ICQ: 116030736
Msn: [email protected]
Email: [email protected]


-DANCE SPAM DANCE!- Dark Warlock
Reply With Quote
  #4  
Old 09-27-2001, 05:12 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
Re: Hmm Might Not Be Right....

Quote:
Originally posted by SSj_Link
I might be able to help but not much,

maybe if it was like


if (onwall(x,y)) {
this.oldx




or somethin like that, like in the skateboard script
what do you mean?
Reply With Quote
  #5  
Old 09-27-2001, 05:12 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
*ADVERTISEMENT*
Yes, folks, on Babylon, not only will our animals be alot neat-o-er than that, but they're alot more efficient too!!
*ADVERTISEMENT*
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #6  
Old 09-27-2001, 05:13 AM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
Quote:
Originally posted by Merlin
if (this.mode==0) {
if (!onwall) {
Thanks for the suggestion, but it just freezes fluffy in place when he hits a wall.
Reply With Quote
  #7  
Old 09-27-2001, 05:15 AM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
Re: Re: Fluffy needs some fine tuning.

Quote:
Originally posted by Kaimetsu
Remember to run it on the NPC Server, of course.
Oy, how do I do that?

I'm not up to date with all of the NPC Server jazz.
Reply With Quote
  #8  
Old 09-27-2001, 05:24 AM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
Re: Re: Re: Re: Fluffy needs some fine tuning.

Quote:
Originally posted by Kaimetsu


Okay, I've made my changes and it should work now. To make it an NPC Server thingy, just use the NPC Control. I don't know exactly how it works because I've never used it, but I'm sure it's straightforward.
Thanks Kai.

...I suppose I'll eventually have to learn how NPC Server works.
Reply With Quote
  #9  
Old 09-27-2001, 05:25 AM
SSj_Link SSj_Link is offline
Registered User
Join Date: Jul 2001
Location: i r live in texas
Posts: 244
SSj_Link is on a distinguished road
Send a message via ICQ to SSj_Link Send a message via AIM to SSj_Link
Err
I odnt remember all of it,
but it puts you back to your Oldx instead of letting you go over the wall, Im sure you could easily convert it

-Freaky-
__________________
-People with my Password: Me (Boozy), Ghostface Killa, bgraven, Freaky Carnie, Dark Warlock, and SoulReaver.
-So they can all post.-

-I hate my account name -

~Old Names: Link, Darklink, Neo, then Boozy when Bravo died. (So some people will recognize me)~

AIM: boozyneo
ICQ: 116030736
Msn: [email protected]
Email: [email protected]


-DANCE SPAM DANCE!- Dark Warlock
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:39 PM.


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