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-20-2006, 05:05 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
move() bug?

What I'm doing:
PHP Code:
triggerActionthis.1this.1"serverside""returnData""bomy"); 
Which works when doing it before I use the move() command.

After using the move() command, to move my "bomypet", on Graal2001 Dev, it doesn't trigger at correct place anymore. Anyone knows why? The triggeraction is done clientside, the move() part serverside.

The move() part is in a joined class, not the one the triggeraction is being sent to, maybe the this.x and this.y aren't updating correctly? Who knows.. maybe you!
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #2  
Old 09-20-2006, 08:19 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
*cough* Outdated function *cough* just use the this.x+(movement)*speed or whatever and update the timing so its smoother.
__________________

Reply With Quote
  #3  
Old 09-20-2006, 09:03 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by ZeroTrack View Post
*cough* Outdated function *cough* just use the this.x+(movement)*speed or whatever and update the timing so its smoother.
Move() still works and isn't outdated. ( or at least I use it? )

Also.. x + 1, and y + 1..

try x, y or x + 0.5, y + 0.5

And make sure its setshaped on the clientside I think.
Reply With Quote
  #4  
Old 09-20-2006, 09:14 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
I haven't used move() in a longg time
__________________

Reply With Quote
  #5  
Old 09-20-2006, 09:16 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by ZeroTrack View Post
I haven't used move() in a longg time
Changing X/Y directly.. hachi told me ( and I am pretty sure I witnessed) it makes the walk.wav sound play
Reply With Quote
  #6  
Old 09-24-2006, 07:47 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
Talking

Quote:
Originally Posted by ZeroTrack View Post
*cough* Outdated function *cough*
It's not outdated, one of my favorite scripts use the move();

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

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

__________________
Deep into the Darkness peering...
Reply With Quote
  #7  
Old 09-25-2006, 03:50 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
This doesn't fix my bug..
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #8  
Old 09-25-2006, 03:53 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
move()'s movement is handled on the clientside.
When the move() time runs out, it updates the position on the serverside.

You'll have to trigger the server .05 or .1 seconds after it finishes moving, or schedule an event in the serverside to be called when it finishes moving.
Reply With Quote
  #9  
Old 09-25-2006, 04:04 PM
Jackel9 Jackel9 is offline
Dimension Zero Founder
Jackel9's Avatar
Join Date: Nov 2005
Location: NC SONZ
Posts: 193
Jackel9 is on a distinguished road
server lag
__________________

Reply With Quote
  #10  
Old 09-25-2006, 04:07 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
if (movementfinished) {

not sure what that is in GS2...or if it is actually real . Saw it used in a script but I can't say whether it worked or not.
Reply With Quote
  #11  
Old 09-25-2006, 05:19 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Quote:
Originally Posted by Yen View Post
move()'s movement is handled on the clientside.
When the move() time runs out, it updates the position on the serverside.

You'll have to trigger the server .05 or .1 seconds after it finishes moving, or schedule an event in the serverside to be called when it finishes moving.
1. Wouldn't that cause lag?
2. I'm using move() serverside, and double clicking action is clientside.

I tried this:
Serverside (when movement was done);
this.attr[ 20] = this.x;
this.attr[ 21] = this.y;
Clientside;
triggerAction( this.attr[ 20] + 1, this.attr[ 21] + 1,.....

But it did not work.
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #12  
Old 09-25-2006, 05:52 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by ZeroTrack View Post
*cough* Outdated function *cough* just use the this.x+(movement)*speed or whatever and update the timing so its smoother.
Uhh, don't know what you're smoking, but updating the position of an NPC Serverside in a timeout or for loop would lag. Which is why the move() function is used in the first place.

Your little x+(movement)*speed is what is outdated. That is how it was done before the NPC Server was introduced.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #13  
Old 09-30-2006, 04:34 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Well I was told a long time ago to stop using it cause
A. It was buggy as heck
B. It was going to be outdated

So from that point on I just wrote all custom movement, this was going back to like Enigma when it was only me a Warcaptain making things on there.
__________________

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 10:54 PM.


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