Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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, 342 views)
File Type: gani skyld-flyer_nowarp.gani (1.1 KB, 197 views)
__________________
Skyld

Last edited by Skyld; 02-12-2012 at 08:19 PM..
Reply With Quote
  #2  
Old 02-12-2012, 07:42 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
:O YAY! I was going to ask for this later cause I had an idea for it :P Thanks.
__________________
Reply With Quote
  #3  
Old 02-12-2012, 07:50 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Hah that funny thing I like it. Only thing are the missing ganis but everyone can change them
__________________
MEEP!
Reply With Quote
  #4  
Old 02-12-2012, 07:51 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Care to submit a youtube clip, demonstrating how it looks? :o
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #5  
Old 02-12-2012, 08:03 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
Should probably attach the ganis and images too, and I second that request for a Youtube demo.
__________________
Quote:
Reply With Quote
  #6  
Old 02-12-2012, 08:19 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
Wasn't sure if anyone would be bothered by the images, but I've uploaded them and the GANI to the original post. Also attached a couple of youtube videos.
__________________
Skyld
Reply With Quote
  #7  
Old 02-12-2012, 08:21 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
this what I pictured when I checked this thread out.


But other then that, this is pretty cool as hell.

I might send you a gani that you'd possibly get a bigger kick out of for use on that (Images included obviously)
__________________

Careful, thoughts and opinions here scare people.

Last edited by Fulg0reSama; 02-12-2012 at 08:42 PM..
Reply With Quote
  #8  
Old 02-12-2012, 10:51 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
I've just made a very, very quick loopable sound for the ship. Just if anybody is interested <3 Have fun.
Attached Files
File Type: zip emera_skyld-ship-humming.zip (616.2 KB, 155 views)
__________________
Reply With Quote
  #9  
Old 02-13-2012, 12:20 AM
kalabar24 kalabar24 is offline
stuff and stuff
Join Date: Oct 2011
Location: USA
Posts: 29
kalabar24 is an unknown quantity at this point
Send a message via AIM to kalabar24
Skyld, what do you use to record your computer screen?
__________________
And that is why i dumpster dive with my great aunt Bertha.
Reply With Quote
  #10  
Old 02-13-2012, 01:07 AM
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
Quote:
Originally Posted by kalabar24 View Post
Skyld, what do you use to record your computer screen?
QuickTime X.
__________________
Skyld
Reply With Quote
  #11  
Old 02-13-2012, 02:32 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Is this what the helicopter on Era uses? I never knew who made that code but it works pretty nicely as you can set custom X/Y coords... it acts the same way as yours :O
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #12  
Old 02-13-2012, 02:37 AM
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
Quote:
Originally Posted by BlueMelon View Post
Is this what the helicopter on Era uses? I never knew who made that code but it works pretty nicely as you can set custom X/Y coords... it acts the same way as yours :O
Yes, that's the same code.
__________________
Skyld
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 10:58 AM.


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