Add additional 'description' parameter to the <transfer_money /> action

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

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

Mycu
Posts: 410
Joined: Fri, 28. Sep 12, 08:30
x4

Add additional 'description' parameter to the <transfer_money /> action

Post by Mycu » Thu, 18. Jan 24, 15:17

Currently there is no way to add any kind of description to the <transfer_money /> action.
All transactions in the transaction log use the name of the passed object (object is passed as a reference) and some fixed 'type' (like transfer, profit from trade orders, mission reward etc) that is not available outside of the game engine.

Many mods add transactions, that are 'faction' based and not tied to actual object - so such transactions are visible as just 'Transfer' in the transaction log reducing the usefulness and readability of this overview.

https://i.imgur.com/RxCRG3N.png

Can we have an optional 'description' parameter to the <transfer_money /> action?
Than (if provided) it would be just added before or after the object name (LUA's entry.partnername) in transaction log?

So e.g. when there's just faction as a action param:

Code: Select all

<transfer_money from="faction.argon" to="faction.player" amount="200000Cr" description="Reward for destroying XXX-123" />
transaction log could produce
Reward for destroying XXX-123 - Transfer -------- 0m00s -------- +200000 Cr

instead of (as it is now)
Transfer ------------------------------------------------ 0m00s -------- +200000 Cr

Also modders could enrich exisiting transaction details using thos param.
X3 AP 3.1 + XRM
X3 AP 3.1 + LU

CBJ
EGOSOFT
EGOSOFT
Posts: 52242
Joined: Tue, 29. Apr 03, 00:56
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by CBJ » Thu, 18. Jan 24, 15:39

Moved out of Tech Support, which is not the right place for feature requests.

Logs like this take up a huge amount of space in savegames, so we wouldn't want to store custom text against entries. We currently just store a log event type, which is then resolved to one of the texts on page 1020. If it would be sufficient to be able to specify one of these log entry types then that would probably be possible; otherwise I'm afraid the answer is no.

Mycu
Posts: 410
Joined: Fri, 28. Sep 12, 08:30
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by Mycu » Thu, 18. Jan 24, 16:23

CBJ wrote:
Thu, 18. Jan 24, 15:39
Logs like this take up a huge amount of space in savegames, so we wouldn't want to store custom text against entries.
I was afraid of that reason but hoped no one would figure it out before implementing ;)

CBJ wrote:
Thu, 18. Jan 24, 15:39
We currently just store a log event type, which is then resolved to one of the texts on page 1020
It would be some welcome middleground allowing a modder to add some custom general types to the pool, so in our example more general information like 'Reward for destroying enemy ship' type.
X3 AP 3.1 + XRM
X3 AP 3.1 + LU

CBJ
EGOSOFT
EGOSOFT
Posts: 52242
Joined: Tue, 29. Apr 03, 00:56
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by CBJ » Thu, 18. Jan 24, 16:33

Mycu wrote:
Thu, 18. Jan 24, 16:23
...allowing a modder to add some custom general types to the pool...
I'm afraid not. The list of log event types is not moddable. New entries on the text page wouldn't correspond to log entry types and therefore couldn't be used.

Mycu
Posts: 410
Joined: Fri, 28. Sep 12, 08:30
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by Mycu » Thu, 18. Jan 24, 17:05

Ah, so the page entry coresponds to the internal type (orderqueue_add, tf_cost, buyoffer).
So unfortunately it wouldn't be that useful being limited to 37 types that are available now.

But maybe it would be possible to introduce a parameter of page type (instead string type), so:

Code: Select all

<transfer_money from="faction.argon" to="faction.player" amount="200000Cr" description="{1234, 100}" />
This way the savegame will contain only page and text ids - and all the strings will be in t-files?
X3 AP 3.1 + XRM
X3 AP 3.1 + LU

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13308
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by euclid » Thu, 18. Jan 24, 17:11

I guess it's easier to just send an additional, more detailed message to the player's logbook?

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

Mycu
Posts: 410
Joined: Fri, 28. Sep 12, 08:30
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by Mycu » Thu, 18. Jan 24, 17:18

euclid wrote:
Thu, 18. Jan 24, 17:11
I guess it's easier to just send an additional, more detailed message to the player's logbook?

Cheers Euclid
Easier, in the sense that it is possible with the current code base - yes.
But it wouldn't make the transaction log more verbose unfortunately, and the strings are still being kept in the savegame - no matter if it is logbook or transaction log entry.
X3 AP 3.1 + XRM
X3 AP 3.1 + LU

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13308
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by euclid » Thu, 18. Jan 24, 17:30

The advange is the ability to delete (clear) logbook pages selectively.

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

Mycu
Posts: 410
Joined: Fri, 28. Sep 12, 08:30
x4

Re: Add additional 'description' parameter to the <transfer_money /> action

Post by Mycu » Fri, 19. Jan 24, 19:36

Mycu wrote:
Thu, 18. Jan 24, 17:05
But maybe it would be possible to introduce a parameter of page type (instead string type), so:

Code: Select all

<transfer_money from="faction.argon" to="faction.player" amount="200000Cr" description="{1234, 100}" />
Just for the record - correct syntax would rather be like:

Code: Select all

<transfer_money from="faction.argon" to="faction.player" amount="200000Cr" page="1234" line="100" />
X3 AP 3.1 + XRM
X3 AP 3.1 + LU

Return to “X4: Foundations - Scripts and Modding”