Help! Game start with PHQ no longer has research active. Help!

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

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

Post Reply
User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Help! Game start with PHQ no longer has research active. Help!

Post by apricotslice » Fri, 18. Jun 21, 06:10

My gamestart used to work fine.

Then it appears the Devs changed starts to incorporate a video intro, and in the process broke backwards compatibility.

The start has the PHQ already in the game, and owned by the player.

The PHQ is there. The Tank room is there. The Boron says hello.

But there is no research icon, and no dialogue for the Boron.

I've seen a mod where this all works, but no matter what I do, I can't get this one to work. The brains trust on the Discord server haven't been able to help either.

The debug doesn't show any problems with the gamestart files, but does have errors in the Boron code which appear to have nothing to do with anything.

Can anyone help sort this out? The changes to game starts needs to be documented, given they break any pre v3 starts involving the PHQ.

Errors in the debug:
(This isn't the entire log, just the bit on the end which seems to be the problem.)

Code: Select all

Logfile started, time Tue Jun 15 20:59:13 2021
[General] 0.00 'GeForce RTX 3090' NVIDIA-driver v462.7.0 (Vulkan 1.2.155) check=1
[General] 0.00 ======================================

[=ERROR=] 0.00 Error in MD cue md.X4Ep1_Mentor_Subscriptions.Mentor_Speak_Helper: Property lookup failed: $Lines
* Expression: (typeof $Lines.{1}).isnumeric
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in MD cue md.X4Ep1_Mentor_Subscriptions.Mentor_Speak_Helper: Property lookup failed: $Lines
* Expression: typeof $Lines.{1} == datatype.list
[General] 0.00 ======================================
[General] 0.03 ======================================
[=ERROR=] 0.03 Error in MD cue md.X4Ep1_Mentor_Subscriptions.Debug_Create_HQ_With_Mentors_Dockarea: Signalled cue md.X4Ep1_Mentor_Subscriptions.Manage_Boron_Tank_Room has no corresponding listeners
* Expression: Manage_Boron_Tank_Room
* Action: <signal_cue>, line 294
[General] 0.03 ======================================
[General] 2.26 ======================================
[=ERROR=] 2.26 Error in MD cue md.X4Ep1_War_Subscriptions.CalculateThreads<inst:1296bc>: Property lookup failed: $EnemyGoals.{12}
* Expression: $EnemyGoals.{$gwf_k}.$Target.iscontested
* Action: <do_elseif>, line 8668
[General] 2.26 ======================================
[General] 2.26 ======================================
[=ERROR=] 2.26 Error in MD cue md.X4Ep1_War_Subscriptions.CalculateThreads<inst:1296bc>: Property lookup failed: $EnemyGoals.{12}
* Expression: $WarFrontTable.$OtherSectors.{$EnemyGoals.{$gwf_k}.$Target}?
* Action: <do_elseif>, line 8680
[General] 2.26 ======================================
Gamestarts.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<diff>
	<add sel="/gamestarts">

  

  <gamestart id="apricotstart1" name="The Jon Hunter Start" description="The AMS is long gone, but John Slice left you something in his will." image="gamestart_4" group="3" >
    <info>
	  <item name="{1021,8}" value="Jon Hunter" /> <!--Name -->
      <item name="Location" value="Argon Prime" />
      <item name="Starting Ships" value="Nemesis Vg" />
      <item name="Funds" value="750,000 Cr" />
      <item name="PHQ" value="Located in Argon Prime ready to begin research" />
      <item name="Blueprints" value="Stock set, from vanilla game starts." />
    </info>
	<!-- Argon Prime -->
    <location galaxy="xu_ep2_universe_macro" zone="zone002_cluster_14_sector001_macro">
      <player disembarked="true">
        <position x="28685" y="-1240" z="10695"/>
        <rotation yaw="-115" pitch="0" roll="0" />
      </player>
      <interior module="landmarks_player_hq_01_research_macro" corridor="room_arg_corridor_01_macro" door="con_room_01" room="room_gen_boronoffice_01_macro" name="{20007,1171}" />
    </location>
    <player macro="character_player_tutorial_macro" money="750000">

      <!-- PAR Nemesis  -->
      <ship macro="ship_par_m_corvette_01_a_macro">
	<loadout>
	  <macros>
	    <engine macro="engine_par_m_combat_01_mk3_macro" path="../con_engine_01" />
		
	    <shield macro="shield_tel_m_standard_01_mk2_macro" path="../con_shield_front_L" />
	    <shield macro="shield_tel_m_standard_01_mk2_macro" path="../con_shield_front_R" />

	    <weapon macro="weapon_gen_m_gatling_01_mk2_macro" path="../con_primaryweapon_01"/>
	    <weapon macro="weapon_gen_m_gatling_01_mk2_macro" path="../con_primaryweapon_02"/>
	    <weapon macro="weapon_gen_m_gatling_01_mk2_macro" path="../con_primaryweapon_03"/>
	    <weapon macro="weapon_gen_m_gatling_01_mk2_macro" path="../con_primaryweapon_04"/>
	    <weapon macro="weapon_gen_m_gatling_01_mk2_macro" path="../con_primaryweapon_05"/>

	    <turret macro="turret_arg_m_laser_01_mk1_macro" path="../con_turret_L01"  />
        <turret macro="turret_arg_m_laser_01_mk1_macro" path="../con_turret_R01"  />

	  </macros>
	  <virtualmacros>
	    <thruster macro="thruster_gen_m_combat_01_mk3_macro" />
	  </virtualmacros>
	  <ammunition>
	    <ammunition macro="eq_arg_satellite_01_macro" exact="10" optional="true" />
	    <ammunition macro="eq_arg_satellite_02_macro" exact="20" optional="true" />
	    <ammunition macro="eq_arg_resourceprobe_01_macro" exact="10" optional="true" />
	  </ammunition>
	  <software>
	    <software ware="software_flightassistmk1" />
	    <software ware="software_dockmk2" />
	    <software ware="software_scannerlongrangemk2" />
	    <software ware="software_scannerobjectmk2" />
	    <software ware="software_targetmk1" />
	    <software ware="software_trademk1" />
	  </software>
	</loadout>
      </ship>
      <inventory>
        <ware ware="inv_timewarp" amount="1" />
        <ware ware="weapon_gen_spacesuit_repairlaser_01_mk1" amount="1" />
        <ware ware="software_scannerobjectmk3" amount="1" />
      </inventory>
      <blueprints>
        <ware ware="clothingmod_0001" />
        <ware ware="clothingmod_0002" />
        <ware ware="module_arg_dock_m_01_lowtech" />
        <ware ware="module_arg_pier_l_01" />
        <ware ware="module_arg_stor_container_s_01" />
        <ware ware="module_arg_conn_base_01" />
        <ware ware="module_arg_conn_cross_01" />
        <ware ware="module_arg_conn_vertical_01" />
        <ware ware="module_gen_prod_energycells_01" />
        <ware ware="module_arg_prod_meat_01" />
        <ware ware="paintmod_0006"/>
        <ware ware="paintmod_0048"/>
        <ware ware="paintmod_0049"/>
        <ware ware="paintmod_0050"/>
      </blueprints>
      <research>
        <ware ware="research_radioreceiver" />
        <ware ware="research_sensorbooster" />
        <ware ware="research_tradeinterface" />
      </research>
	  <encyclopedia>
        <entry type="warebasket" ref="research_gamestart_common"/>
      </encyclopedia>
	  <theme paint="painttheme_player_01" />
    </player>
  </gamestart>
  </add>
</diff>
MD Setup file:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<mdscript name="ApricotStartSetup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">

  <cues>

    <!-- This is the cue called at gamestart when "JonHunterStart" is
	 chosen by the player. do setup here.
	 ====================================================================
    -->
    
    <cue name="ApricotStart_Init" module="apricotstart1">
      <conditions>
	    <event_cue_signalled cue="md.Setup.GameStart"/>
      </conditions>
      <actions>

	<!-- phq. comment out if you dont want that  -->
	    <signal_cue cue="apstart_phq" />

	<!-- crystals -->
	<!-- <add_inventory entity="player.entity" ware="ware.inv_crystal_05" min="150" max="250" profile="increasing"/> -->

	
      </actions>
    </cue>

    <!-- 
	 ====================================================================
    -->
    


    
    
    <cue name="apstart_phq" >
      <conditions>
        <event_cue_completed cue="md.X4Ep1_Mentor_Subscriptions.Start"/>
      </conditions>
      <actions>


	<!-- Set position to Argon Prime, near broken jump gate, well
	     above asteroids -->
	<find_sector name="md.X4Ep1_Mentor_Subscriptions.Start.$HQSector" macro="macro.cluster_14_sector001_macro"/>
	<set_value name="md.X4Ep1_Mentor_Subscriptions.Start.$HQPosition" exact="position.[-85km, 8km, -25km]"/>

	
	<!-- Thoughtful devs left a hook for this; thanks! -->
	<signal_cue cue="md.X4Ep1_Mentor_Subscriptions.SHORTCUT_Research" />

	<!-- dont off to start phq mission again -->
	<cancel_cue cue="md.X4Ep1_Mentor_Subscriptions.Initialise" />
	
	<!-- <set_owner object="md.X4Ep1_Mentor_Subscriptions.Start.$HQ.buildstorage" faction="faction.player" overridenpc="true"/> -->

	<show_help duration="5s" custom="'You now own the PHQ in Argon Prime'"/>

      </actions>
    </cue>



    


    <!--
	==================================================
	Add more cues like this:
    -->
    

    <!--
    <cue name="apstart_" >
      <conditions>
	<event_cue_signalled/>
      </conditions>
      <actions>
     

      </actions>
    </cue>
      -->





    
  </cues>
</mdscript>

X4ep1_mentor_subscription.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff name="X4Ep1_Mentor_Subscriptions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
<add sel="//mdscript[@name='X4Ep1_Mentor_Subscriptions']/cues/cue[@name='Start']/actions/find_sector" pos="after">
	<do_if value="player.module == 'apricotstart1'">
		<find_sector name="$HQSector" macro="macro.cluster_14_sector001_macro"/>
	</do_if>
</add>
<add sel="//mdscript[@name='X4Ep1_Mentor_Subscriptions']/cues/cue[@name='Start']/actions/set_value[@name='$HQPosition']" pos="after">
	<do_if value="player.module == 'apricotstart1'">
		<set_value name="$HQPosition" exact="position.[0km, 0km, -50km]"/>
	</do_if>
</add>
<add sel="//mdscript[@name='X4Ep1_Mentor_Subscriptions']/cues/cue[@name='Start']/cues/cue[@name='Initialise']/actions/do_if[contains(@value,x4ep1_gamestart_scientist)]" pos="after">
			<do_elseif value="player.module == 'apricotstart1'">
              <!--Specialised gamestart where HQ is present (see god.xml, x4ep1_gamestart_scientist_hq) -->
              <set_value name="md.Signal_Leaks.Manager.$SuppressSignalLeakGeneration" exact="false"/>
              <find_station_by_true_owner name="$HQ" macro="macro.station_pla_headquarters_base_01_macro" faction="faction.player" space="$HQSector" required="true"/>
              <do_if value="$HQ">
                <!-- make sure plot is payed and station setup correctly -->
                <include_actions ref="SetupHQ"/>
                <!--TODO @Owen move to SetupHQ?-->
                <find_object_component name="$ResearchModule" macro="macro.landmarks_player_hq_01_research_macro" object="$HQ"/>
                <set_object_name object="$ResearchModule" page="20104" line="101701" comment="Unknown module to Research Module"/>
                <!--Tank room already created in the gamestart (see gamestart.xml) -->
                <find_object_component name="$MentorRoom" macro="macro.room_gen_boronoffice_01_macro" object="$HQ"/>
                <do_if value="$MentorRoom and $MentorRoom.dynamicinterior">
                  <set_value name="$Interior" exact="$MentorRoom.dynamicinterior"/>
                  <debug_text text="'Setting HQ tank room to persistent'"/>
                  <set_dynamic_interior_persistent object="$HQ" interior="$Interior" persistent="true"/>
                  <do_for_each name="$InteriorRoom" in="$Interior.rooms">
                    <do_if value="$InteriorRoom.type == roomtype.corridor">
                      <set_value name="$Corridor" exact="$InteriorRoom"/>
                      <break/>
                    </do_if>
                  </do_for_each>
                </do_if>
                <set_entity_traits entity="$Boron_Mentor" customhandler="true"/>
                <signal_cue cue="Manage_Boron_Tank_Room"/>
                <signal_cue cue="UnlockResearch"/>
                <set_value name="$BoronMet" exact="true"/>
              </do_if>
            </do_elseif>
</add>
</diff>

LucianDragos
Posts: 39
Joined: Wed, 28. Mar 12, 00:29
x4

Re: Help! Game start with PHQ no longer has research active. Help!

Post by LucianDragos » Sat, 10. Jul 21, 09:16

I had the same issue with my own custom start and posted a fix in the thread I made then

viewtopic.php?f=181&t=434066&p=5014709#p5014709

I see the warebasket line is there... So it should work on a new game, unless Ego broke something with the new custom starts options they are adding in the beta

daBeschi
Posts: 76
Joined: Mon, 28. Jan 19, 14:04
x4

Re: Help! Game start with PHQ no longer has research active. Help!

Post by daBeschi » Sat, 10. Jul 21, 17:36

Hello,

Even with your fix it didn't work with 4.0 for me. I had to use cheats to add encyclopedia entries to get them to work. It is not the current beta.

Greetings

Post Reply

Return to “X4: Foundations - Scripts and Modding”