[Tutorial] How to make custom weapons

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

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

User avatar
Matterom
Posts: 423
Joined: Thu, 20. Aug 09, 08:17
x4

[Tutorial] How to make custom weapons

Post by Matterom » Wed, 30. Sep 09, 06:09

have been looking for a tutorial for this for a while while i had very little luck finding one i eventual came to the conclusion that there wasn't one. Eventual i worked up the courage to spend 3-4 hours researching and developing an effective method to create weapons, So This is for all of those people who want to make all those little weapon mods (but i have first dibs)

http://forum.egosoft.com/viewtopic.php?t=260284 <-you will find a set of custom weapons here when it is done

You will need....

>X3 edditor2 by Dubbleshadow
>approval for certain weapons
>Creativity
>(optional) In order to effectively test your mods without the interference of other mods i installed a second TC in a folder called X3 Vanilla Environment It Helps a lot
>(optional) Cycrows cheat pakage to test it

Pre Step #1
open the X3 editor and open the cat 3 file in your x3 directory Extract from the text folder Tships, Tlasers, And Tbullets
Note: For Organizational purposes Create a My MOD Folder somewhere either in Documents or on your desktop.

PRe Step #2
Use X3 edditor to open all 4 files. From here you have a few choices Based on what you want to do....

1.i want to edit existing Weapons

2.i want to edit its effects

3.I want big weapons on my fighters

4.i want a brand new spanking weapon because all mine suck

As the forth option pretty much covers every thing ill do that

I will now guide you thru the steps i did to create my Light Combat Beam Weapon for my fighters


>Step one

Go over to the t lasers tab i the x3 editor scroll all the way down and find the Plasma beam cannon, Right click copy and past at the bottom
Then look at its window you should see something like....

ID
Model file
Ect.......

Right click the id in the value side and Rename it to SS_LASER_X (x Equals a value that you input Ergo The variable)

Model file and picture id you can keep the same

The 3 rotation values are user input but never leave X and Y blank Because if you do theoretically your gun will only Fire Straight ahead

Subtype:The most important part This is where you select where your weapon will be placed ( for my LCB i placed it in the SG_LASER_ARGON_LIGHT)

Name: as we cannot edit this directly you will notice the name id. For this you open the 0001-l044 scroll down to the id 17:Bord-comp and right click edit click OK then you should be free to edit the text inside (right click new id it something not already taken then name it something menacing)
in the name id type in your id selection for the gun if it comes up as a string error that is normal (still needs to be improved)
Note: All weapons need names before they will be added to the game

Note:Actually you need to create a new text document and save as a pdf
but before you open it copy and past this into notepad
-----------------------------------

<?xml version="1.0" encoding="utf-8" ?>
<language id="44">
<page id="17" title="Boardcomp. objects" descr="">
<t id="4xvalue"> Change the x value to a random 4 digit number</t>

this will be saved in your mod folder look here to see available t files

i am having trouble with this specifically they all appear as read texts in game

http://forum.egosoft.com/viewtopic.php?t=216690

--------------------------------------

Rate of fire: common place Beam weapons are usually 100 rounds per minute with other weapons being less

sound: Each sound file corresponds to a number located in the S folder

Projectile: See Step 2

Energy: not quite sure ether but could be two things (1 energy needed to run 2 energy used per X)

Charge rate:Only Affects weapons that charge.

icon: what you see in the little weapon slot in your ships

Volume: how big do you want it ( my case since its a small beam weapon no bigger than 10

relative value- The price modifier- leave alone for now it affects how much your gun will cost.. ATM we just want to get it working


Size: This is Important you need to select the appropriate type of size for this gun Recommends medium to large for M4-M3s and XL for the bigger Ship weapons

Every thing else is unimportant for now

Step two

Switch over to the T bullets tab and copy and past the plasma beam cannon (you are going to have to be clever hear as they are almost all named unknown object Hint:look at the model files and the ids)

Leave all but the id alone you need to change that into SS_BULLET_X
Switch to the mini tab in the window labeled Bullet Data
This is where you edit and customize every detail from range to color Edit all the stats you like then continue

Save all of this to your folders for safe keeping

then go up to options and reload all game data if you did it right when you go back to the t lasers to input your bullet, it should be there

Step 3

To input this int your game first save and open the t ships to make sure that your added weapon is there
then just merge all of this into a cat&dat and your good to go make sure to put them in the correct directory..

From here you should be free to make and test your own custom weapons and bullets But remember with awesome power comes awesome fun


if i was unclear please respond so that i may fix the error
Last edited by Matterom on Fri, 11. May 12, 00:11, edited 2 times in total.
My Mods:
Sector Administration: A Tax Mod

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 1. Oct 09, 02:52

Make sure you submit this to the guides sticky thread.

User avatar
Matterom
Posts: 423
Joined: Thu, 20. Aug 09, 08:17
x4

How to create effects for weapons

Post by Matterom » Sat, 3. Oct 09, 04:32

i will use this area to post a tutorial on how to create the weapon effects
My Mods:
Sector Administration: A Tax Mod

Skeeter
Posts: 3664
Joined: Thu, 9. Jan 03, 19:47
x3

Post by Skeeter » Thu, 10. Dec 09, 20:50

Name: as we cannot edit this directly you will notice the name id. For this you open the 0001-l044 scroll down to the id 17:Bord-comp and right click edit click OK then you should be free to edit the text inside

This im lost at please explain more as there is no 0001- stuff in name id just 8xxx and i can edit by double clicking and thats it.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22197
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 10. Dec 09, 22:01

the 0001 file is inside the games file, the 01, 02, cat files, etc

u'll need to extract it.

however, its better to create your own text file to load into the game

Swatstain
Posts: 5
Joined: Tue, 24. Jan 06, 00:47
xr

Weapons Calculating

Post by Swatstain » Fri, 12. Mar 10, 06:57

I have noticed that what is found in the Tbullets file does not match what is in the game and took it upon myself to try and figure out what multipliers affect sheild, hull, and energy consumption.

I have found that the fire rate listed in the Tlasers file affects sheild, hull, and energy consumption. But trying to figure out the percentages was starting to rack my brain. So if anyone knows how the weapons stats are figured out in game i would be interested.

Just never was good at math Shtuff......

User avatar
Matterom
Posts: 423
Joined: Thu, 20. Aug 09, 08:17
x4

Post by Matterom » Sat, 17. Apr 10, 08:38

"fire rate listed in the Tlasers file affects sheild, hull, and energy consumption"
all fire rate is is Damage per Second and energy usage

in the bullets file the 3 top numbers control the shields, hull, and energy but about them not being the same you have to give an example



Note:i have messed with it some more and have almost completely figured it out i just have to find time to update this

still cant make new effects
My Mods:
Sector Administration: A Tax Mod

MitchellExplorer
Posts: 8
Joined: Thu, 29. Oct 09, 03:19

can't change existing weapons range

Post by MitchellExplorer » Fri, 28. May 10, 08:36

when i try to change the range of the weapon it says "property is read-only" - Only thing i wanted to change...

edit: - right ok lol :) lifespan & speed creates range :) wee finally i get some range to flaks.

expo1
Posts: 1
Joined: Wed, 24. Nov 10, 03:28

Post by expo1 » Wed, 24. Nov 10, 03:30

Now I know how to make custom weapons, thanks posting, I really appreciate this.

User avatar
Matterom
Posts: 423
Joined: Thu, 20. Aug 09, 08:17
x4

Post by Matterom » Thu, 6. Jan 11, 07:48

no problem :) but like i said theres still more to add thats beyond me, however when i find the time i will add some do's and donts to this tutorial, for example: dont make a missle that can wipe out a sector.... And fly faster than the speed of light (it wasent good for my health, or frame rate) another tip is about making missle turrits i made a dumbfire missle turrit but if u tick the wrong box hoping for a certain efect can make ur game crash or the wepon act funny. Mabby i should link my weapon blupper pack for some of my "failed exparaments" like my super disruptor that nearly vaporized argon prime X-( note to self test only in xenon space
My Mods:
Sector Administration: A Tax Mod

User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV » Wed, 26. Jan 11, 19:29

added to tutorials stickie

changed header for search reasons

User avatar
Tohron
Posts: 331
Joined: Mon, 24. Oct 11, 06:38
x3tc

Post by Tohron » Wed, 16. Nov 11, 18:48

I know it's a bit of thread necro, but since this is a tutorial I thought this would be the right place to put it.

Anyway, I'm not actually making a new weapon, just trying to modify the existing ones - specifically reduce Ion Disruptor & Ion Cannon hull damage, and (if possible) slightly increase Ion Disruptor range. The 09 catalog seems to be the most recent catalog with TBullet, so I edited and overwrote that with new hull damage values (range seems to be read-only). Testing it out in game, that caused all my weapons to lose their names and stop working properly. Fortunately, I had a backup of the X3 folder, but I'm still not sure how to go about changing these values. Any assistance?

acgabs
Posts: 38
Joined: Sat, 19. Nov 11, 15:01
x3tc

Post by acgabs » Sat, 3. Dec 11, 18:30

Hello! Great guide so far, I have a few problems though.

1. The Name ID of the new weapon and how to change it..

It's a bit confusing to read, create a notepad file with those lines then save that to my mod folder? And what do I do with the PDF? And how do I get all that inside the DAT-File?

2. Copy+Paste the Weapon into the the TBullets Tab doesn't work, it always produces an error.

crusader58
Posts: 10
Joined: Fri, 27. Jan 12, 10:50

Post by crusader58 » Sat, 11. Feb 12, 13:36

I cant copy/paste as when I right-click nothing happens and under the 'edit' menu there's only an option to 'Copy File Name' whichg does nothing

joshyp00
Posts: 29
Joined: Wed, 21. Dec 11, 01:15

Post by joshyp00 » Sat, 31. Mar 12, 06:36

Idk how weapons factor in but i know that some shields have a higher efficiency perhaps this influences damage and etc....
"Major Marks, Please Make That Ship Go Away."

Einheit 101
Posts: 643
Joined: Sat, 3. Jan 09, 22:57
x3tc

Post by Einheit 101 » Sun, 17. Jun 12, 13:36

Range = Lifetime * speed

€DIT::: Is there a way to change the sound of Beam Weapons or is it hardcoded? It seems not to work

Svarr
Posts: 12
Joined: Fri, 2. Nov 12, 15:51
xr

Post by Svarr » Tue, 6. Nov 12, 22:10

I know the posts are old but eventually this will help other users in the future:

acgabs wrote:2. Copy+Paste the Weapon into the the TBullets Tab doesn't work, it always produces an error.
You have to copy and paste the proper bullet into the TBullets file. Not the Weapon.
crusader58 wrote:I cant copy/paste as when I right-click nothing happens and under the 'edit' menu there's only an option to 'Copy File Name' whichg does nothing
You have to right-click on the Laser/Bullet you want to copy. Then a context menu should open where you choose copy. After that you right-click again and choose "Paste to End".


I have a problem myself: Since I have saved the files in a separate folder and left the original files unchanged, my created laser and bullet is not listed in the drop down menus. In the Projectile-Field of the TLaser.pck I could bypass it with just using the raw value. Will this work?
And what about the NameID? Right now I have the String not found error. Will the right name and description be shown ingame when I have installed the spk I will create from the files? (using Package Creator v1.21)

I also would like to create a new Subtype for this weapon. But I dont know where.

1st Edit:
Concerning the string not found error: The correct names will be shown inside the game.
So far so good.
Now I will try if the raw value Projectile works the way I want...

2nd Edit:
The game crashed when I fired the weapons. I think its because of the projectiles. So using the raw values doesnt seem to work.
What can I do to make the Bullet choosable in the dropdown-menu of the Projectile field?[/b]

3rd Edit:
It kind of works now. But I still need to know how to create Subtypes. I cant think of an other way to prevent random computer controlled ships from shooting at me with my own laser. It happened this morning. :x

Einheit 101
Posts: 643
Joined: Sat, 3. Jan 09, 22:57
x3tc

Post by Einheit 101 » Tue, 20. Nov 12, 14:16

You cant create subtypes. But you can set some unused subtypes for your mod weapons. E.g. Terran unknown = spare lasers. No ai will use guns of that type. Then you got to change the compatible weapon of your ship to this unused subtype.

Svarr
Posts: 12
Joined: Fri, 2. Nov 12, 15:51
xr

Post by Svarr » Tue, 20. Nov 12, 14:26

Einheit 101 wrote:You cant create subtypes. But you can set some unused subtypes for your mod weapons. E.g. Terran unknown = spare lasers. No ai will use guns of that type. Then you got to change the compatible weapon of your ship to this unused subtype.
Alright, then I'll do it that way for now. Thanks :D

monk124us
Posts: 18
Joined: Mon, 13. Feb 12, 19:05
x3tc

Post by monk124us » Wed, 23. Jan 13, 17:49

My bad if I revive the thread but since its sticky as a tutorial. . My question is this how do I add the gun I created to a xsp ship I installed, the f304 from sg1. I know I can edit the ship using the package editor but when I try to load the directory I get an error msg when I try to load the customize ship option.

Second question, the gun I create would npc use it? If so how can I make it so they dont?

Post Reply

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