Request : More expensive ships

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

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

Folker
Posts: 127
Joined: Fri, 31. Jul 20, 21:56
x4

Request : More expensive ships

Post by Folker »

Could someone make the ships more expensive to buy? We could set the price as we want in a menu interface by setting a percentage, I am thinking of a script by doing this it will be compatible for all mods and DLC.
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Request : More expensive ships

Post by DeadAirRT »

The way you describe it isn't nearly as easy as you think. The price you pay is based on wares.xml which can't be changed by md. It may be possible with lua changes but would break every single update/dlc most likely.

Edit: it may be possible using a negative discount but i don't know of any modder other than myself who has really messed with discounts/commissions in x4.
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: Request : More expensive ships

Post by kuertee »

DeadAirRT wrote: Sun, 6. Mar 22, 15:45 ...Edit: it may be possible using a negative discount but i don't know of any modder other than myself who has really messed with discounts/commissions in x4.
ohhh ... that's a good way to do apply extra costs, deadair!
here's how i apply discounts/commissions in my Reputations and Professions mod.
in this example, the discounts/commissions are penalties for having the mercenary Reputation.
these are added when the player docks at a station. but i'm sure it can be added anytime:
Spoiler
Show

Code: Select all

<signal_cue_instantly cue="AddRemoveTradeDiscount" param="table[
	$discount = -25 / 4 * 2,
	$discountId = 'kProfs_mercenary_discount_penalty',
	$discountName = {161815, 555},
	$station = $station,
	$isRemove = 0
]"  comment="Mercenary trade discount penalty" />
<signal_cue_instantly cue="AddRemoveTradeCommission" param="table[
	$commission = -25 / 4 * 2,
	$commissionId = 'kProfs_mercenary_commission_penalty',
	$commissionName = {161815, 555},
	$station = $station,
	$isRemove = 0
]"  comment="Mercenary trade commission penalty" />
then these are the actual add/remove discount/commission codes:
Spoiler
Show

Code: Select all

<cue name="AddRemoveTradeDiscount">
	<conditions>
		<event_cue_signalled />
	</conditions>
	<actions>
		<set_value name="$discount" exact="@event.param.$discount" />
		<set_value name="$discountId" exact="@event.param.$discountId" />
		<set_value name="$discountName" exact="@event.param.$discountName" />
		<set_value name="$station" exact="@event.param.$station" />
		<set_value name="$isRemove" exact="@event.param.$isRemove" />
		<debug_text text="'$isRemove: ' + $isRemove" chance="UserSettings.$debugChance" />
		<do_if value="(not $isRemove) and (not player.hasdiscount.{$station}.{$discountId})">
			<add_player_discount id="$discountId" amount="$discount" object="$station" name="$discountName"/>
			<debug_text text="'player.hasdiscount.{$station}.{' + $discountId + '}: ' + player.hasdiscount.{$station}.{$discountId}" chance="UserSettings.$debugChance" />
		</do_if>
		<do_elseif value="$isRemove and player.hasdiscount.{$station}.{$discountId}">
			<remove_player_discount id="$discountId" object="$station"/>
			<debug_text text="'player.hasdiscount.{$station}.{' + $discountId + '}: ' + player.hasdiscount.{$station}.{$discountId}" chance="UserSettings.$debugChance" />
		</do_elseif>
		<reset_cue cue="this" />
	</actions>
</cue>
<cue name="AddRemoveTradeCommission">
	<conditions>
		<event_cue_signalled />
	</conditions>
	<actions>
		<set_value name="$commission" exact="@event.param.$commission" />
		<set_value name="$commissionId" exact="@event.param.$commissionId" />
		<set_value name="$commissionName" exact="@event.param.$commissionName" />
		<set_value name="$station" exact="@event.param.$station" />
		<set_value name="$isRemove" exact="@event.param.$isRemove" />
		<debug_text text="'$isRemove: ' + $isRemove" chance="UserSettings.$debugChance" />
		<do_if value="(not $isRemove) and (not player.hascommission.{$station}.{$commissionId})">
			<add_player_commission id="$commissionId" amount="$commission" object="$station" name="$commissionName"/>
			<debug_text text="'player.hascommission.{$station}.{' + $commissionId + '}: ' + player.hascommission.{$station}.{$commissionId}" chance="UserSettings.$debugChance" />
		</do_if>
		<do_elseif value="$isRemove and player.hascommission.{$station}.{$commissionId}">
			<remove_player_commission id="$commissionId" object="$station"/>
			<debug_text text="'player.hascommission.{$station}.{' + $commissionId + '}: ' + player.hascommission.{$station}.{$commissionId}" chance="UserSettings.$debugChance" />
		</do_elseif>
		<reset_cue cue="this" />
	</actions>
</cue>
so ... discounts/commission don't need any special DB entries.
just plug the data in (e.g. an id so that it can be used in the removal, the discount/commission bonus or penalty itself, a straight text in the description, and the station to apply the discount/commission).
it can likely be applied faction-wide rather than per-station. need doc reading to confirm. (i'm too lazy to go to the docs. :D)

someone just needs to put it all together in a mod!
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Request : More expensive ships

Post by DeadAirRT »

kuertee wrote: Sun, 6. Mar 22, 16:13
DeadAirRT wrote: Sun, 6. Mar 22, 15:45 ...Edit: it may be possible using a negative discount but i don't know of any modder other than myself who has really messed with discounts/commissions in x4.
ohhh ... that's a good way to do apply extra costs, deadair!
here's how i apply discounts/commissions in my Reputations and Professions mod.
in this example, the discounts/commissions are penalties for having the mercenary Reputation.
these are added when the player docks at a station. but i'm sure it can be added anytime:
Spoiler
Show

Code: Select all

<signal_cue_instantly cue="AddRemoveTradeDiscount" param="table[
	$discount = -25 / 4 * 2,
	$discountId = 'kProfs_mercenary_discount_penalty',
	$discountName = {161815, 555},
	$station = $station,
	$isRemove = 0
]"  comment="Mercenary trade discount penalty" />
<signal_cue_instantly cue="AddRemoveTradeCommission" param="table[
	$commission = -25 / 4 * 2,
	$commissionId = 'kProfs_mercenary_commission_penalty',
	$commissionName = {161815, 555},
	$station = $station,
	$isRemove = 0
]"  comment="Mercenary trade commission penalty" />
then these are the actual add/remove discount/commission codes:
Spoiler
Show

Code: Select all

<cue name="AddRemoveTradeDiscount">
	<conditions>
		<event_cue_signalled />
	</conditions>
	<actions>
		<set_value name="$discount" exact="@event.param.$discount" />
		<set_value name="$discountId" exact="@event.param.$discountId" />
		<set_value name="$discountName" exact="@event.param.$discountName" />
		<set_value name="$station" exact="@event.param.$station" />
		<set_value name="$isRemove" exact="@event.param.$isRemove" />
		<debug_text text="'$isRemove: ' + $isRemove" chance="UserSettings.$debugChance" />
		<do_if value="(not $isRemove) and (not player.hasdiscount.{$station}.{$discountId})">
			<add_player_discount id="$discountId" amount="$discount" object="$station" name="$discountName"/>
			<debug_text text="'player.hasdiscount.{$station}.{' + $discountId + '}: ' + player.hasdiscount.{$station}.{$discountId}" chance="UserSettings.$debugChance" />
		</do_if>
		<do_elseif value="$isRemove and player.hasdiscount.{$station}.{$discountId}">
			<remove_player_discount id="$discountId" object="$station"/>
			<debug_text text="'player.hasdiscount.{$station}.{' + $discountId + '}: ' + player.hasdiscount.{$station}.{$discountId}" chance="UserSettings.$debugChance" />
		</do_elseif>
		<reset_cue cue="this" />
	</actions>
</cue>
<cue name="AddRemoveTradeCommission">
	<conditions>
		<event_cue_signalled />
	</conditions>
	<actions>
		<set_value name="$commission" exact="@event.param.$commission" />
		<set_value name="$commissionId" exact="@event.param.$commissionId" />
		<set_value name="$commissionName" exact="@event.param.$commissionName" />
		<set_value name="$station" exact="@event.param.$station" />
		<set_value name="$isRemove" exact="@event.param.$isRemove" />
		<debug_text text="'$isRemove: ' + $isRemove" chance="UserSettings.$debugChance" />
		<do_if value="(not $isRemove) and (not player.hascommission.{$station}.{$commissionId})">
			<add_player_commission id="$commissionId" amount="$commission" object="$station" name="$commissionName"/>
			<debug_text text="'player.hascommission.{$station}.{' + $commissionId + '}: ' + player.hascommission.{$station}.{$commissionId}" chance="UserSettings.$debugChance" />
		</do_if>
		<do_elseif value="$isRemove and player.hascommission.{$station}.{$commissionId}">
			<remove_player_commission id="$commissionId" object="$station"/>
			<debug_text text="'player.hascommission.{$station}.{' + $commissionId + '}: ' + player.hascommission.{$station}.{$commissionId}" chance="UserSettings.$debugChance" />
		</do_elseif>
		<reset_cue cue="this" />
	</actions>
</cue>
so ... discounts/commission don't need any special DB entries.
just plug the data in (e.g. an id so that it can be used in the removal, the discount/commission bonus or penalty itself, a straight text in the description, and the station to apply the discount/commission).
it can likely be applied faction-wide rather than per-station. need doc reading to confirm. (i'm too lazy to go to the docs. :D)

someone just needs to put it all together in a mod!
It can be applied to a station only. If anyone is interested in making this, look at how signal leaks apply a discount to stations.
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: Request : More expensive ships

Post by kuertee »

DeadAirRT wrote: Sun, 6. Mar 22, 18:10 It can be applied to a station only. If anyone is interested in making this, look at how signal leaks apply a discount to stations.
oh ... too bad it can't be applied faction-wide. so the application of the discount/commission needs to be on the dock event - which is how it works in my mod.

also, by the way, that code snippet above already works in my mod, Reputations and Profession, which applies discounts/comissions depending on your profession (e.g. Trader) and/or reputation (e.g. prices for Viglante and Mercenaries reputations are more because they are not as trusted as Defenders). also those discounts/commissions are additional to whatever else the base game gives you. (no need to dig through signal leaks xml, unless you really want to.)
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Request : More expensive ships

Post by DeadAirRT »

kuertee wrote: Sun, 6. Mar 22, 18:43
DeadAirRT wrote: Sun, 6. Mar 22, 18:10 It can be applied to a station only. If anyone is interested in making this, look at how signal leaks apply a discount to stations.
oh ... too bad it can't be applied faction-wide. so the application of the discount/commission needs to be on the dock event - which is how it works in my mod.

also, by the way, that code snippet above already works in my mod, Reputations and Profession, which applies discounts/comissions depending on your profession (e.g. Trader) and/or reputation (e.g. prices for Viglante and Mercenaries reputations are more because they are not as trusted as Defenders). also those discounts/commissions are additional to whatever else the base game gives you. (no need to dig through signal leaks xml, unless you really want to.)
Discounts can be applied faction wide but not commissions iirc from my testing
Folker
Posts: 127
Joined: Fri, 31. Jul 20, 21:56
x4

Re: Request : More expensive ships

Post by Folker »

kuertee wrote: Sun, 6. Mar 22, 18:43
DeadAirRT wrote: Sun, 6. Mar 22, 18:10 It can be applied to a station only. If anyone is interested in making this, look at how signal leaks apply a discount to stations.
oh ... too bad it can't be applied faction-wide. so the application of the discount/commission needs to be on the dock event - which is how it works in my mod.

Also, by the way, that code snippet above already works in my mod, Reputations and Profession, which applies discounts/comissions depending on your profession (e.g. Trader) and/or reputation (e.g. prices for Viglante and Mercenaries reputations are more because they are not as trusted as Defenders). also those discounts/commissions are additional to whatever else the base game gives you. (no need to dig through signal leaks xml, unless you really want to.)
So if I understand correctly, it is possible to do this with negative discounts like in reputation and profession.

I have a little idea, a kind of "invisible reputation" that appears at the beginning of the game, that you can't get rid of, that increases the purchase price of the ship, and if it doesn't work do it on all the wares.xml thanks to a script that is coded with a line like "for all the wares", even if I think it's a bit more complicated than that

Do you think this is a good idea or solution?
djrygar
Posts: 1842
Joined: Mon, 10. Aug 09, 02:09
x3ap

Re: Request : More expensive ships

Post by djrygar »

If you want to make ships more expensive to balance the game, ship prices will not cut it.

Intall 2 mods: "Getting Paid" and "Wear and Tear"

the result is that you will be forcecd to employ engineering crews and pay them every hour, and that will increase economic burden on your empire and slow down explosive growth of income. You will still grow, but slower.
Folker
Posts: 127
Joined: Fri, 31. Jul 20, 21:56
x4

Re: Request : More expensive ships

Post by Folker »

djrygar wrote: Fri, 11. Mar 22, 08:21 If you want to make ships more expensive to balance the game, ship prices will not cut it.

Intall 2 mods: "Getting Paid" and "Wear and Tear"

the result is that you will be forcecd to employ engineering crews and pay them every hour, and that will increase economic burden on your empire and slow down explosive growth of income. You will still grow, but slower.
I already have those two mods. Ah yes, I see, I'll raise the salary of the employees, it's something in my beginner skills. I'll see if it's possible, and I'll make NPCs more expensive to buy, for example 500,000 credits for the soldier and the engineers. And if possible increase their salary. Thanks, I didn't see this problem like that.

Like this for a heavy fighter, 3 employees, the ship will make 1.8M taking into account the hull.

A Corvette, 15 employees, 9.5M, taking into account the hull

A carrier, 200 employees, 120 000 000, taking into account the hull

Return to “X4: Foundations - Scripts and Modding”