Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Skyld's Magic Ship (https://forums.graalonline.com/forums/showthread.php?t=134265746)

Skyld 02-12-2012 07:41 PM

Skyld's Magic Ship
 
4 Attachment(s)
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!


Emera 02-12-2012 07:42 PM

:O YAY! I was going to ask for this later cause I had an idea for it :P Thanks.

callimuc 02-12-2012 07:50 PM

Hah that funny thing ^^ I like it. Only thing are the missing ganis but everyone can change them ^^

xXziroXx 02-12-2012 07:51 PM

Care to submit a youtube clip, demonstrating how it looks? :o

fowlplay4 02-12-2012 08:03 PM

Should probably attach the ganis and images too, and I second that request for a Youtube demo.

Skyld 02-12-2012 08:19 PM

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.

Fulg0reSama 02-12-2012 08:21 PM

this what I pictured when I checked this thread out.
http://islandlife808.com/wp-content/...School-Bus.jpg

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 :p (Images included obviously)

Emera 02-12-2012 10:51 PM

1 Attachment(s)
I've just made a very, very quick loopable sound for the ship. Just if anybody is interested <3 Have fun.

kalabar24 02-13-2012 12:20 AM

Skyld, what do you use to record your computer screen?

Skyld 02-13-2012 01:07 AM

Quote:

Originally Posted by kalabar24 (Post 1684414)
Skyld, what do you use to record your computer screen?

QuickTime X.

BlueMelon 02-13-2012 02:32 AM

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

Skyld 02-13-2012 02:37 AM

Quote:

Originally Posted by BlueMelon (Post 1684419)
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.


All times are GMT +2. The time now is 04:41 AM.

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