Adding Jumpgates

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

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

Reaperxvii
Posts: 357
Joined: Thu, 29. May 14, 19:03
x3ap

Adding Jumpgates

Post by Reaperxvii »

Hey guys! So another question for you!

So I've managed to add jump gates, they show up, they even show to what system they are linked, but for some reason they aren't on, any ideas?

Code: Select all

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

   <add sel="/macros/macro[@name='XU_EP1_universe_macro']/connections">

    <connection name="ClusterGate01" ref="destination" path="../Cluster_B_connection/Cluster_B_Sector07_connection/tzoneCluster_B_Sector07_Zone10_connection/clustergate_connection789">
      <macro connection="destination" path="../../../../../Cluster_A_connection/Cluster_A_Sector01_connection/tzoneCluster_A_Sector01_Zone103_connection/clustergate_connection987" />
    </connection>
  </add>
  
</diff>

"We are the middle children of History. Born too late to explore the earth, born to early to explore the stars."

"Time is the fire in which we burn"

Reaper's Mod Index
Clownmug
Posts: 419
Joined: Wed, 11. Dec 13, 02:39
x4

Post by Clownmug »

You need to "activate" the gates, they aren't turned on by default. I think either Setup.xml or Setup_Gamestarts.xml under the md folder, has some code you can look at that uses <set_object_active> to turn on the gates.
Reaperxvii
Posts: 357
Joined: Thu, 29. May 14, 19:03
x3ap

Post by Reaperxvii »

Clownmug wrote:You need to "activate" the gates, they aren't turned on by default. I think either Setup.xml or Setup_Gamestarts.xml under the md folder, has some code you can look at that uses <set_object_active> to turn on the gates.
well the setup_gamestarts.xml Im using has this already on

Code: Select all

<actions>
        <signal_cue cue="md.Setup.Open_Jumpgates_Lib"/>
but for some reason these gates aren't on when all the others are

http://imgur.com/84TOvkW
"We are the middle children of History. Born too late to explore the earth, born to early to explore the stars."

"Time is the fire in which we burn"

Reaper's Mod Index
Clownmug
Posts: 419
Joined: Wed, 11. Dec 13, 02:39
x4

Post by Clownmug »

Reaperxvii wrote:
Clownmug wrote:You need to "activate" the gates, they aren't turned on by default. I think either Setup.xml or Setup_Gamestarts.xml under the md folder, has some code you can look at that uses <set_object_active> to turn on the gates.
well the setup_gamestarts.xml Im using has this already on

Code: Select all

<actions>
        <signal_cue cue="md.Setup.Open_Jumpgates_Lib"/>
but for some reason these gates aren't on when all the others are

http://imgur.com/84TOvkW
Ok, I can't check at the moment, but if you look at that Setup.xml file you'll find the "Open_Jumpgates_Lib" cue and it will show the method to activate gates.
Reaperxvii
Posts: 357
Joined: Thu, 29. May 14, 19:03
x3ap

Post by Reaperxvii »

Clownmug wrote:
Reaperxvii wrote:
Clownmug wrote:You need to "activate" the gates, they aren't turned on by default. I think either Setup.xml or Setup_Gamestarts.xml under the md folder, has some code you can look at that uses <set_object_active> to turn on the gates.
well the setup_gamestarts.xml Im using has this already on

Code: Select all

<actions>
        <signal_cue cue="md.Setup.Open_Jumpgates_Lib"/>
but for some reason these gates aren't on when all the others are

http://imgur.com/84TOvkW
Ok, I can't check at the moment, but if you look at that Setup.xml file you'll find the "Open_Jumpgates_Lib" cue and it will show the method to activate gates.
I see this

Code: Select all

    <cue name="Debug_Jumpgates" onfail="cancel">
      <conditions>
        <check_value value="false" comment="disable"/>
        <check_value value="player.module" exact="'ep1'" negate="true"/>
        <check_value value="player.module" exact="'ep1open'" negate="true"/>
      </conditions>
      <actions>
        <!--Activate jumpgates for testing-->
        <find_object groupname="$Gates" class="class.gate" multiple="true" space="player.galaxy"/>
        <do_all exact="$Gates.count" counter="$Counter">
          <set_value name="$Gate" exact="$Gates.{$Counter}"/>
          <do_if value="not $Gate.isactive and $Gate.exit.exists">
            <debug_text text="'DEBUG: Activating Jumpgate between ' + $Gate.cluster.knownname + ' and ' + $Gate.exit.cluster.knownname" filter="general"/>
            <set_object_active object="$Gate" activate="true"/>
          </do_if>
        </do_all>
      </actions>
    </cue>
That was in setup.xml and then this was in Setup_Gamestarts.xml

Code: Select all

    <cue name="Ep1Open">
      <conditions>
        <event_cue_signalled cue="md.Setup.GameStart"/>
        <check_value value="player.module" exact="'ep1open'"/>
      </conditions>
      <actions>
        <signal_cue cue="md.Setup.Open_Jumpgates_Lib"/>

        <!--Do not signal instantly-->
        <signal_cue cue="md.Setup.WeaponTraderBasket3"/>
        <signal_cue cue="md.Setup.EquipmentTraderBasket2"/>
        <signal_cue cue="md.Setup.PostChapter3Jobs"/>

        <set_faction_known faction="faction.argongovernment" known="true"/>
        <set_faction_known faction="faction.canteran" known="true"/>
        <set_faction_known faction="faction.reivers" known="true"/>
        <set_faction_known faction="faction.familyryak" known="true"/>

        <do_if value="player.debug">
          <upgrade_object_by_macro object="player.primaryship" macro="macro.software_trading_computer_mk3_macro" exact="100"/>
          <upgrade_object_by_macro object="player.primaryship" macro="macro.software_target_computer_mk2_macro" exact="100"/>
        </do_if>
      </actions>
    </cue>
but this code is already on (I know its missing the end as its a rather large file)

Code: Select all

     <add sel="/mdscript/cues">
    <cue name="hvcrusader">
      <conditions>
        <event_cue_signalled cue="md.Setup.GameStart"/>
        <check_value value="player.module" exact="'hvcrusader'"/>
      </conditions>
      <actions>
        <signal_cue cue="md.Setup.Open_Jumpgates_Lib"/>
		<set_object_active object="$Gate" activate="true"/>


"We are the middle children of History. Born too late to explore the earth, born to early to explore the stars."

"Time is the fire in which we burn"

Reaper's Mod Index
Reaperxvii
Posts: 357
Joined: Thu, 29. May 14, 19:03
x3ap

Post by Reaperxvii »

Actually I got it :) It was being...weird but I got it, I had ot use this code on top of the orginal

Code: Select all

      <actions>
        <signal_cue cue="md.Setup.Open_Jumpgates_Lib"/>
	    <find_object groupname="$Gates" class="class.gate" multiple="true" space="player.galaxy"/>
        <do_all exact="$Gates.count" counter="$Counter">
          <set_value name="$Gate" exact="$Gates.{$Counter}"/>
          <do_if value="not $Gate.isactive and $Gate.exit.exists">
            <debug_text text="'DEBUG: Activating Jumpgate between ' + $Gate.cluster.knownname + ' and ' + $Gate.exit.cluster.knownname" filter="general"/>
            <set_object_active object="$Gate" activate="true"/>
          </do_if>
        </do_all>
"We are the middle children of History. Born too late to explore the earth, born to early to explore the stars."

"Time is the fire in which we burn"

Reaper's Mod Index
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

with this Code you activate All Gates in the whole Universe - even if they are not supposed to open yet (for example ones usually opened during the Plot). You should look for your Gate only and activate it instead. For example by first searching for a Zone ang then looking in this Zone/Space for the Gate you want to activate:
<!-- Activate first Gate -->
<find_zone name="$Zone" space="player.galaxy" macro="macro.******ZONE MACRO NAME******"/>
<find_object name="$Gates" class="class.gate" multiple="true" space="$Zone"/>
<set_object_active object="$Gate" activate="true"/>
<!-- Activate Gate linked to the first one -->
<find_zone name="$Zone" space="player.galaxy" macro="macro.******ZONE MACRO NAME******"/>
<find_object name="$Gates" class="class.gate" multiple="true" space="$Zone"/>
<set_object_active object="$Gate" activate="true"/>
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 ;)
Reaperxvii
Posts: 357
Joined: Thu, 29. May 14, 19:03
x3ap

Post by Reaperxvii »

UniTrader wrote:with this Code you activate All Gates in the whole Universe - even if they are not supposed to open yet (for example ones usually opened during the Plot). You should look for your Gate only and activate it instead. For example by first searching for a Zone ang then looking in this Zone/Space for the Gate you want to activate:
<!-- Activate first Gate -->
<find_zone name="$Zone" space="player.galaxy" macro="macro.******ZONE MACRO NAME******"/>
<find_object name="$Gates" class="class.gate" multiple="true" space="$Zone"/>
<set_object_active object="$Gate" activate="true"/>
<!-- Activate Gate linked to the first one -->
<find_zone name="$Zone" space="player.galaxy" macro="macro.******ZONE MACRO NAME******"/>
<find_object name="$Gates" class="class.gate" multiple="true" space="$Zone"/>
<set_object_active object="$Gate" activate="true"/>
Okay thanks! I'll replace that tonight :)
"We are the middle children of History. Born too late to explore the earth, born to early to explore the stars."

"Time is the fire in which we burn"

Reaper's Mod Index

Return to “X Rebirth - Scripts and Modding”