Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-22-2006, 02:17 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
move options

Anyone could tell me the options for move command?
can't find them on the wiki
__________________
Reply With Quote
  #2  
Old 10-22-2006, 03:54 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
move(dx,dy,time,options);

The value of "options" would be something like this:
(0,1,2)+(0,4)+(0,8)+(0,16);

This moves the npc without needing you to update the
position of the npc 'manually' by changing x and y. - Moves the NPC the specified distance over the specified time, with some lame options.
- 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)

Reply With Quote
  #3  
Old 10-22-2006, 04:03 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Thanks

Hmm, when I apply 8 to the cache, how to call the
if (movementfinished){...}?
function onMovementfinished() {...}?

and, anyone know hwo to calculate the speed to go to one distance,
like if I add 2 to the time, it will use 2 secs to the gived coords,
is it possible to make it use the same speed to an coordinate?

and again Gambet, Thanks
__________________
Reply With Quote
  #4  
Old 10-24-2006, 11:10 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
onMovementfinished() should work yes.
When you have dx, dy, tilespersecond:
PHP Code:
dist = (dx^dy^2)^0.5;
move(dxdydist/tilespersecondflags); 
BTW body island ?
Reply With Quote
  #5  
Old 10-24-2006, 11:12 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
What are the flags? =?
Reply With Quote
  #6  
Old 10-25-2006, 05:22 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Stefan View Post
onMovementfinished() should work yes.
When you have dx, dy, tilespersecond:
PHP Code:
dist = (dx^dy^2)^0.5;
move(dxdydist/tilespersecondflags); 
BTW body island ?

Thanks, and.. uhm
__________________
Reply With Quote
  #7  
Old 10-25-2006, 08:59 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Sorry too double post, but I just made an
baddy with this stuff with like 0.03218 % lag

First working baddy I've made
__________________
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:53 PM.


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