Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-12-2012, 07:41 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Skyld's Magic Ship

I've decided to post this because quite a few people seem to have fun playing with it and have expressed interest in the code. Plenty of Era players will be familiar with this!

The script demonstrates how an NPC can move smoothly to a given target location at a set speed, and how it can adjust speed in order to try and land as close to the target coordinates as possible. The landing position is not completely exact, but it should be close enough for most purposes. So far I haven't seen the CPU usage of the script go above 0.06% even mid-movement, so I think it should be fairly safe.

Hopefully this will help someone to create some interesting moving ships or planes or similar.

The onPlayerChats function gives some examples of how you can issue instructions to the script, but you'll probably want to remove that and replace it with your own logic. The onCreated function contains a couple of configuration parameters, and you can adjust the animations at the top of the timeout.

Enjoy!

Attached Images
  
Attached Files
File Type: txt ship.txt (5.5 KB, 414 views)
File Type: gani skyld-flyer_nowarp.gani (1.1 KB, 243 views)
__________________
Skyld

Last edited by Skyld; 02-12-2012 at 08:19 PM..
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 08:57 PM.


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