Ship Tricks: Mini-Guides. NO 3D modeling required! (Bullwinkle) [Guide][TC][AP]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
Aegyen
Posts: 245
Joined: Sat, 31. May 08, 19:33
x4

Post by Aegyen » Sat, 9. Jun 12, 15:50

You could do exactly that, copy the corresponding entries from the Components, and Dummies files, and add them to yours. BUT, big but here, the Components file has the coords for where those turrets are to be placed, on the ship it was designed to go with. So, keep in mind, if you end up with a huge wart of a turret on the nose of your ship, now you know why.. :P

In other words, this is something that should be done with 3DS, to get them where you want them, on the ship you are modifying....
Last edited by Aegyen on Sat, 9. Jun 12, 15:52, edited 1 time in total.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 9. Jun 12, 15:52

All of my ships have a number in the first "column".

I think you know that you never "just copy" records in types files. You always have to increment the line counter at the top of the file (or section) when you do a copy-and-paste.

Kodiak88
Posts: 55
Joined: Thu, 15. Oct 09, 16:17
x3tc

Post by Kodiak88 » Sat, 9. Jun 12, 20:48

Hm, this is only slightly On Topic, but I figured asking here would be better than starting my own thread.

I'm looking for a tutorial on pulling ships from a mod (the Babylon 5 mod for TC) and repackaging them into my own personal use (not distributed) mod.

I understand how to edit ships, or clone existing ships and editing them, but am unclear on what exactly needs to be copied over for a brand new ship to be added.

dtrowle
Posts: 351
Joined: Wed, 24. Aug 05, 05:45
xr

Post by dtrowle » Sat, 9. Jun 12, 21:02

Kodiak88: That is exactly what I'm trying to do (port ships from other mods and merge them into my own mod).

I thought it would be relatively easy and that I just needed to copy the relevant scene files into the right place and add an entry into the Tships file using X3Editor. But it seems to be more complicated as I'm finding out that if that ship has custom turrets then you have to mess with the componenets and dummies file.

I also understand that Cycrow's plugin manager can import a ship into an XSP package and then you can install it from there. The problem I'm having is that the Xtended mod has 3 fake patches so the pluginmanager can't look in all of them for the files...I guess I could merge them.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 9. Jun 12, 21:14

Kodiak88 wrote:I'm looking for a tutorial on pulling ships from a mod ... and repackaging them into my own personal use (not distributed) mod.
That's an excellent question, Kodiak. I may make a tutorial about that somewhen.

In the meantime, the short story is:
  • 1) In X3 Editor, "Open with VFS" your TShips from which you want to copy. Let's call this the "source".

    2) In the left-hand column, Copy (to the clipboard).

    3) Still in the left-hand column, Paste to End. You should now have a new ship with an ID like: PASTED_OBJECT_1. Change the ID to something you will recognize (that is unique). Example: MY_WHITE_STAR_M6.

    4) Pull down the File Menu and select Save As... Click the button to "Switch to system dialog". Save TShips as a text file: TShips-WhiteStart.txt (probably in your types folder).

    5) You have created a copy of your TShips file that has a copy of the source ship at the end.

    6) Open the source TShips.txt in a text editor. Make sure that line-wrapping is off.

    7) The last line should be your new ship. Copy the entire line to the clipboard, and paste into your "target" TShips file. (If you do not already have a TShips file on disk, then repeat the above steps 1, 4, and 5 to create one.)

    8 ) Increment the line count at the top of your target TShips file.

    You should now have a new TShips file with your new ship in it!

    9) In X3 Editor, look at your target ship. Select the Model tab, and notice the paths to the model and scene.

    10) Copy the model and scene from source to target. Use exactly the same folder structure on the target that was used on the source.

    11) If you are lucky, then you are done. Try the Smoke Test ("plug it in and see if it smokes").

    12) If you are unlucky, like dtrowle, then you may also need to copy entries in the types\Components and types\Dummies files. Dummies, in particular, has an oddball layout that makes it difficult to copy a dummies record. Sadly. :(

    You will have to use your finest reverse-engineering skills to figure it out, I'm afraid. It is not all that hard if you understand what you are looking at. If you do not, then I have yet to figure out an easy way to describe it. (I did try to explain it on page 2).
@dtrowle: AFAIK, the Plugin Manager only imports the TShips entry into the Creator (although it is hard to tell because there is no documentation). You still have to wrangle components and dummies yourself. Maybe.

dtrowle
Posts: 351
Joined: Wed, 24. Aug 05, 05:45
xr

Post by dtrowle » Sat, 9. Jun 12, 21:22

@dtrowle: AFAIK, the Plugin Manager only imports the TShips entry into the Creator (although it is hard to tell because there is no documentation). You still have to wrangle components and dummies yourself. Maybe.
Yeah, it seems like I tried using is like this back in X3:R or X3:TC and something quirky would always happen leading to broken save games, etc. That's whay I was trying to do it manually.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 9. Jun 12, 21:26

Check out the intentionally terse instructions for copying a Dummy on page 2. If it makes sense to you, then that is the hardest part of the job. If it does not make sense... then I do not yet have a better way to explain it.

I might make a video somewhen. It might be easier to watch someone do it.

Kodiak88
Posts: 55
Joined: Thu, 15. Oct 09, 16:17
x3tc

Post by Kodiak88 » Sat, 9. Jun 12, 22:36

Thanks for the quick explanation DrBillwinkle. An expanded tutorial would of course be great, but I think I can get the ball rolling on my own with that write up.


I'll try it out with some of the more simple ships and slowly expand depending on my luck. The best way of learning is by doing, so I should have it all mastered by the time Rebirth comes out with a brand new system. :)



Edit: From the B5:TC Mod, I got a Starfury in game successfully, but with no textures. It's still a step in the right direction though.

Looking around at the files shows that the larger ships appear to use custom turrets, so I'm sure that my goal of adding these to my game will be fairly lofty.

I would use the available .xsp B5 ships, but the ones from this mod exponentially better than those already great ships available. Here's a link to their thread if anyone wants to take a look.

http://forum.egosoft.com/viewtopic.php? ... sc&start=0

dtrowle
Posts: 351
Joined: Wed, 24. Aug 05, 05:45
xr

Post by dtrowle » Sun, 10. Jun 12, 05:25

Alright after a few hours of drinking and cursing here is what I *think* I have done. :D

1) In the dummies.txt file in the SDTYPE_GUN section, I added the following entry to the end of the section:

Code: Select all

ships\XTC\props\hugeturret_dummy;GUNF_ROTATE;1;GUNSTATUS_INITIAL;ships\XTC\props\hugeturret_scene;2;ships\XTC\props\hugeturret_body;GUNPARTF_ROTATEALPHA;ships\XTC\props\hugeturret_weapon;GUNPARTF_ROTATEALPHA|GUNPARTF_ROTATEBETA;
And incremented the number immediatly after the section heading by 1. This seems to work because now my turrets follow my aim around instead of just sitting ther lifeless, however they still won't fire.

2) Now for componets.txt: I added the following entry to the end of the SCTYPE_LASER section and increment by 1.

Code: Select all

ships\XTC\props\hugeturret_weapon; 4;
NULL; 0.295620;0.006045;0.699301; 0.000000;0.000000;0.000000;
NULL; 0.295620;-0.027048;0.699301; 0.000000;0.000000;0.000000;
NULL; -0.295620;-0.027048;0.699301; 0.000000;0.000000;0.000000;
NULL; -0.295620;0.006045;0.699301; 0.000000;0.000000;0.000000;
Now for whatever ever reason the mostly vanilla Centaur that I was flying my save game that worked perfectly before packing the components file into the cat has its veiwport in the center of the model and every shows to be about 50 kM further away than they really are. And BTW the guns still don't work. :evil: How does adding this entry affect the Centaur's veiwport?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 10. Jun 12, 05:55

I would use the available .xsp B5 ships, but the ones from this mod exponentially better
I see from the link that it is a total conversion mod, which explains why you don't just use the mod as is.

Kodiak88 wrote:I got a Starfury in game successfully, but with no textures.
OK, good, that's progress.

Textures are in the DDS folder. If you can figure out which textures you need, you should be able to copy them from the source mod into your target folder. Let's hope that they did not change any of the vanilla textures, because *changed* textures are a can of worms that we would prefer to avoid. And by "we" I mean "you". :)

I do not know of a text-hack way to see which textures you need. It should be obvious in a 3D modeling program. Probably. But that is not my area of expertise.

If I were doing this, I would be sure that I had a backup of my entire game folder, then I would try copying the entire DDS folder from the mod onto my hard drive. Then do a Smoke Test.

Don't forget: In AP, DDS and objects go at the TC level (one folder up from addon).

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 10. Jun 12, 06:26

dtrowle wrote:This seems to work because now my turrets follow my aim around instead of just sitting ther lifeless
OK, good! If you can see your new Dummy correctly in X3 Editor, then you probably did it correctly.

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
How does adding this entry affect the Centaur's veiwport?
I am not sure that it does. However, your cockpits and cameradummies are in Components. If the file cannot be read properly, for some reason, then I would expect a wide variety of problems.

Double-check this part:
before packing the components file into the cat
The .cat that you are using must be exactly right, obviously. As previously discussed, I do test and debug in real folders on the hard drive. Then, when it all works, I pack it into a .cat.

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Question about your components entry: Does the model for it exist in your game (ships\XTC\props\hugeturret_weapon)? You will, of course, have to copy that just as you would copy model and scene.

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Another point about testing:
the mostly vanilla Centaur that I was flying [in] my save game
When you change ships, models, scenes, and other model-related stuff, it is much easier for the game if NOTHING that is changed is in the current sector in your saved game. The typical advice for testing is to get into a fighter (NOT your favorite fighter -- preferably a fighter type that you do not own -- and fly to an empty sector, then save.

That way, when you reload your saved game, there is nothing in-sector in your saved game that can interfere with the changes that you made.

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Finally, if you are trying to copy an XTC model, then the people who know how the model was created (and what parts you need) are the XTC team. You might have better luck asking them for help, rather than trying to reverse-engineer what they already know.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Aegyen
Posts: 245
Joined: Sat, 31. May 08, 19:33
x4

Post by Aegyen » Sun, 10. Jun 12, 07:41

You are almost there.. :P

I got myself in the same spot, once, while modding ships in. Somewhere, you have your increments wrong. You'll have to go back and count... :evil:

This is redundant, I know: Be SURE you have the correct number of entries beside the section heading (eg, SCTYPE_Laser; 65;) (SDTYPE_GUN;53;) I goofed it once, and incremented the wrong section heading. :oops:

There is a space after Laser; (space) 65;
But there is not one after Gun;53;

Best to mimic EXACTLY from the original.

The counting drove me nuts, but I had added a boatload of ships as well, from 3 different mods. Here is a thing I saw Cadius do, in his types files:

The game won't scream, if you seperate entries with an empty line. So, like every 5 entries, seperate with a blank line. Makes it far easier to count, and you'd be surprised how easy it is to be off by one.

:lol:

You'll know you got it, when your cockpit view is back where it should be.

Once you have that fixed, go back into the Editor, and take a screenshot of the turrets tab for your ship entry. Highlight (select) one of the turret positions. Post it to Imgur or something, and post a thumbnail link here, would you?

I think I know why your guns won't fire, but I need to see that part to know if I am right or not.

dtrowle
Posts: 351
Joined: Wed, 24. Aug 05, 05:45
xr

Post by dtrowle » Mon, 11. Jun 12, 01:16

Alright, I figured it out...after narrowing it down to a problem with the components.txt file. As I said before I had the turrets on the ship and they would follow around my aim, the damned things just wouldn't fire. So I went back to the drawing board and deleted the components file I had edited and re-extracted the components from Cadius ship pack and then added my one entry to the end of the SCTYPE_LASER section and incremented the heading index by 1 (exactly as I had done before) and it works now!

I *think* what I had done was somewhere along the way saved the old disfunctional components file and changed the encoding (to what I can't remember ANSI or UTP-8 or something) :shock: . So the lesson to be learned here is don't mess with the encoding and I'm still trying to figure out what I was thinking when I did :lol: . Prolly trying to save it as something on the desktop only to move it later thanks to Windows access control crap.


PS: Thanks very much to DrBullWinkle and Aegyen for the help. I'll keep playing with this on other ships and hopefully the next won't have custom turrets. Maybe I can contribute to a "porting ships from other mods for personal use tutorial" in the future.

Now that I have it working, the Xenon are going to pay dearly for my frustrations :twisted:.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 11. Jun 12, 01:30

dtrowle wrote:So I went back to the drawing board [snip]... and it works now!
Nice! Glad to hear you got it working, dtrowle!
Maybe I can contribute to a "porting ships from other mods for personal use tutorial" in the future.
Tips, annecdotes, experience, and full blown tutorials; they all help to improve the library for future modders. Contributions are appreciated.

I saw Cycrow's response to your question today: the Creator is intended to extract complete ships from mods, including components and dummies. That would be awesome!

Sadly, it has not been my experience with the Creator, but I do not know why. Mostly, when I try to extract a ship from a mod I get "There was a problem when trying to import the ship..." without any clue about what caused the problem.
Now that I have it working, the Xenon are going to pay dearly for my frustrations :twisted:.
That's the spirit!

Kaplah!

The X-Plorer
Posts: 389
Joined: Fri, 4. Nov 11, 02:03

Post by The X-Plorer » Mon, 11. Jun 12, 01:32

Ah nothing beats venting your rage on emotionless CPU's and putting the fear of... whatever they believe in... into them. :twisted:
Happy accidents are just another form of discovery, except they are way more fun.

dtrowle
Posts: 351
Joined: Wed, 24. Aug 05, 05:45
xr

Post by dtrowle » Mon, 11. Jun 12, 01:33

Sadly, it has not been my experience with the Creator, but I do not know why. Mostly, when I try to extract a ship from a mod I get "There was a problem when trying to import the ship..." without any clue about what caused the problem.
I had that same problem when I tried. I've went down that road before and the last time it resulted in corrupted saves and a restart. That's why I decided to do it myself this time.

kurush
Posts: 4320
Joined: Sun, 6. Nov 05, 23:53
x3tc

Post by kurush » Mon, 11. Jun 12, 01:33

Thanks again for the bigger dock tutorial, using it I was able to change Normaldy for a bigger dock in about 10 min. It's docking port had a number of 19044 in the scene file. As a result I got the following abomination that works seamlessly but is a bit ugly. Springblossom parts are clipping badly with the original ship. Any way to pus the dock position down in those text files? Also, do you know if those dummies are mostly parts of vanilla game or added by mods/ship packages?
Image
Last edited by kurush on Mon, 11. Jun 12, 01:38, edited 2 times in total.

dtrowle
Posts: 351
Joined: Wed, 24. Aug 05, 05:45
xr

Post by dtrowle » Mon, 11. Jun 12, 01:36

Ah nothing beats venting your rage on emotionless CPU's and putting the fear of... whatever they believe in... into them.
Yeah, but it makes me feel better :lol:

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 11. Jun 12, 01:41

The X-Plorer wrote:putting the fear of... whatever they believe in... into them.
Lore, perhaps? Or the Queen Borg?

Since you are here, X-Plorer, I wrote a script just for you, and you never gave me a report about how it worked for you!

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 11. Jun 12, 01:53

kurush wrote:Thanks again for the bigger dock tutorial, using it I was able to change Normandy for a bigger dock in about 10 min.
Nice! That's what I like to hear!
As a result I got the following abomination that works seamlessly but is a bit ugly.
Yikes! It looks as though your Normandy is a bit small for a frigate. That's the main problem.

The position of the dock should be the 2nd through 4th numbers on the second line of dock entry in the scene file. I am not sure exactly how the numbers 5 through 8 work, but I expect 3 of them to be rotation. Not sure about the 4th (position 5 or 8 ).

However, I the only real suggestion that will handle docking a ship the same size as the carrier is to move the docking port *outside* the carrier ship. That way, it will look like an "external dock". External docks look more like a mooring than a dock... as though the docked ship is tethered to the carrier.

Luckily, you don't spend all that much time in your space suit looking at your ship. Unless, of course, you just spent a couple of days trying to get your ship installed in-game. :)

do you know if those dummies are mostly parts of vanilla game or added by mods/ship packages?
The dummies in the vanilla Dummy.txt shold be vanilla dummies. Did I misunderstand your question?
  • Now, if only you could import Cmdr Jane Shepard...

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”