Editing a mod

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

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

Post Reply
Ceconis
Posts: 4
Joined: Wed, 20. Feb 19, 12:36

Editing a mod

Post by Ceconis » Thu, 21. Feb 19, 14:54

Hi guys,

I have the VR version of rebirth and downloaded some mods, however when playing about (altering) one of them I keep getting some weird results. Some edits work, the others stop it all from running and I can't for the life of me figure out why.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<mdscript name="NpcsGainXp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>
    <cue name="Start" namespace="this" checktime="10s" checkinterval="10s" instantiate="true">
      <actions>
        <!-- get all my properties -->
        <find_object name="$playerobjects" space="player.galaxy" multiple="true">
          <match owner="faction.player" />
        </find_object>
        <!-- <debug_text text="$playerobjects.count" filter="error" /> -->
	<set_value name="$wasSkillGained" exact="0" />
        <do_all exact="$playerobjects.count" counter="$i">
          <!-- get all my employees -->
          <find_object_component name="$NPCs" owner="faction.player" class="class.npc" object="$playerobjects.{$i}" multiple="true" />
          <!-- <debug_text text="$playerobjects.{$i}.name" filter="error" /> -->
          <do_all exact="$NPCs.count" counter="$j">
            <set_value name="$npc" exact="$NPCs.{$j}"/>
            <!-- increase skills of employee -->
            <set_value name="$chosenSkill" list="[skilltype.combat, skilltype.morale, skilltype.engineering, skilltype.leadership, skilltype.management, skilltype.navigation, skilltype.science]" />
            <do_if value="$npc.skill.{$chosenSkill} lt 5">
              <!--<debug_text text="$npc.name" filter="error" />-->
              <add_skill entity="$npc" type="$chosenSkill" exact="1" />
			  <set_value name="$wasSkillGained" exact="1" operation="add" />
            </do_if>
          </do_all>
        </do_all>

	  <show_help log="false" custom="'%1 employees gained skills.'.[$wasSkillGained]" position="8" duration="3s" />

        <!-- <debug_text text="$NPCs.count" filter="error" /> -->
		<remove_value name="$wasSkillGained" />
        <remove_value name="$NPCs" />
        <remove_value name="$npc" />
        <remove_value name="$playerobjects" />
      </actions>
    </cue>
  </cues>
</mdscript>
The above runs fine, but I hate that display message (show_help). If I remove that line then nothing runs on this, the NPCs do not gain any skills. If I wrap that show_help in a do_if I get the same result, it doesn't run. My do_if attempt below..

Code: Select all

<do_if value="$wasSkillGained ge 1">
   <show_help log="false" custom="'%1 employees gained skills.'.[$wasSkillGained]" position="8" duration="3s" />
</do_if>
As I do not own the original version, only the VR edition, I had to download this mod via steamworkshopdownloader.io, then use the xrwsunpack tool to extract it for it to run at all. But I do not understand why some edits work, and others do not?

Just a side note, if I put the checktime and checkinterval to something higher like 600s, it doesn't run either after 10 minutes. I have it this low so I can jump in and out of the game so I can see if the edits actually work or not.

I'm hoping someone is still active to this forum and can help. This is driving me crazy and should be very simple.

Post Reply

Return to “X Rebirth - Scripts and Modding”