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 01-21-2008, 06:47 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
move() on serverside, npc stops x.x

Okay, so I have an irritating problem. I put together a script to control movement for npc characters from an array of coordinates and options etc. and basically when its on a gmap and it crosses to another level the movement of the npc stops at the level border. When the next movement begins a few seconds later the npc appears instantly where its supposed to have been and continues from there into its next movement.

GMap is installed correctly and everything, movement is being done on serverside while the character appearance and everything are clientside. I have no idea why its happening. Can anyone help?

I doubt posting the script will help but I will do it if nobody can relate.

canwarp() and canwarp2() had no effect, and the script is in a level npc on a gmap.
__________________
Reply With Quote
  #2  
Old 01-21-2008, 06:50 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
I suggest making it's on movement system, move() is bugged on serverside. Try maybe using npc.setLevel(); Although I believe setLevel is only for player objects?
__________________
Deep into the Darkness peering...
Reply With Quote
  #3  
Old 01-21-2008, 06:52 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
Well if its bugged on serverside it needs to be un-bugged.
-____________-
Until then movement paths will have to be limited to in-level
__________________
Reply With Quote
  #4  
Old 01-21-2008, 06:55 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
Maybe stupid but have you tried that whole Modulu thing or whatever it is called. (%64)
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 01-21-2008, 11:28 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It should normally work fine
Reply With Quote
  #6  
Old 01-21-2008, 10:13 PM
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 get the same behavior with my ship NPC on Val Dev, when crossing levels the ship and the lamp npcs that move with the ship all stop at the border and reappear where they're supposed to be when the next move() is started.
__________________
Reply With Quote
  #7  
Old 01-22-2008, 09:36 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
I've had this probably with serverside move() several times too.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #8  
Old 01-22-2008, 09:40 PM
Dan Dan is offline
Daniel
Join Date: Oct 2007
Posts: 383
Dan is an unknown quantity at this point
Send a message via MSN to Dan
I've had the same problem, though maybe this can help (since it did for me);

PHP Code:
temp.dx this.path[this.pathpos][1] - this.x;
temp.dy this.path[this.pathpos][2] - this.y;
temp.dist = (dx dy 2) ^ 0.5;
if (
abs(temp.dist) <= 0.5) {
  
this.+= temp.dx;
  
this.+= temp.dy;
  
setPathPos(this.pathpos 1);
  
dropPresent(); // Chooses wether to drop or not drop a gift
  
setCharAni("zone2_idle","");
}
else {
  if (
temp.dist temp.speed) {
    
temp.dx *= temp.speed temp.dist;
    
temp.dy *= temp.speed temp.dist;
    
temp.dist temp.speed;
  }
  else {
    
timegap max(0.1,temp.dist temp.speed);
  }
  
move(temp.dx,temp.dy,timegap,16);

(use 'setTimer(timegap);')
(source; my Santa script for Zone)
__________________
Reply With Quote
  #9  
Old 01-22-2008, 11:29 PM
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
Quote:
Originally Posted by Dan View Post
I've had the same problem, though maybe this can help (since it did for me);

PHP Code:
temp.dx this.path[this.pathpos][1] - this.x;
temp.dy this.path[this.pathpos][2] - this.y;
temp.dist = (dx dy 2) ^ 0.5;
if (
abs(temp.dist) <= 0.5) {
  
this.+= temp.dx;
  
this.+= temp.dy;
  
setPathPos(this.pathpos 1);
  
dropPresent(); // Chooses wether to drop or not drop a gift
  
setCharAni("zone2_idle","");
}
else {
  if (
temp.dist temp.speed) {
    
temp.dx *= temp.speed temp.dist;
    
temp.dy *= temp.speed temp.dist;
    
temp.dist temp.speed;
  }
  else {
    
timegap max(0.1,temp.dist temp.speed);
  }
  
move(temp.dx,temp.dy,timegap,16);

(use 'setTimer(timegap);')
(source; my Santa script for Zone)
So how is that fixing the problem?
__________________
Reply With Quote
  #10  
Old 01-23-2008, 01:11 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 Inverness View Post
So how is that fixing the problem?
From what I can see it moves it every timegap a certain amount, versus moving a large amount at once?
__________________
Reply With Quote
  #11  
Old 01-23-2008, 01:18 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Angel_Light View Post
Try maybe using npc.setLevel(); Although I believe setLevel is only for player objects?
Yes, it is.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #12  
Old 01-23-2008, 01:22 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Well if it's tiny distances, like say .2 tiles Invers problem wouldn't be noticeable, but that's a lot more CPU usage.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #13  
Old 01-23-2008, 01:39 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'd rather not have to go to the trouble of detecting level boarders and such to repeat the move() so it looks correct. I'd love if Stefan could take a look into this problem.

And I want a bugfix, not a workaround
__________________

Last edited by Inverness; 01-23-2008 at 03:03 AM..
Reply With Quote
  #14  
Old 01-25-2008, 01:35 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
Well just testing it I've had the same problem. canwarp/2() have no effect... except canwarp2() I believe makes the NPC 'jump' in an odd way. Either way, definitely bugged.
Reply With Quote
  #15  
Old 02-06-2008, 12:41 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Fixed, will upload new npcservers tomorrow.
On level border it's sending an update of x/y which is effectively stopping the npc the same way "x=x;" is doing. I've added sending a correct new move after crossing the level border, seems to work fine (tested with platforms on Zone Jump'n'run map).
Reply With Quote
  #16  
Old 02-06-2008, 03:03 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
Hurray for Stefan
__________________
Reply With Quote
  #17  
Old 02-06-2008, 04:11 AM
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
Quote:
Originally Posted by Stefan View Post
Fixed, will upload new npcservers tomorrow.
On level border it's sending an update of x/y which is effectively stopping the npc the same way "x=x;" is doing. I've added sending a correct new move after crossing the level border, seems to work fine (tested with platforms on Zone Jump'n'run map).
Awesome.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #18  
Old 02-07-2008, 01:02 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Ok uploaded the new gserver and npcserver.
Reply With Quote
  #19  
Old 02-07-2008, 02:07 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
awsome!!! (and PS check my PM i sent you.. its urgent.. if you can come to my server (final resort) so we can talk further)
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #20  
Old 02-07-2008, 06:45 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 Knightmare1 View Post
and PS check my PM i sent you.. its urgent.. if you can come to my server (final resort) so we can talk further
That's never gonna happen .
__________________
Do it with a DON!
Reply With Quote
  #21  
Old 02-07-2008, 08:34 AM
Dan Dan is offline
Daniel
Join Date: Oct 2007
Posts: 383
Dan is an unknown quantity at this point
Send a message via MSN to Dan
Quote:
Originally Posted by zokemon View Post
That's never gonna happen .
Seconded :P
Nice update @ Stefan btw.
__________________
Reply With Quote
  #22  
Old 02-07-2008, 01:00 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Knightmare1 View Post
awsome!!! (and PS check my PM i sent you.. its urgent.. if you can come to my server (final resort) so we can talk further)
Not a good move. He already said he fixed it and uploaded the new gservers and npc servers. He wont come here again probably, so he wont read that.
Reply With Quote
  #23  
Old 02-07-2008, 04:35 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
Quote:
Originally Posted by zokemon View Post
That's never gonna happen .
So true.
__________________
Reply With Quote
  #24  
Old 02-07-2008, 04:36 PM
Dan Dan is offline
Daniel
Join Date: Oct 2007
Posts: 383
Dan is an unknown quantity at this point
Send a message via MSN to Dan
Quote:
Originally Posted by Crow View Post
Not a good move().
Lol
__________________
Reply With Quote
  #25  
Old 02-07-2008, 05:40 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Dan View Post
Lol
I thought about doing that ;P
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 09:56 AM.


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