Adding Custom Weapons without scripting

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

Post Reply
StevieLeeCole
Posts: 40
Joined: Fri, 10. Jul 15, 18:31
x4

Adding Custom Weapons without scripting

Post by StevieLeeCole » Mon, 9. Aug 21, 22:09

Searching through the forum, I found a post that confirmed my suspicions:
Just to add that another way of adding additional weapons/shields into the game, without requiring scripting for individual weapons/stations - though it does require restarting - is to add them as products to stations in the WareTemplate.xml file.

The good thing about this, is that all such NPC stations will then sell the ware without any problems, so long as they're not specially scripted in the map file (many Equipment docks are, unfortunately in X3TC - don't know about AP) - so that will need to be edited, too. (Apart from a few specialist stations I've scripted in, (to sell stuff like Kyon Emitters, and specific shipyard stock), all my stations are read from the WareTemplate file.
Unfortunately, after adding a simple custom weapon into Boron and Argon equipment docks and military outposts in the WareTemplate, they don't show up in game-- not even in a new start. Is there more to it than adding additional wares to the ware lists at the equipment docks in the WareTemplatel.xml? For example, that puts the ware on the list of things the equipment dock CAN trade maybe, but it doesn't set stock levels for it? Does it need a factory to produce it, or can it produce them out of thin air? Any one have any idea how this works in X3AP?

Well, I discovered that the new weapon is appearing in the game, I am seeing it armed in ships passing by. So that means I didn't break anything, and it is correctly showing up on the Argon light weapon list. But it isn't showing up in any equipment docks or military posts. So back to my original question, why?

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

Re: Adding Custom Weapons without scripting

Post by Cycrow » Tue, 10. Aug 21, 11:13

adding the weapon to the dock only makes it available for sale, it wont generate them. You need either a script to do that, or create and place factories for them to be produced at.
Ware generation can be done in X3FL, but not in X3AP, you would need to do it manually

also, adding wares to the waretemplate only changes those docks that are using the default template, not all docks do, some have an assigned list in the map. So you would have to edit the map file, and add it to each dock you want it for sale that doesn't use the template.

new factories are created by adding the entry in TFactories, and adding the entry with product into waretemplate, then added onto the map, this can all be done without scripting.

but scripts can be used to generate the wares, and add them to existing docks

StevieLeeCole
Posts: 40
Joined: Fri, 10. Jul 15, 18:31
x4

Re: Adding Custom Weapons without scripting

Post by StevieLeeCole » Tue, 10. Aug 21, 23:56

Cycrow wrote:
Tue, 10. Aug 21, 11:13
adding the weapon to the dock only makes it available for sale, it wont generate them. You need either a script to do that, or create and place factories for them to be produced at.
Ware generation can be done in X3FL, but not in X3AP, you would need to do it manually

also, adding wares to the waretemplate only changes those docks that are using the default template, not all docks do, some have an assigned list in the map. So you would have to edit the map file, and add it to each dock you want it for sale that doesn't use the template.

new factories are created by adding the entry in TFactories, and adding the entry with product into waretemplate, then added onto the map, this can all be done without scripting.

but scripts can be used to generate the wares, and add them to existing docks
Thank you for the explanation. I figured out that you can create factories in TFactories; I modified existing specialized factories (e.g. Light Weapons Complex and Special Weapons) to produce my custom weapon. I was able to find them for sale and use them in a new game, but didn't see them at equipment dock (didn't look too hard, new game). However, in my existing game they only exist on ships I scan but NOT in the modified factories or the equipment docks. Is this what I should expect to see? So basically if I want to be able to use new stuff I need to start a new game?

Post Reply

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