Shiptrader definition

The place to discuss scripting and game modifications for X4: Foundations.

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

aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Shiptrader definition

Post by aftokinito »

Where is the definition for shiptrader?
Specifically, which xml file defines what the shiptrader sells on npc warfs/shipyards?

EDIT: Just as I was typing this I managed to succeed in creating my own fully functional player shipyard. I would still like to be able to customise which ships the trader sells since right now it's only Argon ships.
JJJJ222
Posts: 32
Joined: Tue, 8. Dec 15, 00:00
x4

Re: Shiptrader definition

Post by JJJJ222 »

Can you please do a Shipyard module for each faction for player
Just curious :D
aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: Shiptrader definition

Post by aftokinito »

I tried making my own buildmodule macro but surprise, it does not work.

<builder>
<macro ref="A VALID MACRO WHATEVER" />
</builder>
<equip>
<macro ref="A VALID MACRO WHATEVER" />
</equip>

if I do

<builder classes="ship_xl">
<macro ref="A VALID MACRO WHATEVER" />
</builder>
<equip classes="ship_xl">
<macro ref="A VALID MACRO WHATEVER" />
</equip>

it does exactly the same as the default generic buildmodule.

Please some dev weight in and help.
JJJJ222
Posts: 32
Joined: Tue, 8. Dec 15, 00:00
x4

Re: Shiptrader definition

Post by JJJJ222 »

How about using existing modules
Just curious :D
aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: Shiptrader definition

Post by aftokinito »

There is only one that every race uses, buildmodule_gen_ships_xl_macro for XL ships but you get gist.
My problem is that the game uses the class of the ship to determine what the buildmodule can build but I cannot find anywhere how it determines which macros it can actually build, because it obviously doesn't list ALL the size_xl ships.
JJJJ222
Posts: 32
Joined: Tue, 8. Dec 15, 00:00
x4

Re: Shiptrader definition

Post by JJJJ222 »

Maybe is will help here is a blueprint list viewtopic.php?f=181&t=403460
Just curious :D
aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: Shiptrader definition

Post by aftokinito »

That has absolutely nothing to do with this thread.
JJJJ222
Posts: 32
Joined: Tue, 8. Dec 15, 00:00
x4

Re: Shiptrader definition

Post by JJJJ222 »

sorry Trying to help
Just curious :D
JJJJ222
Posts: 32
Joined: Tue, 8. Dec 15, 00:00
x4

Re: Shiptrader definition

Post by JJJJ222 »

are you look for stuff like this units_size_m_liquid_transporter_macro.xml.sig
Just curious :D
JJJJ222
Posts: 32
Joined: Tue, 8. Dec 15, 00:00
x4

Re: Shiptrader definition

Post by JJJJ222 »

It is under \assets\legacy\units or \assets\units
Just curious :D
aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: Shiptrader definition

Post by aftokinito »

What are you even trying. Again, this has nothing to do with the thread.
This is something only Egosoft can answer, I've already gone through ALL the game files and explained my findings.
aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: Shiptrader definition

Post by aftokinito »

Just stop, you are not understanding the objective of this thread and are just posting random stuff and linking to piracy material (you are not allowed to redistribute the files of the game).
Chair5768
Posts: 36
Joined: Sun, 15. Jan 06, 06:43
x3

Re: Shiptrader definition

Post by Chair5768 »

Ship trade lists are auto generated based on the class and faction of the ship. Shipyards build L/XL, Wharfs build S/M. Teladi stations build Teladi ships, etc. The ownership of ship is declared in the 'libraries\wares.xml' file.

example:
Spoiler
Show
<ware id="ship_par_s_scout_01_a" name="{20101,30102}" description="{20101,30112}" group="ships_paranid" transport="ship" volume="1" tags="ship">
<price min="82297" average="96820" max="111343" />
<production time="6" amount="1" method="default" name="{20206,101}">
<primary>
<ware ware="energycells" amount="34" />
<ware ware="hullparts" amount="74" />
</primary>
</production>
<component ref="ship_par_s_scout_01_a_macro" amount="1" />
<restriction licence="generaluseship" />
<owner faction="alliance" />
<owner faction="paranid" />
</ware>
The ship can be built in Alliance and Paranid wharfs.
aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: Shiptrader definition

Post by aftokinito »

Actually, if the ware has no license it will be available at every buildmodule of that size, so it's not as trivial as you make it look.
Factions like Xenon, for example don't seem to have licenses yet their wares DO use licenses to restrict their ships to their own buildmodules.

I would love to hear a dev weight on this.
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13486
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Shiptrader definition

Post by euclid »

@JJJJ222: I've removed your post with the link to uploaded gamefiles. Consider this as an official warning.

Please (and that for all) do not upload the game or parts of it anywhere.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
aftokinito
Posts: 229
Joined: Sun, 30. Mar 08, 17:29
x4

Re: Shiptrader definition

Post by aftokinito »

I figured it out:

GetContainerBuilderMacros uses GetWares with filter tags "ship" and then compares the results' macros' ship size with that of the buildmodule's macro.
The problem with my player shipyards is the parameter "const char* licenceownerid" since the player does not have licenses. This causes the engine to spazz out and return random garbage from GetContainerBuilderMacros.

/thread.

Return to “X4: Foundations - Scripts and Modding”