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-15-2009, 11:20 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
using 'move()'

I know the params, but what are the options to the flags (8+16) etc, I can't find them on the wiki....... thanks
Reply With Quote
  #2  
Old 05-15-2009, 11:37 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Options: cachetype(0,1,2) + blockcheck(4) + eventwhendone(8) + applydir(16)

Quote:
There are also nice options to makes things very simple:
- cachingmode:
- 0: previous movements will be finished immediatelly
- 1: movements will be cached, the 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
- 2: the movement will just be appended to the movement
list; you can add up to 100 movements
- blockcheck: add 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.g. walking in a different direction)
- applydirection: add 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)
I'll add something about it to the wiki when I get the chance.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #3  
Old 05-16-2009, 01:52 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 /scripthelp move
Script help for 'move':
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)
This might make it a bit more clear.
__________________
Reply With Quote
  #4  
Old 05-16-2009, 02:53 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
An API reference that does not have a separate section for each function explaining the exact semantics of each parameter and the return value and whatever is a lousy API reference.
Reply With Quote
  #5  
Old 05-16-2009, 07:30 AM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Thanks guys- just what I needed


Once an object has moved and is triggering to the server
has anyone else had any problems with using triggeraction?

It only seems to detect the object once it's finished moving and on a wall, if
it's on a non-blocking tile it's as though the trigger action isn't sent, any ideas?

Last edited by [email protected]; 05-16-2009 at 12:20 PM..
Reply With Quote
  #6  
Old 05-16-2009, 07:44 PM
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
The object itself is blocking? If it's using a gani then make sure it's using showcharacter or setshape.
Reply With Quote
  #7  
Old 05-18-2009, 06:10 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
HTML Code:
//Serverside
function onCreated() {
  this.showcharacter();
  this.ani = "gani";
    //Auto destroy in 15
  setTimer(15);
}

function onTimeout() {
  this.destroy();
}
function onActionTakeDart() {
  this.destroy();
}
//#CLIENTSIDE
function onCreated() {
  this.showcharacter();
}
function onPlayerTouchsMe() {
  triggeraction(this.x, this.y, "TakeDart", "");
}
no reason..
Reply With Quote
  #8  
Old 05-18-2009, 08:11 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
On your serverside onCreated() put a setshape(1,32,32);

Then on your clientside triggeraction make it hit, this.x + 1 and this.y + 1.
__________________
Quote:
Reply With Quote
  #9  
Old 05-19-2009, 11:55 AM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by fowlplay4 View Post
On your serverside onCreated() put a setshape(1,32,32);

Then on your clientside triggeraction make it hit, this.x + 1 and this.y + 1.
Depends how big your object is of course...
Reply With Quote
  #10  
Old 05-19-2009, 06:24 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
On your serverside onCreated() put a setshape(1,32,32);

Then on your clientside triggeraction make it hit, this.x + 1 and this.y + 1.
Still doesn't work
Reply With Quote
  #11  
Old 05-19-2009, 08:45 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by [email protected] View Post
Still doesn't work
The object is moving, right?
Reply With Quote
  #12  
Old 05-19-2009, 08:53 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by [email protected] View Post
Still doesn't work
Well why don't you just put onPlayerTouchsMe() on the serverside.
__________________
Quote:
Reply With Quote
  #13  
Old 05-20-2009, 04:25 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
Well why don't you just put onPlayerTouchsMe() on the serverside.
Various reasons- already tried lol


It's stopped moving once the trigger is sent
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:57 AM.


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