Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-07-2004, 11:28 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
move

This is most likely a bug but I thought I would just post it here first.

NPC Code:

if ( created ){
this.speed = 0.5;
message Ask me to "Come Here".;
}

if ( playerchats ){
if ( strequals( #c , Come Here ) ){
this.movex = playerx + vecx( playerdir ) * 2;
this.movey = playery + vecy( playerdir ) * 2;
move();
message Coming sir.;
}
}

function move(){
this.dx = this.movex - x;
this.dy = this.movey - y;
this.dis = ( this.dx ^ 2 + this.dy ^ 2 ) ^ 0.5;
this.time = this.dis * this.speed;
setcharani walk,;
move this.dx , this.dy , this.time , 1 + 4 + 8 + 16;
}

if ( movementfinished ){
if ( x != this.movex || y != this.movey ){
message A wall is in the way.;
}else{
message Here.;
}
setcharani idle,;
}

//#CLIENTSIDE

if ( created ) {
// Initialize the attributes
showcharacter;
setcharprop #3 , head212.png;
setcharprop #C0 , orange;
setcharprop #C1 , black;
setcharprop #C2 , black;
setcharprop #C3 , black;
setcharprop #C4 , black;
setcharprop #2 , no-shield.png;
setcharprop #n , Bob;
shieldpower = 1;
dir = 2;
}



This is a basic npc, it uses the move command to come to you when you ask it too. It is serverside.

It works fine offline. But online it will stop moving, but continue to walk at a standstill. And when called to move again it will warp to the spot it was trying to get to and continue from there.

I really want the move command to work here. :-/ Suggestions? Common ailments? Have you encountered the same?
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
 


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 06:51 PM.


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