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 05-31-2003, 07:24 AM
Azrael528 Azrael528 is offline
Registered User
Join Date: May 2003
Location: New Jersey
Posts: 151
Azrael528 is on a distinguished road
looping question

ok, i know how to do a basic loop like to make an npc continually slide in one direction or infinetly put leaps at certain coordinates, but how do i get an npc to move back and forth, usually you just use sleep or something but that screws up the loop
__________________
*Azrael528 aka Outlaw aka Bronson

Quote:
Pickles your freakin' sister has been IMing me. Unless she's hot tell her to stop.
-ShadowStrike2k1
Reply With Quote
  #2  
Old 05-31-2003, 02:06 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Kaimetsu
Move command
Timeouts/callback event
Hehe crap, and it was a question I actually could answer ;.

I like to use the x+=1 or y+=1 to slide NPCs around and use variable++ to determine how many spaces it slides.
Reply With Quote
  #3  
Old 05-31-2003, 02:47 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
Quote:

I like to use the x+=1 or y+=1 to slide NPCs around and use variable++ to determine how many spaces it slides.
yes, but he meant to move it back AND forwards.

If you didn't use the move command, then you would need to make a time function and set the value of the movement varible.

eg:

x-= this.move;

when the timer is at a certain time, this.move has a minus value, else it has a positive value.

- Thats just another way of doing it.

Since the move command does the job, I'd recommend using that - neat and tidy
__________________
Former Global Scripting Team Member


Reply With Quote
  #4  
Old 05-31-2003, 04:10 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Kaimetsu


Except that's a horribly inefficient method.
Not when you are trying to create a mini-game environment when the NPC bounces off of walls.
Reply With Quote
  #5  
Old 05-31-2003, 06:42 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
if you don't want any time between it changing directions, you don't need timeout either.. add the right # to the end of the move command (see newfeatures2002) to make it call movementfinished, then use:
if(movementfinished){ (i could be wrong, make sure that event is right too)
move command here again
}
__________________

Reply With Quote
  #6  
Old 05-31-2003, 06:49 PM
Pokilty Pokilty is offline
Registered User
Join Date: Nov 2002
Posts: 101
Pokilty is on a distinguished road
haha thats a nice sig cheetos
__________________
"I have not failed. I've just found 10,000 ways that won't work."
"Logic is in the eye of the logician."
Reply With Quote
  #7  
Old 05-31-2003, 08:21 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Kaimetsu


Yes, even when you are trying to create a mini-game environment where the NPC bounces off of walls.
Yeah, I was tired when I wrote that.
Reply With Quote
  #8  
Old 06-01-2003, 05:51 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Quote:
Originally posted by protagonist


Yeah, I was tired when I wrote that.
I think this excuse has been used to death.
__________________
new account: Trevor
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 04:19 PM.


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