Errors found in vanilla scripts

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

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

Post Reply
Browser_ice
Posts: 231
Joined: Sun, 5. Feb 06, 18:15

Errors found in vanilla scripts

Post by Browser_ice » Sun, 1. Oct 17, 16:26

Hi, since there is a patch being tested, I thought this could act as a central place for anyone seeing any error coding in the vanilla scripts.

I found one.

Code: Select all

File mining.ship.collect.xml
line 29-42

      <!-- Move to destination zone -->
      <do_if value="this.ship.zone != $zone">
        <debug_text text="'Go mining to zone: ' + $zone.knownname" chance="$debugchance" />
        <!-- If the zone to mine is a highway -->
        <do_if value="$zone.isclass.highway">
          <debug_text text="'Error moving to %1. This zone is a highway'" />
          <!-- <resume label="start" /> -->
        </do_if>
        <run_script name="'move.generic'">
          <param name="destination" value="$zone"/>
          <param name="endintargetzone" value="true" />
          <param name="debugchance" value="$debugchance"/>
        </run_script>
      </do_if>


explanation: 
line 34: missing variable in the debug_text command
Since this is a pretty rare situation to actually happen, probably experienced it.

Found same thing in same file at line 470
      <!-- Move to destination zone -->
      <do_if value="this.ship.zone != $zone">
        <debug_text text="'Go mining to zone: ' + $zone.knownname" chance="$debugchance" />
        <!-- If the zone to mine is a highway -->
        <do_if value="$zone.isclass.highway">
          <debug_text text="'Error moving to %1. This zone is a highway'" />
          <!-- <resume label="start" /> -->
        </do_if>

Found something else at line 513
        <do_if value="$gatherrate" max="0">
          <debug_text text="player.age + ' WARNING: gatherrate for %1 in zone %2 is %4'.[$currentware, $zone.knownname, $gatherrate]" chance="$debugchance" />
        </do_if>

explanation:
Its using %4 when there are no 4th variables in the list. Should be %3
I am not an expert in XR script. I am just beginning. I do know programming. I just have to learn this one while I figure out a few bugs that bugs me.
Steam X-Superbox, playing XR
WIndows-7
Intel I5
16Gb Memory
Nvgidia GT 960

Browser_ice
Posts: 231
Joined: Sun, 5. Feb 06, 18:15

Post by Browser_ice » Sun, 1. Oct 17, 19:51

Found what looks to be assumption of one variable to be available when its not. It does not affect the game logic in anyway, just debug informations.

I had a large mining ship with empty cargo. I assigned to my warehouse manager. It mined a bit then unloaded to my warehouse.

Code: Select all

The resulting log events I saw :

[Scripts] 18575.31 *** aicontext<mining.ship.collect,0x11773>: 18575.311 Miner-Large-Gaz(job: '') completed gather-run of Hydrogène in My Testing Sector. Cargo: [ware.fuelcells,ware.hydrogen]

code for the above:
<debug_text text="player.age + ' %1(job: \'%2\') completed gather-run of %3 in %4. Cargo: %5'.[this.ship.knownname, this.ship.job, $ware, $zone.knownname, this.ship.cargo.list]" chance="$debugchance" />

and a few minutes later:
[Scripts] 18980.28 *** aicontext<mining.ship.station,0x11773>: 18980.28 Miner-Large-Gaz(job: '') unloaded 8000 units of 'Hydrogène' at 'Entrepôt I', traderesult: 

code for the above:
<debug_text text="player.age + ' %1(job: \'%5\') unloaded %2 units of \'%3\' at \'%4\', traderesult: %5'.[this.ship.knownname, $amount, $currentware, $homebase.knownname, this.ship.job, $traderesult]" chance="$debugchance2" />
Both lines matching those logs were using this.ship.job variable to output but it turns out to be empty. The mining was ordered by the warehouse, so there should be a job associated with that ?
Steam X-Superbox, playing XR
WIndows-7
Intel I5
16Gb Memory
Nvgidia GT 960

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13817
Joined: Sun, 20. Nov 05, 23:45

Post by UniTrader » Mon, 2. Oct 17, 02:41

regarding Jobs: these are only for non-player ships and regulate the spawning behavior and what the npc Ships do when created. its completely fine that this info is not present for player ships, because these usually dont respawn.
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: 7036
Joined: Tue, 30. Mar 04, 12:28

Post by Sparky Sparkycorp » Tue, 3. Oct 17, 02:41

Hi Browser,

Are these issues related to the 4.10 release version or the 4.21 HF1 beta version?

If you have any mods/save game edits in your game, please could you list them? Could any of them cause these issues?

Thanks in advance,
Sparky

Browser_ice
Posts: 231
Joined: Sun, 5. Feb 06, 18:15

Post by Browser_ice » Tue, 3. Oct 17, 15:52

All extension folders have been deleted except for the 2 Egosoft DLCs and mine where I have my log replacements. The save file was a brand new game from that setup.

So I am running a true vanilla version.
Steam X-Superbox, playing XR
WIndows-7
Intel I5
16Gb Memory
Nvgidia GT 960

Post Reply

Return to “X Rebirth - Scripts and Modding”