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-07-2012, 07:25 PM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
Stop move()?

Is there an easy way to stop a move() before it finishes? Like for instance, a block will move to the right until the player chats something, at which point it will just stop moving entirely and it's x value will be the x value that it stopped at.
__________________
-Ph8
Reply With Quote
  #2  
Old 09-07-2012, 07:27 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Not an expert, and I've not used move() a lot, but would calling it again cancel the previous one?
Reply With Quote
  #3  
Old 09-07-2012, 07:41 PM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
Quote:
Originally Posted by Emera View Post
Not an expert, and I've not used move() a lot, but would calling it again cancel the previous one?
Nah, depending on what integer you put for the 4th parameter it will do one of a few things when you call move again, none of which seem to be what I want.

TServerNPC.move(float, float, float, int) - moves the npc smoothly, parameters are delta x, delta y, time and options: cache type (0, 1-cache, 2-append) + blockcheck(4) + eventwhendone(8) + applydir(16)
__________________
-Ph8
Reply With Quote
  #4  
Old 09-07-2012, 07:57 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Have you tried:

move(this.x,this.y,0,0+8);

Since 0 does not cache or append movement it may just overwrite already existing movement caches and stop it.
Reply With Quote
  #5  
Old 09-07-2012, 08:01 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
You could always use a timeout and move the x of the object until the player chats. II don't know exactly what you're trying to accomplish so its hard to tell the best way to go about it.
Reply With Quote
  #6  
Old 09-07-2012, 08:11 PM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
Quote:
Originally Posted by DustyPorViva View Post
Have you tried:

move(this.x,this.y,0,0+8);

Since 0 does not cache or append movement it may just overwrite already existing movement caches and stop it.
Nope, it just instantly finishes the current movement and starts the next one from there.

Quote:
Originally Posted by Cubical View Post
You could always use a timeout and move the x of the object until the player chats. II don't know exactly what you're trying to accomplish so its hard to tell the best way to go about it.
Yeah, there are other ways I can go about what I'm doing. Just would have been simplest to do it this way.

Guessing there probably just isn't a way. Thanks everyone.
__________________
-Ph8
Reply With Quote
  #7  
Old 09-07-2012, 08:13 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Doesn't manually editting X/Y automatically stop move();?

this.x = this.x;
Reply With Quote
  #8  
Old 09-07-2012, 08:14 PM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
Quote:
Originally Posted by ffcmike View Post
Doesn't manually editting X/Y automatically stop move();?

this.x = this.x;
Wow it totally does. Thanks a bunch.

Must spread rep around
__________________
-Ph8
Reply With Quote
  #9  
Old 09-08-2012, 03:21 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Cubical View Post
You could always use a timeout and move the x of the object until the player chats. II don't know exactly what you're trying to accomplish so its hard to tell the best way to go about it.
move is generally preferable to a timeout because it synchronizes the movement between serverside and clientside for smooth movement even if you have high latency.
__________________
Reply With Quote
  #10  
Old 09-08-2012, 04:07 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
Quote:
Originally Posted by cbk1994 View Post
move is generally preferable to a timeout because it synchronizes the movement between serverside and clientside for smooth movement even if you have high latency.
That's pretty cool. Someone needs to put together a guide highlighting the advantages of using certain methods for certain applications(not all applications, but the most general, movement/search/etc...).
__________________
Quote:
Originally Posted by Crono View Post
No look at it, Stefan is totally trolling Thor. Calling Classic a "playerworld" (something it's not supposed to be) is the ultimate subtle insult to a true fan.

It's genius.
Reply With Quote
  #11  
Old 09-08-2012, 06:17 PM
Felix_Xenophobe Felix_Xenophobe is offline
iphone era sad litle mads
Felix_Xenophobe's Avatar
Join Date: May 2005
Location: punchin yer nuts iphone era
Posts: 1,810
Felix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to behold
Send a message via MSN to Felix_Xenophobe
have you tried hammer time
__________________
KARTRACE
REIGNING CHAMPION
Quote:
Originally Posted by Tashkin
I have done 10x the amount any previous EA has done.
Quote:
Originally Posted by Ravenblade1979 View Post
What you need is Zone Police again.
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:43 PM.


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