Members | Sign In
All Forums > Mission Scripting
avatar

Code Snippet: Jump Drive for Missions!!!!!

posted Apr 26, 2013 04:03:16 by lucas99801
1899 lines of code. Thanks to Hissatsu and Excel (and RussJudge's upkeep) very few of those had to be typed by hand =D.

Hissatsu and RussJudge, you're the men!

https://dl.dropboxusercontent.com/u/71458368/MISS_JumpDriveTest.zip

Hey guys, I'm pretty pumped about this. I've been working on creating a jump drive to be used in missions over the past two days and I've finally finished!

So here's how it works. Helm has control (as they should) and there are two methods of coordinate selection:

Rough:
Numpad keys select your 8 cardinal directions.
C - 10km
V - 20km
B - 30km
N - 40km
M - 50km

Precise:

Left/Right arrow keys Decrease/Increase Heading by 5 degrees
Up/Down arrow keys Increase/Decrease Distance by 1000m

Pressing Z at any point will return your current jump coordinates
Pressing X initiates the jump (8 seconds countdown)
Pressing H during the countdown will cancel your jump

Energy consumed is calculated based on the current difficulty level and distance traveled. Values roughly approximate the values used in Invasion mode (50k on lvl 10 consumes 610 energy). Exact formula is included in the README.txt

The README provides instructions on use, as well as a little extra information regarding the script and how to include it in your missions.

I've put at least 10 hours into this, so I hope it gets plenty of use, most of those 10 hours though were spent fixing my math errors regarding heading (I was thinking Cartesian plane from Geometry, which is rotated about the line y=x compared to the Dial on Artemis)

Let me know if you download/use it. And feel free to ask for help incorporating it into missions!
[Last edited Apr 26, 2013 04:36:26]
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
page   1
9 replies
avatar
lucas99801 said Apr 26, 2013 04:40:32
[bump]ing before I bury the thread with replies in others.
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
ZacharyDanielBringham said Apr 26, 2013 22:14:39
This is pretty awesome. I love that you put in the functionality to adjust the course from just the 8 cardinal and ordinal directions.
I was just thinking that it'd be cool if you could store a preset jump or 2, like engineering presets. There are a lot of times where you just want a fast escape, 10k or so in a certain direction, so it'd be cool if that was just one button.
I know I could write that into a mission script, of course, but I think that might be a cool feature. Kind of an emergency jump. OR, awesome idea, you could have an actual emergency jump where it doesn't take the time to spin up the FTL drives and calculate a destination, but rather jumps immediately a random distance in a random direction. Risk v reward, in case you are getting overwhelmed and need to get out quickly, but you might hit a minefield or asteroids or something.
avatar
lucas99801 said Apr 26, 2013 22:20:45
Awesome suggestions!

Emergency jumps sounds interesting. would be super easy to incorporate now that i have the trig taken care of, haha.

Want me to write it up?
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
ZacharyDanielBringham said Apr 26, 2013 22:28:49
If you don't mind.
I looked through your code and realized that if it would support loops, trig functions, and variable outputs in message boxes, you could have cut your code down to maybe 500 lines. I'm rather impressed with the lengths you went to to produce this.

avatar
lucas99801 said Apr 26, 2013 22:32:51
haha yeah. i had about 15 free hours. Excel did all the trig for me. set up columns for degrees, sine, cosine, and even the XML, then just drag-filled the XML column

debugging took the real work
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
lucas99801 said Apr 26, 2013 23:04:11
Here ya go buddy.

https://dl.dropboxusercontent.com/u/10193809/MISS_JumpDriveWithOhShitKey.xml

J key initiates a 2 second Jump in a random direction with range of 10-30k. Incurs 25% damage to Warp/Maneuver for being a weakling. (if either of those systems are damaged beyond 25% you would actually get a boost... may need to fix that).

Nonetheless, hope you enjoy. And this also enable you to create exact Direction increments by changing the +5 and -5 to +1 and -1 in the Left/Right key events.
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
ZacharyDanielBringham said Apr 27, 2013 00:47:01
Awesome, thank you! I may try and test this out tonight if I get a chance

One suggestion: Have the 5 key on the number pad reset the Distance, (or even the distance and direction) to 0. I know setting the direction to 0 is the 8 key, but if you accidentally set the distance to 10k and you wanted 1 or 2k, it'd be quicker to start from 0.

I actually coded up something to simulate this in Excel VBA after I looked at your code. It works pretty well, but that's because VBA is a lot more powerful than the limited XML we get to use for Artemis coding.

My hat is still off to you, sir!
avatar
lucas99801 said Apr 27, 2013 00:50:46
I actually didn't have time to test it. So i may have missed something, but hopefully i didn't! Also, I've never used VBA/Wxcel VBA
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
lucas99801 said Apr 27, 2013 03:02:04
Warning! The script I posted earlier was bugged Zach. Re-download the new version, all bugs are fixed :)
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
Login below to reply: