[SCRIPT] Dogfight Helper: Match Speed of Target, V 1.1 Released, 6/9/2006

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply

Should this plugin be updated?

A. Add target angle/trajectory matching
8
27%
B. Change the plugin so it works for distances > 2km
3
10%
C. Force exact speed matching rather than using the autopilot's speed matching controls
1
3%
D. A and B
2
7%
E. A and C
2
7%
F. B and C
3
10%
G. A, B and C
11
37%
 
Total votes: 30

DesertEagle
Posts: 117
Joined: Thu, 2. Feb 06, 06:32
x3

[SCRIPT] Dogfight Helper: Match Speed of Target, V 1.1 Released, 6/9/2006

Post by DesertEagle » Thu, 8. Jun 06, 10:33

Update 3: Heh, we're in 2011 and I'm almost done with a PhD. How time flies. Anyway, at some point along the way, I figured out that the solution I wanted to implement would not work with the current engine. I mean, it would work for about 10 minutes, and then would crash the game due to some complexities with locking and recursion. Oh well. I have fixed the links for this plugin if anyone wants to use it standalone.

Update 2: Can't say this is the world's most popular plugin, but I'll start working on adding in the modifications.

Hello - It's now 2008! Hard to believe I wrote this script a couple of years ago. Well, time marches on. I have added a poll to determine whether you want changes/improvements to this script.

===========================================
Name: Match Speed
Version: V1.1
Author: Desert Eagle
Updated: 6/9/2006
===========================================
Description:

It's a dogfighting aid. It adds a hotkey so that you can quickly
match the speed of your target at close range (0-2K).

It is quite fun to hover ten meters behind your opponent,
just out of reach of his turret, weapons primed.
===========================================


Zip file:
http://www.travisgood.com/MatchSpeed.zip

Cycrow Installer (spk) File:
http://www.travisgood.com/MatchSpeed.spk

At the moment, English language only.
No special requirements. Should be compatible with
every script / mod out there because it doesn't use
any command slots or text files.

A reasonable effort has been made to test this software.
Your feedback is appreciated.

________________________________________________________________
Version History:
1.1 - Based on a tip from Red Spot, rebuilt the script so it only
uses one hot-key instead of two, and doesn't lock the max speed.

1.0 Beta - The first publicly available version was a proof
of concept and had a couple of minor odd behaviors.
________________________________________________________________


Background:
I developed these scripts because I view the 'Match Speed of Target'
command as a standard space genre feature; its absence from
the retail build of X3 is puzzling.

Instructions:
[If you already have version 1.0 installed,
please run the Uninstall script, and then exit X3
before installing 1.1.]

Use Cycrow's installer, or unzip the scripts directory into
the scripts directory of your Egosoft folder.

You will need to bind one hot key in order to use the script.
To do so, go to Options-->Controls (the joystick icon),
and then proceed to the Interface tab.
Scroll all the way to the bottom of the interface tab and you
will see the new command:
1) Match Speed of Targeted

Now, by pressing the "Match Speed" key, you wil set your maximum speed to the current speed of the targeted ship. Note that you may need to press the key again if your opponent changes speed. Also note that the
feature is intelligent enough to slow you down a bit if using it
would cause you to crash into the other guy. That said, hovering is
still risky business!

Un-installation:
To uninstall, run MatchSpeed.Uninstall from the scripts menu.


*******
Thanks to Egosoft and the great X3 Scripting Community, including all those who have answered my questions over the past several months.

Thanks to Red Spot for his tip for improving this script.
Shouts to Nirwin.
Last edited by DesertEagle on Sun, 5. Jun 11, 18:17, edited 11 times in total.

User avatar
nirwin
Posts: 1185
Joined: Wed, 2. Nov 05, 00:07
x3tc

Post by nirwin » Thu, 8. Jun 06, 10:36

DE you dark horse you!

Fantastic, I was positively baffled by the lack of such a feature too, but it simply NEVER occured to me to make such a feature.

Am I to assume you can assign the command to a mappable key? (edit: d'oh if I had read all of your post before excitedly replying I wouldn't have needed to ask that question, please ignore)

I will certainly try this out tonight.

Thanks
Nirwin
------
Sector Takeover | Unlimited Resources (x2/x3)

User avatar
Red Spot
Posts: 3224
Joined: Fri, 4. Feb 05, 14:44
x3

Post by Red Spot » Thu, 8. Jun 06, 12:12

just had a looksee at your script ..

nice .. but your forgetting something ..

you do not have to build this into a loop ..
if the player has the AP on and is following something his/her ship will auto. follow at the targets speed ..
so you dont have to do anything there ..
(ooh .. just recalled .. do NOT run this when AP is on ... the result will be that your ship will eventually come to a stop and stays on AP at 0 speed untill you take action ... you can not have 2 'move commands' on 1 ship at the same time ..(perhaps build in a check if 'task 0' is in use))

now when you do not have AP on this can be a very handy tool ..!!
but you would only have to do it once ..
than the players ship will start flying that speed .. and as nothing tells it to speed up again it will stay that speed .. untill the player decides otherwise ..

now if you drop the loop .. you can also drop the 'deactivate' HK ...;)


G

DesertEagle
Posts: 117
Joined: Thu, 2. Feb 06, 06:32
x3

Post by DesertEagle » Thu, 8. Jun 06, 14:23

aha! You picked up on the complexity involved with my little hack. What you write sounds good in terms of killing the loop. I'll have a look at modifying the script after work today to see if I can't make the code that much simpler.

Cheers,
DE.

Edit:
Done with updating. Putting up version 1.1. Stable release.

999-JAY-999
Posts: 610
Joined: Mon, 7. Apr 03, 16:29
x3tc

Post by 999-JAY-999 » Fri, 9. Jun 06, 17:15

Well done.... simple yet an evil little script.... BRILLIANT.
System Spec :-

AMD Athlon(tm) 64 Duel 6000+ (3.01GHz)
Windows XP Home Ed. SP 3
ATI Radeon HD 4850 (512)
Creative X-FI Soundard
2.00 GB of RAM
G9 RAZOR Mouse

User avatar
nirwin
Posts: 1185
Joined: Wed, 2. Nov 05, 00:07
x3tc

Post by nirwin » Sat, 10. Jun 06, 09:35

Just tried this script out (choosing a key for it was hard, everythings in use).

I noticed that you supplied a file with the package that I already had in my scripts directory (x2Scripts.xml or something like that), which was not any different from the version I have, did you add that file to the package in error?

Also, when activating the command, I would often be a couple of m/s off of the targets speed. And in case you think it was because the ship was altering speed, I tried it with a crate that was sitting around in space, it was moving a a speed of 0 and this command set my speed to 2.

However, this problem was not a show stopper and the command would certainly have been good enough for use in a dog fight.

Congrats on the good work.
Nirwin
------
Sector Takeover | Unlimited Resources (x2/x3)

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 20579
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Sat, 10. Jun 06, 12:29

the x2scripts.xsl file is the xml stylesheet, it allows you to load the xml files into IE to view them, it should already come with X3, its not needed to actaully use the scripts

DesertEagle
Posts: 117
Joined: Thu, 2. Feb 06, 06:32
x3

Post by DesertEagle » Sat, 10. Jun 06, 15:01

Hey there Nirwin,
oops...yes, I used that file to review my scripts. I guess I left it in there by accident; I just replaced the zip package. The speed discrepancy is due to Egosoft's implementation of the 'follow' command. The other way of doing it would fix the max speed of your ship at the max speed of the other craft; it is very precise, but it requires two hotkeys, or two presses of the same hotkey, because it needs to be reset. That's what I changed between beta and release.

I tried a number of different techniques to change the 'follow' behavior, but I think it's hard coded. Fortunately, it's pretty easy to increase your speed just a tad after hitting the button if need be.

If anyone figures out a further workaround, or if you want the version with the more accurate max speed behavior back, let me know. This one works pretty well for my purposes.

Thanks for the feedback! I'm spending some quality time with the debugging library right now.

All the Best,
DE

nirwin wrote:Just tried this script out (choosing a key for it was hard, everythings in use).

I noticed that you supplied a file with the package that I already had in my scripts directory (x2Scripts.xml or something like that), which was not any different from the version I have, did you add that file to the package in error?

Also, when activating the command, I would often be a couple of m/s off of the targets speed. And in case you think it was because the ship was altering speed, I tried it with a crate that was sitting around in space, it was moving a a speed of 0 and this command set my speed to 2.

However, this problem was not a show stopper and the command would certainly have been good enough for use in a dog fight.

Congrats on the good work.

User avatar
©ArtBlade
Posts: 892
Joined: Sat, 26. Nov 05, 22:49
x3

Post by ©ArtBlade » Sat, 10. Jun 06, 23:29

interesting script. Will have a closer look :)

So far, just reading it, I think you erm lost something somewhere...

Code: Select all

006    [PLAYERSHIP] -> start task $TaskID with script 'a.focusmeSTOP' and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
There is no "a.focusmeSTOP" in the zip :)
wondering how to reverse a reversed sleep pattern
My Scripts (English + Deutsch)
I am not impatient. I just live fast

DesertEagle
Posts: 117
Joined: Thu, 2. Feb 06, 06:32
x3

Post by DesertEagle » Sun, 11. Jun 06, 06:52

Hi,
it was in the beta, but not in this version. It is only referenced in the restart script, which gets passed a ref code... so since the ref code isn't passed, that task doesn't get called.

Thanks for looking! And let me know if you find other stuff.

Cheers,
DE

bob hope
Posts: 1431
Joined: Wed, 6. Nov 02, 21:31
x3

Post by bob hope » Sat, 14. Oct 06, 11:32

if you notice there is a ware that is never used by the game, its called M.A.R.S. - this was the original upgrade from xbtf and xtension that did what this programme does, it was called the motion analysis relay system.

nice to see this is back in one form or another :thumb_up:

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 20579
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Sat, 14. Oct 06, 13:53

actually MARS, is just tecnically the auto pilot, so it is in the game.

in X2 it was just called the Autopilot instead of MARS

bob hope
Posts: 1431
Joined: Wed, 6. Nov 02, 21:31
x3

Post by bob hope » Sat, 14. Oct 06, 22:13

when i ever actually bothered using it in xbtf it would keep speed with the ship you were following at the range you activated it, by the end i just used the accellerate and decellerate keys instead

Neskiairti
Posts: 35
Joined: Thu, 29. Nov 07, 19:58
x3tc

Post by Neskiairti » Sat, 16. Feb 08, 17:19

matching speed at only 2km seems kinda silly to me.. if i can read their speed.. i can match it :P matching trajectory, speed, and rotation on the other hand would be another story..

how would i make it to be atleast 15km?
Eeep! it got me again!

DesertEagle
Posts: 117
Joined: Thu, 2. Feb 06, 06:32
x3

Should I update the script?

Post by DesertEagle » Mon, 18. Feb 08, 03:18

Hey,
I noticed your message. It has been awhile since I've been on these forums. Is this a desired behavior - matching speed / angle of rotation with target?
If so, then I can definitely think of a way to implement it. I'll put a poll up on the page.

Cheers,
DE
aka
T. Good

Post Reply

Return to “X³: Reunion - Scripts and Modding”