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
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 7. Jun 12, 22:32

Frstwlfz wrote:Yay! Thanks a bunch Doc!

EDIT: OK, so it was because of the Z position of the guns... that's... wierd?
Excellent! I am glad you got it working, Frstwlfz (although I knew that you would).

Yes, it does seem odd that the z position of the guns would make that large a difference. One thing that I did not test was the possibility that the guns worked but you just could not see them fire?

The way that I did it was that I used the z position for the front turrets. I figured that the front guns should be somewhere near there. Although you could probably get better coordinates from 3dsMax.

User avatar
Frstwlfz
Posts: 34
Joined: Thu, 26. May 11, 12:47
x4

Post by Frstwlfz » Thu, 7. Jun 12, 23:19

DrBullwinkle wrote:
Frstwlfz wrote:Yay! Thanks a bunch Doc!

EDIT: OK, so it was because of the Z position of the guns... that's... wierd?
Excellent! I am glad you got it working, Frstwlfz (although I knew that you would).
It's you who got it working! :D
DrBullwinkle wrote:Yes, it does seem odd that the z position of the guns would make that large a difference. One thing that I did not test was the possibility that the guns worked but you just could not see them fire?
Well, the energy wasn't depleting while I was hammering the fire button... But maybe.
DrBullwinkle wrote:The way that I did it was that I used the z position for the front turrets. I figured that the front guns should be somewhere near there. Although you could probably get better coordinates from 3dsMax.
Yes I'll give it a shot now that I know what was wrong. Thanks again :)

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

Post by dtrowle » Fri, 8. Jun 12, 04:54

I have a question related to this, but please let me know if you think I need to start a new thread. I'm trying to "extract" a ship from an older version of the extended mod for my personal use. I am also using Cadius Xtra ship mod as a fake patch.

Here is what I had before trying to get this ship in the game:

1) Xtra ship mod installed as a fake patch 03.cat in the addon folder
2) My own cat file in the mods folder which I had just changed a few stats in the Tships, Tbullets, Tmissles, and globals.

-This all works fine.

Now, for what I have done to try to get a ship added in using the previous as my starting point:
1) extracted the relevent files from the objects\ships\etc.\etc. and copied them into a similar directory in my cat file
2) added an entry to the end of the Tships file which references the directory and filename for the scene file (the one that ends in .pbd)
3) added an entry into the text file for the name of it.

Now here is what happens: I load a game and create the ship via script. The ship appears on the nav screen and all the stats, turrets, cargo, etc appears to be right and it is reading the text file since I can see the name of the ship instead of the "readtext" stuff. The problem is that the game doesn't actually load the model because when I target the ship it just shows an empty place in space where my ship should be :( . It's as if the game can't find or can't read the scene file. Any suggestions?

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

Post by DrBullwinkle » Fri, 8. Jun 12, 05:06

dtrowle wrote:It's as if the game can't find or can't read the scene file.
Yep.

In step (2), it is probably easiest to use exactly the same path in your .cat as in the .cat from which you extracted the objects. That way, you do not need to change the TShips entry. The job becomes almost copy and paste.

Also, remember that models and scenes go in the objects\ships\... tree. But, in TShips, the path begins with SHIPS. The "objects" is omitted in TShips.

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

Post by dtrowle » Fri, 8. Jun 12, 05:16

Thanks for the reply, that is exactly what I did for that very reason. I just copied the whole directory into my cat file and the only thing "non copy paste" would be the text file index number (which works because I can read the name of the ship in game) and the actual index number of the ship in the Tships file - which I wouldn't think would make a difference. I confirmed that the "objects\" is omitted in the Tships entry. Does X3AP handle ships any different than what X3TC did? Could I have possibly corrupted the scenes file during the extract and copy process? I left the "Decmpress compressed files" and "Queue BOB files to bod compiler" unchecked. Should I have?

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

Post by DrBullwinkle » Fri, 8. Jun 12, 05:33

dtrowle wrote:Does X3AP handle ships any different than what X3TC did? Could I have possibly corrupted the scenes file during the extract and copy process? I left the "Decmpress compressed files" and "Queue BOB files to bod compiler" unchecked. Should I have?
Ships are handled the same way in AP as in TC. The only thing to note is that types is in addon, while objects and dds are not:
  • x3ap\addon\types
    x3ap\objects
    x3ap\dds
Anything is possible, but I have not heard of anyone having trouble with corrupting files during extract and copy.

I don't think that compression matters to the game, although it is normal for the files inside of .cats to be compressed.

.Cats are convenient, but they can be confusing. That is why I have not used them in my tutorials. It is too easy to mess up a path in a .cat and find it difficult to debug.

If you want to post the .cat then I will take a look at it. (Probably tomorrow.)
Last edited by DrBullwinkle on Fri, 8. Jun 12, 23:09, edited 1 time in total.

User avatar
Argonaught.
Posts: 1827
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Argonaught. » Fri, 8. Jun 12, 05:34

I had the same invisible ships till i realized what I had done wrong:

For AP the model files should be placed in the TC folder and only files that belong in the types folder go into addon.

if you place everything into the addon folder, wether inside a cat/dat or unpacked, the ship will not be shown correctly.

TLDR:

Your folder structure inside a cat:

addon\types
dds
objects

etc etc

HTH

Argo.
[MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>

XBTF>XT>X2TT>X3R>X3TC>X3AP>X4F

I lurk alot for the most part now
:thumb_up:

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

Post by DrBullwinkle » Fri, 8. Jun 12, 05:36

I think I just said that but, yeah, that's the way it works. :)

User avatar
Argonaught.
Posts: 1827
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Argonaught. » Fri, 8. Jun 12, 05:37

DrBullwinkle wrote:I think I just said that but, yeah, that's the way it works. :)
You were too fast there, your post wasn't there when i had hit the reply button :P

Argo.
[MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>

XBTF>XT>X2TT>X3R>X3TC>X3AP>X4F

I lurk alot for the most part now
:thumb_up:

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

Post by dtrowle » Fri, 8. Jun 12, 13:43

Aha! I bet that's what I did wrong then! I'll have to check it after work today but I'm 90% sure my problem is that I have all the scene files inside the addon folder. :D Thanks DrBullwinkle and Argo for the help!

Edit: So I came home for lunch and moved the "objects" folder out of the addon folder and into the main directory of my cat file and it works beautifuly now! 8) It's like the simplest stuff is always the hardest to figure out.

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

Post by kurush » Fri, 8. Jun 12, 19:03

This is one awesome resource, thank you very much for putting it together.
DrBullwinkle wrote: Note: Main Guns will turn a bomber or missile frigate into a fighter/frigate. The only thing that makes a missile turret a missile turret is the lack of guns. So, if you add the guns, then the M8/M7M will no longer fire missiles via its normal turret commands.
I am trying to understand what exactly this note means. I noticed that adding guns to the missile turrets of M7M kills the barrage command (understandable). Does it also mean that having main guns for example on I that has a dedicated missile turret will kill its barrage command as well? I am contemplating adding a front missile turret with 1 or 2 barrels to some M7 to allow them barrage commands. Any tutorials on adding turrets BTW? Can I just add it using X3 Editor or are there additional tricks?

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

Post by DrBullwinkle » Fri, 8. Jun 12, 21:45

kurush wrote:This is one awesome resource, thank you very much for putting it together.
And how thoughtful of you to say so, kurush!

Many people read Ship Tricks, but few bother to comment on it. I never know, for sure, whether the small number of questions means that I have explained things well, or whether it means that I have confused everyone with a wall of text. :)
Does it also mean that having main guns for example on an I that has a dedicated missile turret will kill its barrage command as well?
Yes.

To clarify my earlier statement, the only way the game knows that a missile turret is a missile turret is because it has no "Compatible guns". And by "it" I mean the definition of that cockpit type, including the "Compatible guns" tab in TShips, which overrides the "Compatible guns" tab in TCockpits.

M7M's typically use SS_COCKPIT_DEFAULT for their missile turrets. That is the same definition that is used for the "cockpit" viewport in most ships.

So, when you add "Compatible guns" in TShips, you effectively convert your missile turrets into gun turrets.

Interestingly, it appears that the "Compatible guns" tab in TShips also overrides *other* "empty" turret definitions -- not just the "cockpit" turret, and not just SS_COCKPIT_DEFAULT.

As a test, I changed one of the missile turrets on a Cobra to SS_COCKPIT_S_FRONT_M7, which also has no compatible guns defined in TCockpits. So the Cobra had one missile turret with SS_COCKPIT_DEFAULT and the other with SS_COCKPIT_S_FRONT_M7. Unfortunately, when I added a "Compatible gun" in TShips, that gun type became available to both missile turrets.

So it would appear that you cannot cheat your way around this effect. At least, not with any trick that I know.

I am contemplating adding a front missile turret with 1 or 2 barrels to some M7 to allow them barrage commands.
An alternative to adding a turret would be to remove the "Compatible guns" from your M7. That should have the effect of converting the main guns into missile tubes. Since you cannot have both Main Guns and Missile Tubes anyway, that is the much easier mod to do.
Any tutorials on adding turrets BTW? Can I just add it using X3 Editor or are there additional tricks?
I have specifically avoided adding turrets, because it is hard to do without a 3D modeling program. You must add the turret to the scene before you can use it in X3 Editor. I have not had the patience to do it because there are already models that have all available turrets in place.

However, if you really want to do it, the technique is the same as adding main guns. The difference is that you would copy a turret from an existing scene, paste it into your ship's scene, adjust the ordinals, then adjust the placement and rotation values. The rotation values are the next three numbers after the location values.

If you want to dive into the 3D modeling world, Killjaeden wrote a couple of guides that look tempting:

Creating Custom Turrets
Advice on placing turrets

An easier solution for your M7 might be to give it STANDARD docking ports so that you can dock an M8 on it. :)

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

Post by kurush » Fri, 8. Jun 12, 21:58

DrBullwinkle wrote: Interestingly, it appears that the "Compatible guns" tab in TShips also overrides *other* "empty" turret definitions -- not just the "cockpit" turret, and not just SS_COCKPIT_DEFAULT.
Thanks for clarifying this. It looks like my dream of Normandy Mk3 that can also fire barrages goes down the drain. Well, at least it is possible to have a ship with one missile turrets and lots of regular turrets :) I assume adding gun slots with no guns to the cockpit doesn't make the barrage command available?

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

Post by DrBullwinkle » Fri, 8. Jun 12, 22:14

The Normandy is a light frigate, right? I think of it as between a Hyperion Vanguard and Griffon in size and performance. Not the biggest ship in the sky, but with superior speed and more "punch" than its size suggests.

It should dock TP "shuttles" (for your boarding parties), of course. :)

(I don't know how you will mimic the stealth drive. )

How about writing a new script for better missile control? In combination with a change in the missile refire rate, you might be able to fake a barrage, or something close to it. However, you would not be able to prevent the player from spamming the "launch missile" button. Unless that player is you, in which case you could remap the launch key (or simply not use it).

You can (and probably should) add gun slots to your missile turret. Just no "Compatible guns".

@dtrowle: Yay! I'm glad you got it working!

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

Post by dtrowle » Sat, 9. Jun 12, 05:17

Okay on to my next problem. What could be the cause of the turrets not firing? And BTW, the energy never moves while I click away on the fire button? Thanks in advance.

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

Post by DrBullwinkle » Sat, 9. Jun 12, 07:57

dtrowle wrote:What could be the cause of the turrets not firing?
You will have to give me more information to work with.

All turrets on all ships? If modified turrets -- how are they modified? What turret script? TC or AP? Have you tried being in the turret's cockpit, then pressing "g" to make sure that the guns are assigned to the current weapon group?

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

Post by dtrowle » Sat, 9. Jun 12, 15:08

Sorry, this is in X3AP on the same ship that I'm trying to port as before. All other ships work fine. I've checked the obvious stuff like guns and making sure I'm using group 1, etc. And note that the energy does not drain at all when I hit the fire button.

I did copy over the "ships/props" folder as that is where the "scene" for the turrets is. They do load and appear on the ship but I'm not sure if they have the weapons "loaded" (which I don't know what they will look like with and without since these are custom turrets). Also of note is that they do not follow the camera angle around when you move - they just sit lifeless on t he ship.

Here is the scene file entry in Tships (I've hit enter a few times to try and wrap it in the forum):

Code: Select all

_cp_scene;1048576;48;600000;0.02;5;8;7;9;5;5;80000;80000;86;0;4;0;3;0;5;0;6;0;0;0;0;32;5;1;650000;37;38;0;20;10;OBJ_SHIP_M2;5;1;0;
ships\props\cameradummy;11;2;1;ships\props\cameradummy;12;3;2;
ships\props\cameradummy;16;4;3;ships\props\cameradummy;20;5;4;
ships\props\cameradummy;24;5;1;0;1;0;1;12;2;3;1;4;ships\XTC\props\hugeturret_dummy;13;
ships\XTC\props\hugeturret_weapon;3;5;4;ships\XTC\props\hugeturret_dummy;14;
ships\XTC\props\hugeturret_weapon;3;9;4;ships\XTC\props\hugeturret_dummy;15;ships\XTC\props\hugeturret_weapon;3;13;12;3;3;13;4;
ships\XTC\props\hugeturret_dummy;17;ships\XTC\props\hugeturret_weapon;3;17;4;
ships\XTC\props\hugeturret_dummy;18;ships\XTC\props\hugeturret_weapon;3;21;4;
ships\XTC\props\hugeturret_dummy;19;ships\XTC\props\hugeturret_weapon;3;25;12;4;3;25;4;ships\XTC\props\hugeturret_dummy;21;
ships\XTC\props\hugeturret_weapon;3;29;4;ships\XTC\props\hugeturret_dummy;22;
ships\XTC\props\hugeturret_weapon;3;33;4;ships\XTC\props\hugeturret_dummy;23;
ships\XTC\props\hugeturret_weapon;3;37;12;5;3;37;4;ships\XTC\props\hugeturret_dummy;25;
ships\XTC\props\hugeturret_weapon;3;41;4;ships\XTC\props\hugeturret_dummy;26;ships\XTC\props\hugeturret_weapon;3;45;4;
ships\XTC\props\hugeturret_dummy;27;ships\XTC\props\hugeturret_weapon;3;1;4305500;1;1;0;4305500;200000;0;0;SS_SH_A_M2P;

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

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

.
Last edited by DrBullwinkle on Fri, 30. Nov 12, 19:41, edited 1 time in total.

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

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

That actually looks correct, considering he has added custom turrets, minus the line returns, of course.

Question, did you add the turret information to the Components file in /types?...

The Components file has the SCTYPE_LASER entries, where it tells the game where to find those turret models in the directory, and has the coordinates of where they are supposed to be placed on the model. This info is generated by DBOX as well, from 3DS.

There would also have to be Dummies file entries, for the animations. (rotation/elevation, etc)

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

Post by dtrowle » Sat, 9. Jun 12, 15:44

Yes, I added the line returns so it wouldn't stretch forum :P hope that didn't confuse anyone.

The components file would be where the problem lies then because I haven't messed with that yet. I'll play with that some today and see what I can do. I should just basically be able to copy the entry from the components file in the mod that I am porting this from into my own right?

Post Reply

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