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

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

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

User avatar
DeadlyDa
Posts: 1882
Joined: Mon, 5. Jan 04, 04:46
x4

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

Post by DeadlyDa » Fri, 6. Jan 06, 06: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 ).
[ 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.
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.

unfunfofmpc
Posts: 300
Joined: Sat, 12. Nov 05, 19:37
x3

Post by unfunfofmpc » Fri, 6. Jan 06, 07: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: 2282
Joined: Thu, 29. Jan 04, 08:19
x3tc

Post by AalaarDB » Fri, 6. Jan 06, 07: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: 1311
Joined: Wed, 6. Nov 02, 20:31
x3

Post by X-it » Fri, 6. Jan 06, 08: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: 837
Joined: Tue, 13. Apr 04, 10:39
x3

Post by bendyspex » Fri, 6. Jan 06, 08: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: 81
Joined: Sat, 7. Feb 04, 17:48
x3tc

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

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

User avatar
twistedtech
Posts: 246
Joined: Mon, 3. Nov 03, 00:34
x3tc

Post by twistedtech » Fri, 6. Jan 06, 10: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, 08:14
x3

Post by doubleshadow » Fri, 6. Jan 06, 10: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, 13:53, edited 1 time in total.

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

Post by -XTM- » Fri, 6. Jan 06, 11: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: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Fri, 6. Jan 06, 11: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: 336
Joined: Sun, 1. May 05, 15:56
x4

Post by Kvalyr » Fri, 6. Jan 06, 13: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, 08:14
x3

Post by doubleshadow » Fri, 6. Jan 06, 13: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: 336
Joined: Sun, 1. May 05, 15:56
x4

Post by Kvalyr » Fri, 6. Jan 06, 14: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: 141
Joined: Sat, 19. Mar 05, 13:50
x4

Post by Matthias_N » Fri, 6. Jan 06, 16: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, 16:08

*drools* :) :D

User avatar
DeadlyDa
Posts: 1882
Joined: Mon, 5. Jan 04, 04:46
x4

Post by DeadlyDa » Fri, 6. Jan 06, 16:33

Get rid of those ugly black/white textures at the bottom of the grendel
I hope to have time to re-texture both the Grendel and Sulaco. Cap ships look much better dressed up in X3 textures!
Do not post a picture of your base with an arrow pointing to the super secret hidden entrance!!!!
Ah...is that why my secret bases keep vanishing :P
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.
Well...the plan is to stop adding ships and tinkering with textures sometime tomorrow (Saturday)...test the rest of Saturday...do a "final fix" pass Sunday morning, and release sometime on Sunday afternoon.

There are two docking parts included. The low-end allows any fighter to dock, so M3's will be able to dock M6's that have external docking. The second docking part allows TP, TS, and M6 ships to dock (as well as fighters)...so any ship with this part will be able to dock M6's.

However, I had not planned on updating the original M1, M2, M6, and TL ships in the first release. It's not hard to do...but I'm running out of time if I want to get something uploaded this weekend.
Why do I have to read the forum to find out what are you up to?
LoL...you probably know more about what I'm doing than anyone else...given all the emails & PMs we exchange! The simple fact is that I couldn't begin to do any of it without your tools and constant updates :D
...but if I could, in time, hook it up to your own 'secret astroid ship production plant' that would be even better...
Well, I also have a couple of other stations I am working on...one that uses elements from two of the Homeworld stations (Tannis and Foundry) as a base. Maybe they would be more "shipyard-ish".
Last edited by DeadlyDa on Fri, 6. Jan 06, 17:03, edited 3 times in total.

User avatar
DeadlyDa
Posts: 1882
Joined: Mon, 5. Jan 04, 04:46
x4

Post by DeadlyDa » Fri, 6. Jan 06, 16:49

Matthias_N,

Close...very close :D

On your first point, if you just copy 535 twice, you will get the same docking part with two names...that can only dock fighters.

I believe that the docking flags work with the docking parts (but I may be wrong). What I am using to be on the safe side is the same parts scheme that Egosoft uses, which is:
  • ++ 535 = small ship docking position (M5, M4, M3)
    ++ 10495=Medium ship socking position (TP, TS)
    ++ 10496= M6 docking position
    ++ 19040 (via the CutData.txt file) = huge ship (M1, M2, TL)
Whatever you do, make sure you set the flags correctly for the type of ship you want to dock (not forgetting to update the line count).

On your 4th point, X3 does not use a negative number to designate external docking. If you place 3 external docking points into your scene file...use the number 3 (positive).

Matthias_N
Posts: 141
Joined: Sat, 19. Mar 05, 13:50
x4

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

DeadlyDa wrote: I believe that the docking flags work with the docking parts (but I may be wrong). What I am using to be on the safe side is the same parts scheme that Egosoft uses, which is:
  • ++ 535 = small ship docking position (M5, M4, M3)
    ++ 10495=Medium ship docking position (TP, TS)
    ++ 10496= M6 docking position
    ++ 19040 (via the CutData.txt file) = huge ship (M1, M2, TL)
Whatever you do, make sure you set the flags correctly for the type of ship you want to dock (not forgetting to update the line count).
Thanks.
DeadlyDa wrote:On your 4th point, X3 does not use a negative number to designate external docking. If you place 3 external docking points into your scene file...use the number 3 (positive).
Interesting, so it could be possible to equip ships with both external and internal docking. If that works it would be very nice, internals docks for fighters and external docks for supply ships :).

User avatar
DeadlyDa
Posts: 1882
Joined: Mon, 5. Jan 04, 04:46
x4

Post by DeadlyDa » Fri, 6. Jan 06, 17:10

Interesting, so it could be possible to equip ships with both external and internal docking. If that works it would be very nice, internals docks for fighters and external docks for supply ships
Got it in one :D

The pix of the Sulaco above shows a Caiman docked...but the Sulaco also has the standard Cap ship internal dock/launch facility (one docking bay, 18 launch ports, 91 ships total capacity).

DJ | Wolf
Posts: 51
Joined: Sat, 7. Feb 04, 21:14
x3tc

Post by DJ | Wolf » Fri, 6. Jan 06, 17:26

Very nice work there gents, so that means someone could add docking to the Terran Carrier? :)

Post Reply

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