Remove a Gate via Galaxy Editor Script

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
memia
Posts: 48
Joined: Wed, 28. Jul 10, 22:19

Remove a Gate via Galaxy Editor Script

Post by memia » Fri, 13. Aug 10, 23:47

Hi All,
I've create a small package that allows me to add some new sectors into my game.
All works well and I'm very happy with the new sectors.

I haven't modified the main x3_universe.xml file, rather I have created my own xml file containing the additional sectors (with gates added to existing sectors) and then added the new sectors using a MD script.

However, one thing I seem to have a problem with is removing existing gates from sectors.
As an example, I'd like to remove the 'N' gate from Xenon Sector 347 and the 'S' gate from Scale Plate Green.

I've tried the following in the sector xml file (sector is Xenon Sector 347):

Code: Select all

<o t="1" x="11" y="7" r="6" size="20000000" m="0" p="-1" qtrade="100" qfight="100" qbuild="100" qthink="100">
  <o id="3915" t="18" s="4" x="0" y="500000" z="21160000" gid="-1" gx="0" gy="0" gtid="-1" a="0" b="0" g="0"/>
</o>
I hoped this would change the N gate in the sector (id="3915") to subtype 4 (s="4" - destroyed).
However, all this does is add a new gate in the sector at the position of the N gate (so there are now two in the same place).

I've also tried the following:

Code: Select all

<o t="1" x="11" y="7" r="6" size="20000000" m="0" p="-1" qtrade="100" qfight="100" qbuild="100" qthink="100">
  <o id="3915" t="18" s="0" x="0" y="500000" z="21160000" gid="-1" gx="0" gy="0" gtid="-1" a="0" b="0" g="0"/>
</o>
I wondered whether this would then "disconnect" the N gate (s="0" and then gid and gtid="-1"). However this actually creates a new gate that connects to Kingdom's End.

Does anyone have an idea how to effective destroy these gates using this kind of approach?

Thanks in advance for any advice or help. Although I appreciate all responses I am already aware that I can modify the x3_universe.xml file but I don't want to do that so am looking for other solutions.
M
A security system is only as strong as its weakest link

dillpickle
Posts: 1154
Joined: Mon, 3. Nov 08, 15:25

Post by dillpickle » Sat, 14. Aug 10, 00:59

If you're happy using MD, then this will remove the gates.

Code: Select all

    <cue name="Destroy Gates">
      <condition>
        <check_age value="{player.age}" min="1s"/>
      </condition>
      <action>
        <do_all>
          <find_gate name="X347 North" gate="north" typename="SS_WG_NORTH">
            <sector x="11" y="7"/>
          </find_gate>
          <find_gate name="SPG South" gate="south" typename="SS_WG_SOUTH">
            <sector x="11" y="6"/>
          </find_gate>
          <destroy_object object="X347 North" explosion="0"/>
          <destroy_object object="SPG South" explosion="0"/>
        </do_all>
      </action>
    </cue>

memia
Posts: 48
Joined: Wed, 28. Jul 10, 22:19

Post by memia » Sat, 14. Aug 10, 11:09

dillpickle,
That worked like a charm - thank you!
I've replaced the gates with broken ones so it all looks authentic now.

Great stuff - thanks.
M
A security system is only as strong as its weakest link

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”