[Official Mod Development Bug Reports] A Thread for Mod Creators

The place to discuss scripting and game modifications for X Rebirth.

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

Post Reply
j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

[Official Mod Development Bug Reports] A Thread for Mod Creators

Post by j.harshaw » Tue, 24. Nov 15, 12:10

We recognize that feedback from modders can be invaluable in tracing problems and finding opportunities with the code. As such, we would like to open this thread for modders to report problems encountered over the course of mod development. Things such as:
  • repro cases of commands causing crashes or freezes,
  • commands not doing things you expect them to,
  • unforeseen limitations,
  • or unexpected changes in how commands behave between updates
would be of particular value.

Please limit reports to:
  • concise code snippet(s) that would suffice to illustrate a problem,
  • in addition to a description of what went wrong or how it could be improved,
  • and the version of the game where the problem was encountered.
A link to the mod where the snippet was taken from, or a discussion of the problem in detail, would also be useful for closer inspection.
A link to a save game if it would help to reliably reproduce an issue would also be appreciated.

That said, please do bear in mind that we have a small team, and priority remains in working on making the vanilla game better.

Maintenance of mods are still the responsibility of modders. As such, mod users who encounter problems should still post reports in the respective mod threads. This saves us time by keeping our attention on the vanilla code, saves modders time by not having to look in different places for reports or feedback that might be related to their mods, and should result in you getting a better game faster.

And please do bear in mind that this is not a modding tutorial thread. Resources for that are available in the X Rebirth Tools, Tutorials, and Resources thread in the X Rebirth Scripts and Modding forum.

_____
PROGRESS REPORT:

1) No way to keep track of mass traffic networks launched from one entity onto another. - w.e

- being investigated

.......
2) <add_buy_order/> and <add_sell_order/> moves money between the player's account and the captain's/manager's/architect's even if the entity is not directly subordinate to the player. - UniTrader

- functionality will change in an upcoming build
BurnIt! wrote:the code will be changed to always use the account of the commanderentity - for player ships in the player squad or without any commander that will be the player, so everything works as before.
For ships assigned to a Manager that will be the Manager. For ships assigned to the Defence Officer it will be the DO etc.

WARNING: if the commander entity does not have it's own account (typically the case for a Defence Officer or Captain/Pilot of a ship not currently trading) it would still default to the faction account which means player owned ships assigned to any such entity would still use the player account for money transfers! (see script property $entity.hasownaccount)
.......
3) When using <create_ship/> to create a ship with a defined basket, scripts acting on that ship do not recognize the basket. - Clownmug

- working as intended - While the "basket" property can be used with create_ship to spawn wares upon ship creation, the basket as an actual ware basket for later script reference is only used for job ships.

.......
4) "{1001,101} Cr" in move.refuel is read in twice before printing to logbook, thus printing "$amount Cr Cr" - jth

- FIXED in an upcoming build

.......
5) Reservation handling like get_ware_reservation does not distinguish between incoming and outgoing trades. - Marvin Martian

- CHANGED as of 4.0 Beta 4 HF2

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

.......
6) Using a certain number of components in a crafting recipe prohibits using a different number of components in a different recipe. - oliverjanda

- FIXED in an upcoming build

.......
7) Loading game via "Continue" does not appear to trigger <event_game_loaded/> - oliverjanda

- working properly as of 4.00 Beta 3

.......
8 ) Using unrecognized characters causes corrupted save. - UniTrader

- FIXED as of 4.00 Beta 4 HF 1

.......
9) Reset of mass traffic between save-load cycles causes loss of wares. - Marvin Martian

- working as intended - Mass traffic elements are generated upon game load, but wares within a mass traffic network are written into the save file, and are transferred normally upon game load.

.......
10) When using <move_to boost="true"/>, ships start boosting immediately rather than rotating into a good orientation before boosting. - Marvin Martian

- MM confirmed that it works for flightcontrolmodel.spline

clarification: <move_to boost="true"/> does only boost if it has a straight-line path and the way is unobstructed. This means that rather than the old behavior where ships about to boost stop and turn before boosting, they'll turn and maneouver the way they normally do until it is safe to boost, and will do so only in that case.

HOWEVER, ships will only do so if they are using flightcontrolmodel.spline. This is the default flight control model, so if this is not overridden by either specifying a different fcm, or using forcesteering="true" ships will use this.

Important note about forcesteering: if forcesteering is set to true at ANY point in the controlling entity's (usually captain or pilot) history, fcm is changed, even if forcesteering is later set to "false." In this case, setting fcm back to spline by using

Code: Select all

<set_flight_control_model object="$ship" flightcontrolmodel="flightcontrolmodel.spline"/>
should get them back on using fcm spline.

In any other flight control model, ships are much less selective about when to boost, and will tend to do so immediately when the move_to is called.

@Adrian, if any of this is wrong, please feel free to correct.

@Marvin, thanks for the report, and for testing and confirming that it works as described.

.......
11) Plot-triggered station construction in DeVries does not begin until player is in-zone. - YorrickVander

- being investigated

.......
12) Stations constructed in DeVries via plot-trigger do not upgrade, so do not have shields nor turrets. - YorrickVander

- being investigated

.......
13) Vile lua stuff :P - jth

- FIXED

_____
Thank you for your reports thus far!

If you have reported what appears to be a problem, and it does not appear on this list, or if I didn't summarize a problem you reported correctly, please let me know.

If a reported issue appears unaddressed, and has been marked as addressed, I probably screwed up and didn't understand what the problem was in the first place. In such a case, please do not hesitate to let me know -- either on this thread or via PM.
Last edited by j.harshaw on Thu, 21. Jan 16, 22:09, edited 29 times in total.

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Tue, 24. Nov 15, 14:37

Sample report:

Problem: Since mass-traffic IDs appear to be dynamically assigned per save-reload cycle, there appears to be no way to keep track of mass-traffic networks launched from one entity onto another between save-reload cycles.

Code:

vanilla from engineer.ai

Code: Select all

<launch_repair_drones object="$Defensible" target="$Defensible" components="$MassTrafficTargets" result="$networkid"/>
modified code:

Code: Select all

<launch_repair_drones object="this.defensible" target="$Defensible" components="$MassTrafficTargets" result="$networkid"/>
Mod: Mod using this code has not been published due to the problem remaining unresolved. Detailed discussion available here:

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

Last tested with X Rebirth 3.61 release.

Suggest low priority due to this situation not occurring in vanilla.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Tue, 24. Nov 15, 18:21

got some things where i have to work around a bit (or which i find useful):

1. To be honest not really in the Scope of this, but anyway:
add the possibility to include Custom Hotkeys (best with AI/MD Events which catch them)
had to say that :D possibilities for this are unlimited ;) (especially for testing stuff)



2. Unexpected behavior:
<add_trade_order/> and <remove_trade_order/>
both Commands transfer Money from/to the Player Entity to/from the Captain/(this?) even if the Ship works for someone else (i like how these display Info about planned Trade in the Info Menu as Player feedback) - really annoying if i have to keep track how much Money the Captain has in his account to avoid unnecesary Money Transfers by transferring the exactly right amount beforehand.
Suggestion: add an optional Parameter like @transferaccount to specify an Entity whose Account should be used instead of the Player account to transfer needed/surplus Money ( player stays is default if not specified), and if a null value is passed dont transfer Money at all

I think this explaination is clear enough, but if necesary i will provide some example Code

low priority since its not an Issue for Vanilla Gameplay



3. hmm.. thought it was more, but nothing in my current major Project :o will look through my other stuff, i am sure there were some things i had to work around, but dont remember them anymore..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
Marvin Martian
Posts: 3545
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Tue, 24. Nov 15, 18:38

about <dependency /> of addons
i can't find any further conditions in the xsd description about make them optional

but it would be helpfull beside of fully optionally dependencies, simply to use conditions like

Code: Select all

<check_any>
	<dependency id="ws_0815" version="120" />
	<dependency id="foo_bar" version="120" />
</check_any>
<dependency id="bar_foo" negate="true"/>
to prevent loading if another Mod is active, and/or if there are diffrent IDs at workshop and some other sources

Clownmug
Posts: 418
Joined: Wed, 11. Dec 13, 02:39
x4

Post by Clownmug » Tue, 24. Nov 15, 23:38

I ran into two issues recently while working on my Random Universe mod and using version 4.00 Beta 3.

First Issue
The "mining.ship.free" aiscript doesn't use the basket defined from "<create_ship>", I have to use the "basketoverride" param. If I don't use it, the mining ship will end up running "move.die" because it doesn't see the basket.

Code: Select all

Example mining ship:
<create_ship name="$MinerShip" macro="[macro.units_size_m_ions_collector_macro,macro.units_size_m_hydrogen_collector_macro].random" zone="$Zone">
	<owner exact="$ShipFaction" overridenpc="true"/>
	<pilot>
		<select faction="$ShipFaction" tags="[tag.pilot]"/>
	</pilot>
	<units>
		<unit category="unitcategory.gascollector" mk="2" exact="3" />
	</units>
	<cargo>
		<wares basket="gases">
			<fillpercent min="20" max="30"/>
		</wares>
	</cargo>
	<basket basket="gases"/>
	<safepos x="$x" y="$y" z="$z" />
</create_ship>

OK:
<start_script object="$MinerShip.pilot" name="'mining.ship.free'">
	<param name="basketoverride" value="[ware.hydrogen,ware.ions,ware.plasma]"/>
</start_script>

Not OK:
<start_script object="$MinerShip.pilot" name="'mining.ship.free'"/>
Second Issue
When getting the name property of a ship, their faction's abbreviation is included. Also, if you use <set_object_name> the faction abbreviation is removed.

Code: Select all

Example:
<set_object_name object="$PMC_Taranis" name="'Warden Destroyer' + ' ' + $PMC_Taranis.name"/>

Result:
Warden Destroyer PMC Taranis

Code: Select all

Example:
<set_object_name object="$PMC_Taranis" name="'Warden Destroyer' + ' ' + $PMC_Taranis.macro.name"/>

Result:
Warden Destroyer Taranis (No abbreviation shown on zone map)

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

move.refuel Transferred $MONEY$ Cr Cr to $ENTITY$ ...

Post by jth » Wed, 25. Nov 15, 12:38

From the aiscript move.refuel.xml around line 139 in version 3.61

Code: Select all

        <do_if value="$accountholder == player.entity">
          <!-- send notification that money is being used for re-fueling -->
          <set_value name="$moneytext" exact="'%1 %2'.[(($tradeoffer.unitprice * $amount) / 1Cr)i, {1001,101}]" />
          <show_notification caption="{1015,34}" comment="Transferring funds for refueling" sound="notification_generic"
                             details="[
                                        [ null, this.ship.name, this.sector.name ],
                                        [ ware.fuelcells.icon, ware.fuelcells.name, {1001,1202} + {1001,120}, null, null, $amount ],
                                        [ null, {1001,2000}, {1001,1202} + {1001,120}, null, null, $moneytext ]
                                      ]" />
          <substitute_text text="$logtext" source="{1016,15}" comment="Transferred $MONEY$ Cr to $ENTITY$ to buy $AMOUNT$ Fuel Cells.\nLocation: $SHIP$ in sector $SECTOR$">
            <replace string="'$MONEY$'" with="$moneytext" />
            <replace string="'$ENTITY$'" with="this.name" />
            <replace string="'$AMOUNT$'" with="$amount" />
            <replace string="'$SHIP$'" with="this.ship.name" />
            <replace string="'$SECTOR$'" with="this.sector.name" />
          </substitute_text>
          <write_to_logbook category="upkeep" text="$logtext" />
A fairly simple bug which I patch in FormatThousands and which should really be eliminated at source

$moneytext is set up to be used in show_notification and includes a {1001,101} Cr and then its substituted into $logtext which also has a {1001,101} Cr inside {1016,15} so you get the double Cr when its written to the logbook

Low priority

jth

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Wed, 25. Nov 15, 19:52

Thank you, everyone, for your reports so far.

...
@jth, the problem is being looked at.

And thank you for the particularly clear presentation of the problem.

...
@Clownmug, sent you a PM.

...
@Marvin, Uni, nice ideas, but we really can't entertain suggestions at the moment.

That said, I think that it is a good idea to have ideas like this which are of particular use to modders available in one place. So keep them coming, but more bug reports than suggestions, please.

...
@Uni, flagged your report about trade orders for further attention.

=== NOTED UP TO THIS POINT ===

edit: Grammar is hard.
Last edited by j.harshaw on Wed, 25. Nov 15, 22:44, edited 2 times in total.

User avatar
Marvin Martian
Posts: 3545
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Wed, 25. Nov 15, 20:05

my suggestion doesn't work yet, so in case it is a bug :D

ok you want a bug:
reservation handling like get_ware_reservation do not distinct if the reservation is a in-comming amount, or a open sell trade

so in case you have a Station that trades for example ore by tradewares, you have nothing to sell in case your cargo-amount is less then incomming miningship deliver-reservations

thats also effects the Manager, not only the funtion above

up to 400 this was only a modding related problem because we had no tradestation, but as far i know, we now will get a station for trade, then on ware with high flow this will be a upcomming problem

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Wed, 25. Nov 15, 20:09

@Marnin

seconded, doesnt affect me yet but yes Buy and Sell Reservations are the same.. not affecting anything if a Ware is only bought or Sold, but in case its traded in both directions things get weird.. so the possibility to differ between incoming and outgoing reservations would be really helpful...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Wed, 25. Nov 15, 20:18

Not sure if related but we have a few NPC stations that try to buy and sell the same items already.

User avatar
Marvin Martian
Posts: 3545
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Wed, 25. Nov 15, 20:43

yes the Plutarch Exchange
in case you have a similar "trading" and enough material for a full trade it buys minerals to max prices and sell to min at the next moment - your ship don't need to undock :P
it's like printing credits, as long as you not the owner of this station :roll:

it might be better to buy max at average and sell not lower then the average ware price instead of the full price range

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Wed, 25. Nov 15, 22:35

Haha. There's also the missile re-seller station in OL and Food Rations traded in the DV Habitations.

User avatar
Marvin Martian
Posts: 3545
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Thu, 26. Nov 15, 07:57

i think the FoodRations Trade is not tradeware based, they produce an amount, maybe a bit less they consume
here the manager reserve an amount of cargo stored ware already for the production

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Thu, 26. Nov 15, 11:22

Oliver's old bugrep about crafting:

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

Problem:
oliverjanda wrote:Hi,
I'm not sure if I'm in the right forum. Please move it to where it belongs...

I added some crafting recipes to the game and encountered an issue there:
It seems that it is only possible to set an amount of an inventory item once.
All other attempts to set a different amount in another recipe fail. :/

I.e. you can not make a recipe that requieres 100 Xenon components as there is already one that uses 1 component. Consequently, the new recipe will only require 1 xenon component for crafting regardless of the amount you specified.
Further discussed here:

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

and here

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

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Thu, 26. Nov 15, 11:46

Another old report by OliverJanda:

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

Problem:

Loading game via "Continue" does not appear to trigger <event_game_loaded/>

Last tested in X:R 3.53, so might have been fixed since then.
oliverjanda wrote:I'm not sure if this of interest here. Just ignore it if not...

I made a perfectly working MD script (see below) which is called on game load.
It was called on pressing f9 or loading via the load menu.
But it was NOT called when starting the game with the continue button.

Code: Select all

		<cue name="CraftDronesMKxPatch" instantiate="false">
			<conditions>
				<check_any>  
					<event_cue_signalled cue="md.Setup.GameStart" />
					<event_game_loaded/>  
				</check_any>     
			</conditions>
			<actions>  
				<include_actions ref="PatchTraderWares" />	
				<reset_cue cue="this"/>
			</actions>  
		</cue> 

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Thu, 26. Nov 15, 12:23

Updates:

OliverJanda's old report about crafting problems is being looked at.

Oliver's report regarding event_game_loaded and Marvin's report regarding ware reservations added to the list of things to look into.

Thanks everyone. Keep 'em coming.

=== NOTED UP TO THIS POINT ===

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 26. Nov 15, 12:32

devs are already informed, but here a reminder:
http://forum.egosoft.com/viewtopic.php?t=383122
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Thu, 26. Nov 15, 12:42

Thanks, Uni. I think that color can indeed be a mighty tool.

And note to everyone: please try to track down old bugs or inconsistencies we modders have learned to take for granted or work around in the past and post, or link to, them here.

Also important: please do verify that those bugs are still there in the latest game versions (beta or release) before posting. I personally think that this can be a valuable conduit between the modding community and the devteam, but it will be hard to get people to pay attention to these reports if we send people on wild goose chases. (You guys and gals field bug reports too, so you know what I'm talking about.)

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Post by j.harshaw » Fri, 27. Nov 15, 11:43

Added a progress report to the OP.

Added this to the bottom:

_____
Thank you for your reports thus far!

If you have reported what appears to be a problem, and it does not appear on this list, or if I didn't summarize a problem you reported correctly, please let me know.

Fixed problems will be removed from this list upon updating.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Official Mod Development Bug Reports] A Thread for Mod Creators

Post by UniTrader » Fri, 27. Nov 15, 12:03

clarification:
j.harshaw wrote: 2) <add_trade_order/> and <remove_trade_order/> moves money to and from the player's account to the captain's/manager's/architect's even if the entity works doesn't belong to the player faction. - UniTrader
Ship is in the Player Faction but not working for the Player himself, but for one of his Stations/Assets - still Money is transferred from/to the Players Personal Account (didnt test for Non-Player Assets, but i am pretty sure its the same there)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Post Reply

Return to “X Rebirth - Scripts and Modding”