EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[SCR] Safe undocking / jumping (v1.00, 08.04.12)
Post new topic Reply to topic Goto page 1, 2, 3  Next
View previous topic :: View next topic
Author Message
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
modified
PostPosted: Sun, 8. Apr 12, 17:45    Post subject: [SCR] Safe undocking / jumping (v1.00, 08.04.12) Reply with quote Print

English / Deutsch (no text - works in every language)


Safe undocking / jumping . . . Written for AP. Not tested with TC.

Ever since Reunion came out, there have been certain ships that would explode when the player manually undocked them from certain stations.
This only got worse with TC and AP, since more and bigger ships and stations entered service.

I fixed it.


What this script does:

If the playership manually undocks from anything or enters a new sector by any means, it's collision detection is disabled.

Collisions are reenabled if any of these conditions is true:
  • autopilot is enabled
  • ship's speed is reduced
  • ship's course is changed (10° dead zone for the benefit of joystick users)
  • ship is clear of the closest ship, station, gate, and asteroid.
    (these 4 objects are searched for once, at the moment of launch)
  • the player changes ships
  • the player goes to a different sector or docks somewhere
  • 60 seconds expire


There are no watcher scripts constantly running in the background.

Not only does this fix the typical issue of undocking a Khaak Corvette from a Kyoto or many stations, it also avoids other stupid situations.
If you emerge from a gate in a TM and immediately launch in a fighter, you are usually catapulted straight into the gate superstructure. This can no longer happen since gates are one of the 4 types of checked navigational hazards.
If you emerge from a gate and find yourself inside another ship, don't panic and don't touch anything. Strafe (that is not a course change) or accelerate away.


The inspiration for this script was this. I just didn't agree with the way they did it. =P


Download: ZIP

Installation: extract the ZIP into the "X3 Terran Conflict" folder. The correct folder structure is already included.


Resources used: none


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.


Last edited by Gazz on Sun, 8. Apr 12, 18:12; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Sun, 8. Apr 12, 17:46    Post subject: Reply with quote Print

*** reserved ***

Back to top
View user's profile Send private message Visit poster's website
greypanther





Joined: 24 Nov 2010
Posts: 1113 on topic

Thank you for registering your game
PostPosted: Sun, 8. Apr 12, 19:53    Post subject: Reply with quote Print

Does that mean I can download it the same way and try it with TC? Or wouldn't you recomend it? Smile


_________________
Pray there's intelligent life somewhere up in space, cos there's bugger all down here on earth.
Back to top
View user's profile Send private message
Jumee





Joined: 29 Oct 2011
Posts: 2204 on topic

Thank you for registering your game
PostPosted: Sun, 8. Apr 12, 19:56    Post subject: Re: [SCR] Safe undocking / jumping (v1.00, 08.04.12) Reply with quote Print

Gazz wrote:
I fixed it.


and I salute you! Thumb up Very Happy

Back to top
View user's profile Send private message
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Sun, 8. Apr 12, 20:54    Post subject: Reply with quote Print

greypanther wrote:
Does that mean I can download it the same way and try it with TC? Or wouldn't you recomend it? :)

Oh, it would work.
The only thing I'm not sure about is if all the find instructions (for gates etc.) will return the correct result. The rest is pretty standard fare so at least most of it should work.

If you uncomment the "Debug" line at the top of the script, you get a running documentary of what the script does (in a log file), including what it has successfully detected.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
greypanther





Joined: 24 Nov 2010
Posts: 1113 on topic

Thank you for registering your game
PostPosted: Sun, 8. Apr 12, 22:03    Post subject: Reply with quote Print

Thank you, then I will give it a try I think. I have decided TC next with mods. I will play AP when Argonaught completes his conversion of his menagerie shipyaed. I presume nothing catastrophic will happen, but will come and rant at you if it does! Wink


_________________
Pray there's intelligent life somewhere up in space, cos there's bugger all down here on earth.
Back to top
View user's profile Send private message
Vayde





Joined: 06 Feb 2004
Posts: 828 on topic
Location: England,UK
Thank you for registering your game
PostPosted: Mon, 9. Apr 12, 11:30    Post subject: Reply with quote Print

Nice work, simple and elegant.

As an aside could this also be ran on ships owned by the player when player is in sector. So when I do go back to terran sectors my Spingblossoms don't explode when undocking?


_________________
DDTC

Please visit us at the DDTC Forums or HERE at our Egosoft thread.
Back to top
View user's profile Send private message
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Mon, 9. Apr 12, 14:58    Post subject: Reply with quote Print

Ships under AI control have their collision detection turned off by the engine.
That's why you can easily dock your oversized ship in a Kyoto since docking is usually done via autopilot = AI control.

Merely "switching to" a ship on your carrier launches you under manual control. Boom.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
feygan





Joined: 26 Dec 2003



PostPosted: Mon, 9. Apr 12, 16:41    Post subject: Reply with quote Print

How does this work alongside the advanced navigation script? I know that has a collision switch for when ships exit from a warp gate, do the two conflict?

Back to top
View user's profile Send private message Send e-mail
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Mon, 9. Apr 12, 18:29    Post subject: Reply with quote Print

No idea. I never used that script.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Fri, 13. Apr 12, 13:30    Post subject: Reply with quote Print

Vayde wrote:
When in an m5 and undocking from lets say Terracorp HQ, should I drop a few feet from the docking clamp then accelerate to top speed and fly through the station superstructure instead of following the normal exit lane lights?

I almost shit a brick the first time it happened :)

The real problem is that often there is no proper alignment when launching manually.

The script simply employs a WHATEVER, GET ME OUTTA HERE strategy, getting you clear of any object you launch from, regardless of any physical collision woes.
If the game allows a ship to dock at [object], the ship should also be able to safely launch from [object]. KISS.

To do that in a pretty, graphically correct way, you'd have to alter the engine and most likely a lot of models. Not my problem field. =)


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
Charon_A





Joined: 06 Nov 2002

Location: Argon Prime

PostPosted: Sun, 13. May 12, 19:53    Post subject: Reply with quote Print

Gazz, first of all thanks for the script!
But the issue with flying through the station structure afetr undocking is indeed unnerving Smile
So I decided to remove the script - alas, that part is not that easy. Having deleted "setup.gz.safe.undocking.xml" I can't make a jump to any sector - game hangs with the black screen before rendering the sector I am jumping into. Tried several ships. I am using Albion Prelude, latest patch. Any ideas how to properly remove the script without hanging the game? Thanks!


_________________
Be careful about reading health books. You may die of a misprint.
---Mark Twain---
Back to top
View user's profile Send private message
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Mon, 14. May 12, 18:05    Post subject: Reply with quote Print

The easiest way would be to edit the script and copy / paste a "return null" to the first line of the script.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
Charon_A





Joined: 06 Nov 2002

Location: Argon Prime

PostPosted: Thu, 17. May 12, 15:57    Post subject: Reply with quote Print

Gazz wrote:
The easiest way would be to edit the script and copy / paste a "return null" to the first line of the script.


Thanks Gazz! Your suggestion worked.
For those who might wonder where exactly to insert "return null" if you edit script directly - it should go between these lines:
Code:

<![CDATA[
  return null
  *$Debug = 781



_________________
Be careful about reading health books. You may die of a misprint.
---Mark Twain---
Back to top
View user's profile Send private message
Gazz
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 13 Jan 2006
Posts: 12408 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Sun, 20. May 12, 21:35    Post subject: Reply with quote Print

Well, the reason was that the script was still being called ingame but the call went to lala land because the script was gone.
Lala land is undefined in the scripting engine so that's not going to work.
Having the script called properly... but not doing anything whatsoever... is a lot safer.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Wed, 26. Nov 14, 20:25

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2009
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.17172 seconds, sql queries = 74