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 Man, did I feel stupid...I probably wasted 30-40 hours on that one
(Well, it's not wasted I guess, since I now know how to do custom docking facilities with full automation )
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
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 ).
[ external image ]
...and an inside view of the fighter hanger bay:
[ external 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.
[ external image ]
[ external image ]
[ external 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.
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.
- ++ 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
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;