External Docking Sorted (real, no scripting) + Custom Asteroid Base (pix)

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

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

Post Reply
User avatar
DeadlyDa
Posts: 1881
Joined: Mon, 5. Jan 04, 05:46
x4

External Docking Sorted (real, no scripting) + Custom Asteroid Base (pix)

Post by DeadlyDa » Fri, 6. Jan 06, 07:22

Ok...progress of sorts.

I've put in a ton of time and energy into my R&D efforts trying to understand how X3 worked. I had managed to create custom turrets with moving parts, and several custom docking facilities (internal and station). Unfortunately, my method was massively complicated and when I tried to apply it to creating a simple external docking facility, it turned into an exercise in futility. I ended up wasting a huge amount of time without any success.

During an exchange with Doubleshadow I mentioned it...and he leaped to the rescue with a simple 1-line fix :D Man, did I feel stupid...I probably wasted 30-40 hours on that one :oops:

(Well, it's not wasted I guess, since I now know how to do custom docking facilities with full automation :roll: )

Before I go further, a word of warning....

If you haven't been playing around with the new type files...and are not already reasonably comfortable with basic ship modding, the following won't make much sense. If you do find this "heavy going", you should take a bit of time to look at the scripting and modding information which is posted in the old X2 forums...most of it is directly applicable to X3.

OK...before getting out your secret squirrel decoder rings, here is a bit of eye-candy to keep you interested :D

First, the custom asteroid base that will be included in the ship mod I will soon be releasing (see this thread http://forum2.egosoft.com/viewtopic.php?t=118210 ).
Image

...and an inside view of the fighter hanger bay:
Image

Here are some shots of the external docking. As you can see, I have implemented 2 separate docking parts; one for fighters only, and another that will handle M6, TP, and TS class ships.

Image

Image

Image

OK...here we go...

First, a quick look at the "complicated" approach, which involves modifications to both Dummies.txt and CutData.txt.

The best way to understand how to do this is to open those two files in a text editor, and follow the definitions of the old X2 00079.bod docking part by using the example of the "dock5port" docking facility.

The way it works is:
  • 1. The old 79 part is defined in Dummies.txt in section SDTYPE_DOCK, and references the part 9009.
    2. The 9009 part doesn't physically exist, but via the CutData.txt file references the "stations\docks\dock5portsscenetemp" bod file.
    3. The "stations\docks\dock5portsscenetemps" is an embedded bod (scene) file which includes 5 19023 objects (which turn out to be the actual docking arm scenes).
    4. The 19023 objects are defined in the SDTYPE_ANIMATED section of Dummies.txt, and in turn reference part 9010.
    5. The 9010 part is another "virtual" part that, via the CutData.txt file references the actual "stations\docks\dock5ports_arm_scene" scene file.
Whew! Well, along comes Doubleshadow to the rescue :D

He found a simple 1-line fix that works just like the old X2 external docking port. There aren't any cool X3 animations, but it is simple and works perfectly.

What he found was that you could add a single line to the SDTYPE_ANIMATED section of Dummies.txt that references a renamed version of the 00535.bod part (which is the reference part for fighter docking positions). See the two line I have included below for a couple of "live" examples.

DS and I have been playing around with the various flags in Dummies.txt, and here is what we have found so far:

For ship flags:
  • ++ ANIMATEDF_DOCKPORT_FIGHTER - allows M5, M4, and M5 class ships to dock.
    ++ ANIMATEDF_DOCKPORT_STANDARD - allows M5, M4, m3, M6, TP, and TS class ships to dock.
    ++ ANIMATEDF_DOCKPORT_HUGESHIP - Support for M1, M2, and TL class ships.
For the docking action/capabilities flags:
  • ++ ANIMATEDF_DOCKPORT_UDDOWN - ship will be pushed "down" slightly - like what you see when you undock from a station (other than trading stations, which use launch ports).
    ++ ANIMATEDF_DOCKPORT_BELOW60 - controls the angle of the docking guidance lights, and rotates them down by 60 degrees.
    ++ ANIMATEDF_DOCKPORT_HANGAR - ship will "disappear" when docked, like at trading stations and capital ships.
    ++ ANIMATEDF_DOCKPORT_STARTONLY - These ports are only used for launching ships (usually fighters).
    ++ ANIMATEDF_DOCKPORT_LANDONLY - These ports will only be used for docking a ship, and need to be used in conjunction with one or more ports defined with the "STARTONLY" flag.
    ++ ANIMATEDF_DOCKPORT_QUICKLAUNCH - This will cause the ship to depart the dock at full speed
It doesn't take a rocket scientist to see that there may well be a number of flags we know nothing about. Also, by defining new flags, and implementing code to handle them, Egosoft can easily add additional functionality.

One thing to remember when adding lines to Egosoft type files; make very sure you check for the presence of a line count at the beginning of a file or section of a file. For example, simply adding lines to a section of Dummies.txt is a useless exercise unless you also increment the line count for the section. Having said that, not every type file has this constraint...so it's up to you to check.

For my soon-to-be-released mod, here are the two lines I have added to the SDTYPE_ANIMATED section of Dummies.txt:

Code: Select all

ships\props\new_535_ExtDock_dummy;ANIMATEDF_DOCKPORT_FIGHTER;0;
ships\props\new_TP-TS_ExtDock_dummy;ANIMATEDF_DOCKPORT_STANDARD;0;
If you just want to use the parts I have built, I should have the first release of my ship/station mod out this weekend, and it will include at least the above two lines. I have also added in a double laser turret (modeled on the old 00091.bod part from X2) with full rotation...like the Egosoft-supplied "big_turret" weapon.
ImageImage
- Also check out the DDTC Forums, and the X-Wiki

unfunfofmpc
Posts: 296
Joined: Sat, 12. Nov 05, 20:37
x3

Post by unfunfofmpc » Fri, 6. Jan 06, 08:34

Wow, nice stuff indeed. Get rid of those ugly black/white textures at the bottom of the grendel :P. Anyway, what exactly will this ship-mod include?

AalaarDB
Posts: 2279
Joined: Thu, 29. Jan 04, 09:19
x3tc

Post by AalaarDB » Fri, 6. Jan 06, 08:56

If you ever want to join the military, or become a space mogul, here's a tip. Do not post a picture of your base with an arrow pointing to the super secret hidden entrance!!!!

X-it
Posts: 1217
Joined: Wed, 6. Nov 02, 21:31
x3

Post by X-it » Fri, 6. Jan 06, 09:29

LOL AalaarDB! :D

DeadlyDa, this looks amazing! :o M3 docked with an M6 docked with an M2. Love it!

And we can actually fly around inside the docking bay like in X2/X-t? Excellent! Off to find a suitable asteroid now. Cheers!

bendyspex
Posts: 708
Joined: Tue, 13. Apr 04, 10:39
x3

Post by bendyspex » Fri, 6. Jan 06, 09:40

Amazing, especially since I have just taken over New Income, and need a base for my Teladi Massacre :twisted: . Any idea when this will be release, and will the M3 docking to an M6 be for all ships, and the same for M6 to M2.
Great work :D

CCA
Posts: 80
Joined: Sat, 7. Feb 04, 18:48
x3tc

Post by CCA » Fri, 6. Jan 06, 09:43

This looks awesome, I will finally be able to set up my secret special forces base now :D.

User avatar
twistedtech
Posts: 156
Joined: Mon, 3. Nov 03, 01:34
x3tc

Post by twistedtech » Fri, 6. Jan 06, 11:19

Absolutely out-******-standing!

Brilliant!!
Try not to let your mind wander... It is too small to be out by itself.

doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 09:14
x3

Post by doubleshadow » Fri, 6. Jan 06, 11:51

Why do I have to read the forum to find out what are you up to? ;)

I want that mod too! :D
Last edited by doubleshadow on Fri, 6. Jan 06, 14:53, edited 1 time in total.

User avatar
-XTM-
Posts: 1277
Joined: Sat, 12. Nov 05, 20:46
x3

Post by -XTM- » Fri, 6. Jan 06, 12:26

Very impressive research!!!
The Xtended Mod

Need Help?

Ask Questions / View the FAQ's at TheXUniverse Forums
Read the News on Mod Developments at our Website

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

Post by Red Spot » Fri, 6. Jan 06, 12:28

awesome Deadly .. :o

makes me wonder .. :roll:

I'm working on a 'produce my own fighters' script ..
but using the PHQ .. wich s^(ks ..

now I'll make it with that anyway .. but if I could, in time, hook it up to your own 'secret astroid ship production plant' that would be even better .. :roll:

(I'll ask you in time .. :D )


G

Kvalyr
Posts: 330
Joined: Sun, 1. May 05, 15:56
x4

Post by Kvalyr » Fri, 6. Jan 06, 14:42

Excellent work, DeadlyDa and Doubleshadow, Kudos to you both. :D


Can external-docking only be applied to new/edited ship models or could it be applied to existing M6s etc without model-editing?

What I mean is; does it only require you to edit existing text/xml files to allow external docking of small ships on M6/etc or do the models of the M6s need to be edited to add docking-tags/locations, as well as editing the text files?

doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 09:14
x3

Post by doubleshadow » Fri, 6. Jan 06, 14:56

Zurechial wrote:Excellent work, DeadlyDa and Doubleshadow, Kudos to you both. :D


Can external-docking only be applied to new/edited ship models or could it be applied to existing M6s etc without model-editing?

What I mean is; does it only require you to edit existing text/xml files to allow external docking of small ships on M6/etc or do the models of the M6s need to be edited to add docking-tags/locations, as well as editing the text files?
You have to edit the ship's scene file to add the docking point. Ironically, the old X2 ships can work right away, you would just have to change the types/Dummies.txt.

Kvalyr
Posts: 330
Joined: Sun, 1. May 05, 15:56
x4

Post by Kvalyr » Fri, 6. Jan 06, 15:25

You have to edit the ship's scene file to add the docking point.
I feared as much. Ah well, I'm sure someone else will do it eventually.

Great work, both of you ;)

Matthias_N
Posts: 140
Joined: Sat, 19. Mar 05, 14:50
x4

Post by Matthias_N » Fri, 6. Jan 06, 17:01

So the steps to add external docking to a ship are the following?

1. Copy "objects\v\00535.bod" two times, rename one to "new_535_ExtDock_dummy.bod" and the other to "new_TP-TS_ExtDock_dummy.bod".
2. Place them both in "objects\ships\props\" and add the two lines to "types\Dummies.txt".
3. Add a new path to the ships scene file with eighter "new_535_ExtDock_dummy" or "new_TP-TS_ExtDock_dummy" depending on what ships should be allowed to dock.
4. Change the ships count for docking slots in the "types\tships.txt" file to a negative value, equal to the ammount of docking paths you added to the ships scene file.

Is this right?

Deleted User

Post by Deleted User » Fri, 6. Jan 06, 17:08

*drools* :) :D

Post Reply

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