Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-11-2013, 05:08 AM
Vatec Vatec is offline
Lurking
Join Date: Oct 2012
Posts: 27
Vatec is on a distinguished road
Documentation on move()

Hi everyone, I have searched around and have been unable to find valid documentation on move(); such as what the parameters do, if someone would be kind to link me to modems documentation or just post it here it would be much appreciated.
__________________


Quote:
Originally Posted by GULTHEX View Post
so i think the problem is that onactionclientside isint a real function
Reply With Quote
  #2  
Old 02-11-2013, 05:16 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
Graal Script Code:
- New script commandmove dx,dy,time,options;
  
dx delta x
  dy 
delta y
  time 
time in seconds
  options 
cachingmode (0,or 2) + blockcheck (or 0) +
    
informmewhendone (or 0) + applydirection (16 or 0)
  
This moves the npc without needing you to update the
  position of the npc 
'manually' by changing x and y.
  
To move an npc 10 tiles to the rightthen 10 tiles to
  the left 
and againjust do following:
  if (
created) {
    while (
true) {
      
move 10,0,4,0;
      
sleep 4;
      
move -10,0,4,0;
      
sleep 4;
    }
  }
  
This moves the npc 10 tiles to the rightthen waits 4
  seconds
then moves it 10 tiles to the leftthen waits
  4 seconds
, and repeats this endlessly.
  
The good thing is that this also works with server-side
  npcs 
and makes them look like they are moved on client-side.
  
There are also nice options to makes things very simple:
  - 
cachingmode:
    - 
0previous movements will be finished immediatelly
    
1movements will be cachedthe 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
    
2the movement will just be appended to the movement
         
list; you can add up to 100 movements
  
blockcheckadd 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.gwalking in a different direction)
  - 
applydirectionadd 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 02-11-2013, 05:34 AM
Vatec Vatec is offline
Lurking
Join Date: Oct 2012
Posts: 27
Vatec is on a distinguished road
Thanks Dusty.
__________________


Quote:
Originally Posted by GULTHEX View Post
so i think the problem is that onactionclientside isint a real function
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:30 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.