[MOD] Mission Computer

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

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

Should the mission computer be a buyable software upgrade?

Yes
137
83%
No, it should be always available
29
17%
 
Total votes: 166

cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

Update is on its way!

The problem with the way the mission computer gets its mission list is that once it misses an unregister call for a mission that got deleted, this mission will stay in the list until the game is restarted. Therefore it's not unexpected that it does not work again after the problem has occured. That's why I'd like to find the issue, so I can avoid the list being cluttered with invalid entries at the top, as I have no idea how many that could be.
User avatar
YorrickVander
Posts: 2767
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

I have a feeling that it's the experimental Diplomatic Aid mission that causes the problem. Loading into b8 with the new version (ty for the faction icon addition btw) the top 2 missions on the list were 'Diplomatic Aid'. After that zone the mission list contains 2 blank entries at the top with the attendant

Code: Select all

[General] ======================================
[=ERROR=] Context:md.CF_MissionComputer_Base.ShowMissionComputer: Mission #1 (Start_Ref) cue state: disabled
[General] ======================================
[General] ======================================
[=ERROR=] Context:md.CF_MissionComputer_Base.ShowMissionComputer: Mission #2 (Start_Ref) cue state: disabled
[General] ======================================
EDIT : This disabled cue state gets into your game save too having tested the save/restart game :|
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

Thx, I'll take a look into that mission.

The cue state 'disabled' at least gives me the possibility to filter the list in the md code, so they won't stay and make the list longer and longer.

There still must be something special as I have already ignored some of the Diplomatic aid missions but never seen any problems.
Did you accept or ignore them?
My current main save game has a diplomatic aid on top, so I'll create a backup of it to experiment around.

Edit: It seems I found the problem: after just waiting in the sector some time I had an entry 'Mission expired' in the mission computer, with the same debug message (disabled cue) as already posted.

Edit 2: The problem is that the Diplomatic Aid mission does the timeout check, it does not rely on the GenericMission implementation to handle the timeout, therefore from the mission computer point of view the mission is never removed and causes the problematic behavior.

I will add some code that removes disabled cues from the mission list, it should not make any difference for the user if the mission is removed when the timeout expires or when the mission list is opened
User avatar
YorrickVander
Posts: 2767
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Good work :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
rguy1
Posts: 761
Joined: Tue, 21. Jul 09, 17:57
x3tc

Post by rguy1 »

Great mod and great work thankyou very much :D

I'm still running 2.20 Transend start bought the mission computer and it works great the only problems I have are quick save (F5) and quick load (F9) F5 game says game saved but F9 freezes game I can only load number saves and when I exit to start menu it goes to desktop. Is this because I'm still running 2.20?
cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

Anyone else playing with 2.20?

I tested quick save / load with 2.50 beta with the following result:
quick load works, but can freeze the game for some time (maybe around 20 seconds) before anything happens.
Exit game (to start menu) works as expected.

Did you try to load a quicksave by selecting it from the list from the start menu, i.e. no game running? Also did you check your debug log?

I use quick load quite rarely, but during mod development, still under 2.20, I had no problems. Maybe because I just never used quick load during that time...
rguy1
Posts: 761
Joined: Tue, 21. Jul 09, 17:57
x3tc

Post by rguy1 »

Ok thanks I'll just wait for 2.50 should'nt be too much longer and see what happens :)
Sytha
Posts: 13
Joined: Tue, 17. Jun 14, 13:39

Post by Sytha »

Hi!

I'me expiencing some problems with this mod :

I can't acces to a mechanic's software list anymore.
I had the mod installed and i played with it for a time but then i wasn't able to acces the mission computer. There was only a black screen on the monitor and I had to alt-tab my game to do something again.

So i unsub the mod and now i can't access the mecanic's list. I tried to reinstall the mod because it was updated but still not working! Any idea?
cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

The first problem you described looks much like that discussed here in detail, some incompatibility with the 2.5 Diplomatic aid mission. That should now be fixed (or at least be harmless, for debugging purposes) I will upload the final fix, cosmetic only, soon, together with some other changes, mostly preparation for a version without the software requirement.

Did you change zones before flying to a mechanic after enabling the mod? There will definitely be issues if you don't, see known bugs section.

Also, anything in the debug log that could help me identify the issue? Usually the UI hangs because some variable access fails (e.g. bad array index), but without any hint it's quite hard to locate the issue.
Sytha
Posts: 13
Joined: Tue, 17. Jun 14, 13:39

Post by Sytha »

Hey thanks for reply. I've already read the known bug section and all this thread but it don't seems this bug occured yet.

I understand the bug concerning the diplomatic aid mission
But it's the ui crash when trying to speak to a mechanic which trouble me.

I tried to change zone after enabling the mod but no change.

here some logs if it can helps you. It seems indeed it doesn't recognize the mod and when trying to load wares it fails.

At start :

[gamestart: 5] - [09/23/14 20:15:15]: Error: F:/Program Files (x86)/Steam/steamapps/common/X Rebirth/ui/addons/mainmenu/mainmenu_cf_missioncompute...(5): ReadText(): TextDB lookup failed for (1000001, 1)
[gamestart: 5] - [09/23/14 20:15:15]: Error: F:/Program Files (x86)/Steam/steamapps/common/X Rebirth/ui/addons/mainmenu/mainmenu_cf_missioncompute...(10): ReadText(): TextDB lookup failed for (1000001, 4)

// Think it's not important, it fail to show me the text in french

When speaking to mechanic

[gamestart: 7] - [09/23/14 20:17:42]: Error: F:/Program Files (x86)/Steam/steamapps/common/X Rebirth/(): GetWareData(): Invalid argument #1 <ware> (got nil, expected string)
[gamestart: 7] - [09/23/14 20:17:42]: Error: Error while executing onEvent script for event: showTraderUpgradesMenu.
Errormessage: H:\P\temp\r184796\menu_trader_upgrades.lua:129: table index is nil

//It tries to get list ware but fails :/
cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

Could you check your savegame for the mechanic definition list, process is as follows:

Search for a line like

Code: Select all

<value name="$SoftwareUpgradetraderLists" type="list" value="9427"/>
The value number will most likely be different.
Then search for that number to find a <ref> object referencing that number (actually I think the reference is in the other direction, but that does not matter):

Code: Select all

<ref id="9427">
<value type="list" value="9426"/>
</ref>
Repeat that process until there are no more <value>-tags which have a type="list" attribute. All other types should contain plain text, numbers, ..., you don't need to follow the values then.

End result for me:

Code: Select all

<ref id="8818">
<value type="ware" value="upg_pla_software_cf_mc_mk1"/>
<value type="integer" value="1"/>
<value type="integer" value="1"/>
<value type="integer" value="100"/>
</ref>

<ref id="9425">
<value type="ware" value="upg_pla_software_tc_mk1"/>
<value type="integer" value="1"/>
<value type="integer" value="1"/>
<value type="integer" value="100"/>
</ref>

<ref id="9426">
<value type="list" value="9425"/>
<value type="list" value="8818"/>
</ref>

<ref id="9427">
<value type="list" value="9426"/>
</ref>

<value name="$SoftwareUpgradetraderLists" type="list" value="9427"/>
The order is as in the save file, once you found the initial <value> you always search backwards.

Maybe something went wrong with the trader when installing / removing the mod, I should be able to tell from that list.
bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 »

I removed the mod, saved the game, then reinstalled it and saved again. I now have a lot of errors like this one while traveling:

Code: Select all

[gamestart: 3] - [09/24/14 09:21:33]: Error: Error in MD cue md.NPC_Upgradetrader.OnPlatformPopulation_Trader<inst:4413d>: Property lookup failed: $SoftwareUpgradesDefinition.{2}.{1}.id
* $SoftwareUpgradesDefinition.{2}.{1} == null
* Expression: [$SoftwareUpgradesDefinition.{$i}.{1}.id, $Price]
Another one:

Code: Select all

[gamestart: 6] - [09/24/14 09:38:35]: Error: Error in MD cue md.CF_MissionComputer_Base.RemoveMissionOnAccept<inst:80ed50>: Evaluated cue with ID 0x0 does not exist any more
* Expression: parent.$cueAcceptMission
Here's my "list":

Code: Select all

      <ref id="221">
        <value/>
        <value type="integer" value="1"/>
        <value type="integer" value="1"/>
        <value type="integer" value="100"/>
      </ref>

      <ref id="729">
        <value type="ware" value="upg_pla_software_tc_mk1"/>
        <value type="integer" value="1"/>
        <value type="integer" value="1"/>
        <value type="integer" value="100"/>
      </ref>

      <ref id="730">
        <value type="list" value="729"/>
        <value type="list" value="221"/>
        <value type="list" value="1134"/>
      </ref>

      <ref id="731">
        <value type="list" value="730"/>
      </ref>

      <ref id="1134">
        <value type="ware" value="upg_pla_software_cf_mc_mk1"/>
        <value type="integer" value="1"/>
        <value type="integer" value="1"/>
        <value type="integer" value="100"/>
      </ref>

<value name="$SoftwareUpgradetraderLists" type="list" value="731"/>
Apparently I managed to fix it. I removed ref 221 and 1134, their entries in ref 730 also. Then I removed the whole md.CF_MissionComputer_Base node which was quite big (about a hundred sub-nodes). No more error and I can speak to mechanics again.
User avatar
Leafcutter
Posts: 244
Joined: Wed, 2. Apr 03, 18:23
x4

Post by Leafcutter »

I had the same ware reference and mechanic UI freeze after I uninstalled NRU software many moons ago.

As talented as you modding guys are, I still think you are missing something important when adding a new ware which can be purchased from a mechanic.

This is why, I asked earlier in this thread if the mission computer (as good idea as it is) can be made available without cocking up the wares list ;-)

-LC-
Always expect the unexpected, and you will never be surprised.
User avatar
YorrickVander
Posts: 2767
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Adding wares is a bit irritating in any case sadly due to the way it's handled in save games.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

Yes, indeed, but thanks to the feedback I may now know enough to prevent these errors in the future. Maybe tomorrow, but I think I should have the patch available not later than this weekend.
User avatar
Leafcutter
Posts: 244
Joined: Wed, 2. Apr 03, 18:23
x4

Post by Leafcutter »

For info,

The steps outlined above by cyberfuzzie and bm01 resolved the mechanic UI error.

I viewed the offending sections of my save a number of times and each time the value changed... so it appears to be dynamic, which may explain why it's difficult to remove during uninstallation.

Hope that helps in the debugging process... particularly as a resolution to the problem could open up many modding possibilities for new ship equipment.

Cheers
-LC-
Always expect the unexpected, and you will never be surprised.
cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

The problem with "uninstallation" is much simpler: after disabling the mod the game notices invalid references (hence the debug log messages) and just invalidates them (replaced by empty value / nil). A proper uninstallation script would of course delete them before the mod is removed.
My plan is to create an additional "no software required" mod, as requested some days ago, which will then also act as uninstallation mod.
User avatar
Leafcutter
Posts: 244
Joined: Wed, 2. Apr 03, 18:23
x4

Post by Leafcutter »

nice idea

-LC-
Always expect the unexpected, and you will never be surprised.
Sytha
Posts: 13
Joined: Tue, 17. Jun 14, 13:39

Post by Sytha »

Hey sorry for my tard reply here the list :

Code: Select all

<ref id="1153">
<value type="ware" value="upg_pla_software_tc_mk1"/>
<value type="integer" value="1"/>
<value type="integer" value="1"/>
<value type="integer" value="100"/>
</ref>

<ref id="323">
<value/>
<value type="integer" value="1"/>
<value type="integer" value="1"/>
<value type="integer" value="100"/>
</ref>

<ref id="2011">
<value type="ware" value="upg_pla_software_cf_mc_mk1"/>
<value type="integer" value="1"/>
<value type="integer" value="1"/>
<value type="integer" value="100"/>
</ref>
It's exactly what I think about the nil value
cyberfuzzie
Posts: 136
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie »

Finally I finished the bugfix release 1.20!

- Removed a cue leak. Depending on your play time this can shrink your save game by some MB.
- All mechanics now have the mission computer from the beginning installed. It is not necessary anymore to change the zone before it is available.
- Added some code to fix broken mechanics. Please tell me if you still get UI crashes.

I also created an additional mod, the Mission Computer Software Removal Tool:
http://steamcommunity.com/sharedfiles/f ... =319545020
This mod Removes the software dependency from the mission computer, it can then be used without buying it first.

It is also the uninstallation mod. If you want to remove the Mission Computer, first install the additional mod, save your game, and then remove both mods. Just removing the Mission Computer mod leaves the mechanics in a broken state.

Return to “X Rebirth - Scripts and Modding”