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-28-2007, 09:16 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
move()

PHP Code:
function onMovementFinished()
{
  
temp.newx vecx(this.dir) * this.walkspeed;
  
temp.newy vecy(this.dir) * this.walkspeed;
  
this.runcounter--;
  
  if (
this.runcounter 0)
  {
    
setcharani("walk"NULL);
    
    
temp.testx this.temp.newx 1.5 vecx(this.dir);
    
temp.testy this.temp.newy 2.0 vecy(this.dir);
    
    if (
onwall(temp.testxtemp.testy))
    {
      
this.dir = (dir 2) % 4;
      
this.runcounter int(random(060));
      
      
this.onMovementFinished();
    }
      else
    {
      
dist = (temp.newx temp.newy 2) ^ 0.5;
      
move(temp.newxtemp.newydist 168);
    }
  }
    else
  {
    
this.runcounter int(random(1040));
    
    
setcharani("idle"NULL);
    
this.dir = (dir int(random(02)) * 2) % 4;
    
    
this.onMovementFinished();
  }
  
  if (
this.runcounter <= 0)
  {
    
this.runcounter 20;
  }

The movement on this is very.. well, the gani is wierd. Unsure why, I tried messing with it. If someone could help, much appreciated.

P.S. Yeah, I basically rescripted offline movement to GS2 with move(). And yeah, anyone could use this script for there own server.. assuming it worked correctly =[.
__________________
- Zidane / Zidaya
Reply With Quote
  #2  
Old 05-28-2007, 08:00 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
/bump

help please =[
__________________
- Zidane / Zidaya
Reply With Quote
  #3  
Old 05-28-2007, 08:01 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
We need more details, what do you mean "weird"?
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #4  
Old 05-28-2007, 08:29 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
The gani keeps setting because it isn't finishing the movement. I even tried setting walk only once, still happens.
__________________
- Zidane / Zidaya
Reply With Quote
  #5  
Old 05-28-2007, 08:49 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
You mean the gani is 'stuck' on the first frame?
Probably because it's being set in a timeout, try doing something like:
if (this.gani!="walk") setcharani("walk",);
or however it'd be done in GS2.
Reply With Quote
  #6  
Old 05-28-2007, 09:44 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
You mean the gani is 'stuck' on the first frame?
Probably because it's being set in a timeout, try doing something like:
if (this.gani!="walk") setcharani("walk",);
or however it'd be done in GS2.
Quote:
Originally Posted by Deadly_Killer View Post
The gani keeps setting because it isn't finishing the movement. I even tried setting walk only once, still happens.
As in, only in onCreated();
__________________
- Zidane / Zidaya
Reply With Quote
  #7  
Old 05-28-2007, 11:20 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
I made a move() tutorial awhile back, I'll upload it when I find it, it's in another move() thread I believe.

Found it. It was for making a baddy move but it may help, here you go.

move(x,y,time,options);

x = move how far from current position horizontally

y = move how far from current position vertically

time = time it takes to get from starting point to ending point

options = cachtype(0,1,2) blockcheck(4) eventwhendone(8) applydir(16)

blockcheck = test to see if the tile is blocking or not
eventwhendone = stops moving after one movement. other wise the NPC
will move forever in that direction.
applydir = if the the char current gani has 4 dir it will apply it when it moves


Here's a NPC I use for a townsfolk randomly move

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
onTimeOut();
}

function 
onTimeOut() {
  
temp.rx random(-3,3);
  
temp.ry random(-3,3);
  
temp.r  random(3,5);
  
temp.rr random(0,5);
  
setcharani("walk",NULL);
  
move(rx,ry,r,4+8+16);
  
sleep(r);
  
setcharani("idle",NULL);
  
setTimer(rr);

I have more stuff in the script of course but there is the movement part. Also remember the movement is still in the Quadrant IV (Grid Wise)
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 05-29-2007, 12:33 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Quote:
Originally Posted by Angel_Light View Post
I made a move() tutorial awhile back, I'll upload it when I find it, it's in another move() thread I believe.

Found it. It was for making a baddy move but it may help, here you go.

move(x,y,time,options);

x = move how far from current position horizontally

y = move how far from current position vertically

time = time it takes to get from starting point to ending point

options = cachtype(0,1,2) blockcheck(4) eventwhendone(8) applydir(16)

blockcheck = test to see if the tile is blocking or not
eventwhendone = stops moving after one movement. other wise the NPC
will move forever in that direction.
applydir = if the the char current gani has 4 dir it will apply it when it moves


Here's a NPC I use for a townsfolk randomly move

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
onTimeOut();
}

function 
onTimeOut() {
  
temp.rx random(-3,3);
  
temp.ry random(-3,3);
  
temp.r  random(3,5);
  
temp.rr random(0,5);
  
setcharani("walk",NULL);
  
move(rx,ry,r,4+8+16);
  
sleep(r);
  
setcharani("idle",NULL);
  
setTimer(rr);

I have more stuff in the script of course but there is the movement part. Also remember the movement is still in the Quadrant IV (Grid Wise)
uhm.., option 8 allows the function onMovementFinished() which is what I am using
__________________
- Zidane / Zidaya
Reply With Quote
  #9  
Old 05-29-2007, 12:40 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Deadly_Killer View Post
uhm.., option 8 allows the function onMovementFinished() which is what I am using
eventwhendone(8)

That's what he said.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #10  
Old 05-29-2007, 01:07 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
eventwhendone = stops moving after one movement. other wise the NPC
will move forever in that direction.

?
__________________
- Zidane / Zidaya
Reply With Quote
  #11  
Old 05-29-2007, 01:09 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
No..

eventwhendone = true; onMovementFinished() will be called.
eventwhendone = false; onMovementFinished() will NOT be called.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #12  
Old 05-29-2007, 01:30 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Deadly_Killer View Post
eventwhendone = stops moving after one movement. other wise the NPC
will move forever in that direction.

?
This is true it will keep moving in the direction for infinity, putting 8 will make it stop after one movement.
__________________
Deep into the Darkness peering...
Reply With Quote
  #13  
Old 05-29-2007, 01:31 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Angel_Light View Post
This is true it will keep moving in the direction for infinity, putting 8 will make it stop after one movement.
*beeeep* Wrong, try again.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #14  
Old 05-29-2007, 01:34 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Also, the definition you posted for the time param is wrong as well. That param is reserved for how many tiles it moves per a certain amount of time I am not sure of at the moment.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #15  
Old 05-29-2007, 03:07 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by xXziroXx View Post
*beeeep* Wrong, try again.
True, without 8 in the options the NPC keeps moving forever in that direction both in GS1 and GS2 o.O it also calls the onMovementFinished() too.

Quote:
Originally Posted by killerogue View Post
Also, the definition you posted for the time param is wrong as well. That param is reserved for how many tiles it moves per a certain amount of time I am not sure of at the moment.
My definition is correct look in the commands.rtf
__________________
Deep into the Darkness peering...
Reply With Quote
  #16  
Old 05-29-2007, 03:08 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Angel_Light View Post
True, without 8 in the options the NPC keeps moving forever in that direction both in GS1 and GS2 o.O it also calls the onMovementFinished() too.
No it doesnt -_-

What do you think the two first parameters are for? Just for looks? They decide how FAR it will move.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #17  
Old 05-29-2007, 03:10 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Test it >_> the x and y are like the slope of the direction to move, the npc goes on forever without 8 in the options part.
__________________
Deep into the Darkness peering...
Reply With Quote
  #18  
Old 05-29-2007, 03:19 AM
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
From newfeatures2001:
PHP Code:
- New script commandmove dx,dy,time,options;
  
dx delta x
  dy 
delta y
  time 
time in seconds
  options 
cachingmode (0,or 2) + blockcheck (or 0) +
    
informmewhendone (or 0) + applydirection (16 or 0)
  
This moves the npc without needing you to update the
  position of the npc 
'manually' by changing x and y.
  
To move an npc 10 tiles to the rightthen 10 tiles to
  the left 
and againjust do following:
  if (
created) {
    while (
true) {
      
move 10,0,4,0;
      
sleep 4;
      
move -10,0,4,0;
      
sleep 4;
    }
  }
  
This moves the npc 10 tiles to the rightthen waits 4
  seconds
then moves it 10 tiles to the leftthen waits
  4 seconds
, and repeats this endlessly.
  
The good thing is that this also works with server-side
  npcs 
and makes them look like they are moved on client-side.
  
There are also nice options to makes things very simple:
  - 
cachingmode:
    - 
0previous movements will be finished immediatelly
    
1movements will be cachedthe previous movements
         will only be finished when the cache is too large
         
(distance to go >5);
         
this caching can be used on server-side npcs to
         make the movement look like non
-laggy even when
         there are little delays sometimes
    
2the movement will just be appended to the movement
         
list; you can add up to 100 movements
  
blockcheckadd 4 to the options when you want the
    npc to stop when there is a wall blocking the npc
  
informmewhendone: if you add 8 to the options then the
    script will be called with a 
'movementfinished' flag
    when the the npc has stopped walking
; catch this event
    with
    
if (movementfinished) {...}
    if 
you want to do something when the npc has stopped
    
(e.gwalking in a different direction)
  - 
applydirectionadd 16 to the options if you want the
    game to automatically set the direction of the npc
    depending on the movement direction 
(can be good
    when using movement caching

While the first two parameters ARE the delta, they also give a destination, so when they are reached the NPC will stop. Option 8, like it says, simply sends the event 'movementfinished'.
Reply With Quote
  #19  
Old 05-29-2007, 04:05 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Quote:
Originally Posted by xXziroXx View Post
No..

eventwhendone = true; onMovementFinished() will be called.
eventwhendone = false; onMovementFinished() will NOT be called.
That is what I said. I was quoting what he called it because you said he was right originally.

Quote:
Originally Posted by Angel_Light View Post
Test it >_> the x and y are like the slope of the direction to move, the npc goes on forever without 8 in the options part.
Then why the timeout in your example?
__________________
- Zidane / Zidaya
Reply With Quote
  #20  
Old 05-29-2007, 05:15 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Deadly_Killer View Post
Then why the timeout in your example?
Because I have 8 in it which stops it so I can renew the x y values. Just leave the 8 out it will go in the slope give forever.
__________________
Deep into the Darkness peering...
Reply With Quote
  #21  
Old 05-29-2007, 05:39 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Quote:
Originally Posted by Angel_Light View Post
Because I have 8 in it which stops it so I can renew the x y values. Just leave the 8 out it will go in the slope give forever.
You are so off it isn't even FUNNY.
__________________
- Zidane / Zidaya
Reply With Quote
  #22  
Old 05-29-2007, 06:38 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I haven't used move() in like 2 years, I couldn't comment.
__________________
Reply With Quote
  #23  
Old 05-29-2007, 06:43 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Angel_Light View Post
Because I have 8 in it which stops it so I can renew the x y values. Just leave the 8 out it will go in the slope give forever.
You might have an error somewhere. Maybe post what you have? I am 140% positive that a npc will stop after its time and distance has been covered when the '8' bit flag is not included.
__________________
Do it with a DON!
Reply With Quote
  #24  
Old 05-29-2007, 06:44 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by zokemon View Post
You might have an error somewhere. Maybe post what you have? I am 140% positive that a npc will stop after its time and distance has been covered when the '8' bit flag is not included.
So am I. Always has, always will. I've used move() enough times to know.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #25  
Old 05-29-2007, 06:45 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Well it was in a timeout, that's what kept it going.
__________________
- Zidane / Zidaya
Reply With Quote
  #26  
Old 05-29-2007, 06:50 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Deadly_Killer View Post
Well it was in a timeout, that's what kept it going.
.. duh, no wonder it would never stop then
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #27  
Old 05-29-2007, 01:27 PM
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
Why are people even using move()? Seems like a custom move() scripting would be simpler, and much more effective ...
__________________
Reply With Quote
  #28  
Old 05-29-2007, 06:27 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
Move keeps the movement of the NPC smooth on the serverside, I don't think there's a way to replicate that.
Reply With Quote
  #29  
Old 05-29-2007, 06:39 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
    else
  {
    this.runcounter = int(random(10, 40));
    
    setcharani("idle", NULL);
    this.dir = (dir + 1 + int(random(0, 2)) * 2) % 4;
    
    scheduleevent(0.5, "movementFinished", "");
  }
Use scheduleevent
__________________
Reply With Quote
  #30  
Old 05-29-2007, 09:25 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
But that isn't the problem.

For some reason, when a move() resets.. the gani resets. This should be fixed by stefan, if anything.
__________________
- Zidane / Zidaya
Reply With Quote
  #31  
Old 05-29-2007, 09:38 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
no it doesn't...?

HTML Code:
function onCreated()
{
  this.showCharacter();
  move(2, 2, 0.8, 8);
  this.ani = "walk";
}
function onMovementFinished()
{
  sleep(5);
  this.destroy();
}
__________________
Reply With Quote
  #32  
Old 05-29-2007, 11:41 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Quote:
Originally Posted by xAndrewx View Post
no it doesn't...?

HTML Code:
function onCreated()
{
  this.showCharacter();
  move(2, 2, 0.8, 8);
  this.ani = "walk";
}
function onMovementFinished()
{
  sleep(5);
  this.destroy();
}
Reschedule a move() when onMovementFinished() is called.
__________________
- Zidane / Zidaya
Reply With Quote
  #33  
Old 05-30-2007, 01:16 AM
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
You'll probably have to change the gani's outside of the move.
Reply With Quote
  #34  
Old 05-31-2007, 04:45 AM
Cloven Cloven is offline
Delteria
Cloven's Avatar
Join Date: Dec 2006
Location: Florida, United States
Posts: 542
Cloven has a spectacular aura about
Send a message via AIM to Cloven
Quote:
Originally Posted by Deadly_Killer View Post
Reschedule a move() when onMovementFinished() is called.
And 'sleep' is the devil.
Reply With Quote
  #35  
Old 06-01-2007, 04:41 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by DustyPorViva View Post
Move keeps the movement of the NPC smooth on the serverside, I don't think there's a way to replicate that.
Yes there is, if you understand what is happening exactly.
What move actually does, like shoot, is run a clientside effect. You are not actually seeing the npcs current position serverside. Many of the new scripts in classic that we do achieve the same thing. The actual visual movement is scripted clientside (to appear smooth), but positioning and other such things are kept serverside. It makes for a much more visuably pleasing effect, and cuts down processing power on this server.

The npc's acutal x,y, after doing a series of moves in the same tic, will be the end result. if you try to get the position in the same tic (cycle, function, whatever) you used move, it will still be at the origin until the next tic.
__________________
Reply With Quote
  #36  
Old 06-01-2007, 06:45 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
How do you keep it synced with the serverside data though?
Reply With Quote
  #37  
Old 06-01-2007, 09:02 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Quote:
Originally Posted by Cloven View Post
And 'sleep' is the devil.
Yeah.

P.S. How do you send serverside data to a client for a specific npc?
__________________
- Zidane / Zidaya
Reply With Quote
  #38  
Old 06-01-2007, 09:25 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by DustyPorViva View Post
How do you keep it synced with the serverside data though?
That would depend on what you want synced ^_^
__________________
Reply With Quote
  #39  
Old 06-01-2007, 09:32 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
Well definitely would be the actual coordinates of the NPC, so players aren't seeing the NPC in two different locations because of local lag.
Reply With Quote
  #40  
Old 06-01-2007, 09:38 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by DustyPorViva View Post
Well definitely would be the actual coordinates of the NPC, so players aren't seeing the NPC in two different locations because of local lag.
even if you were moving it manually, the players dont always see it in the same position due to local lag. you have to go under the good faith assumption that if a player is lagging, then he gets other player data & npc server data at relatively the same time.
__________________
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 01:22 AM.


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