[help] Is it possible to fully deactivate (or rebuild) superhighways?

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

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

sprIder
Posts: 96
Joined: Sat, 3. Jul 10, 23:23
x4

[help] Is it possible to fully deactivate (or rebuild) superhighways?

Post by sprIder » Tue, 18. Jul 23, 19:38

Hi all,

As written in the headline, I would like to know if it's possible to completely disable and re-enable Super Highways. Or if it is possible to rebuild existing superhighways via script after their destruction?

I have already tried a few things, using as a test object the superhighway in Savage Spur.
Image

Code: Select all

<find_highway name="$SaSpSector1Highway" macro="macro.SuperHighway01_Cluster112_macro" space="player.galaxy" required="true" />
<set_object_active object="$SaSpSector1Highway" activate="false" />
This causes the highway tube to disappear from the map. And the path finding also stops using the highway. It seems like it is deactivated.
Image
But the superhighway is still selectable, and the gates still exist.
Image
Even, if i "hide" the gate(s):

Code: Select all

<find_object groupname="$HighwayGates" name="$HighwayGate_001" space="macro.cluster_112_sector001_macro" macro="macro.he_gen_superhighway_entrance_01_macro"/>
<find_object groupname="$HighwayGates" name="$HighwayGate_002" space="macro.cluster_112_sector002_macro" macro="macro.he_gen_superhighway_exit_01_macro"/>
						
<do_for_each in="$HighwayGates" name="$CurrentGate">
	<set_object_active object="$CurrentGate" activate="false"/>
</do_for_each>
Image
With this way, it is still possible as a player to directly fly through the superhighway.

Therefore, I tried it differently. Destroy and rebuild.

Code: Select all

<destroy_object object="$SaSpSector1Highway" />
Although the gates remain thereby, the Highway is actually destroyed and on the map nothing is indicated anymore. Even as a player, I can no longer use the highway.

But how do I recreate the superhighway again?

Code: Select all

<create_object macro="macro.SuperHighway02_Cluster112_macro"></create_object>
or

Code: Select all

<create_object name="$SaSpSector1Highway_re" groupname="$SaSpSector1Highway_Group" space="player.galaxy" macro="macro.SuperHighway02_Cluster112_macro" owner="faction.yaki">
	<position object="SaSpSector1Highway" x="0m" y="0m" z="0m"/>
	<rotation value="SaSpSector1Highway.rotation"/>
</create_object>
doesn't work.

In both cases I even played with the gate zones ( macro.tzoneCluster_112_Sector001SHCon6_GateZone_macro ) but that didn't work either.

Does anyone have an idea or even solution for one way or another? Or an alternative at hand?

Caldari Navy
Posts: 78
Joined: Tue, 18. Jul 23, 18:43

Re: [help] Is it possible to fully deactivate (or rebuild) superhighways?

Post by Caldari Navy » Wed, 19. Jul 23, 16:23

New boron dlc story let u build new highways in one sector i would check some xmls in boron files probably some md scripts but its just idea i could be wrong

sprIder
Posts: 96
Joined: Sat, 3. Jul 10, 23:23
x4

Re: [help] Is it possible to fully deactivate (or rebuild) superhighways?

Post by sprIder » Thu, 20. Jul 23, 17:27

Thank you, but those are only highways with "normal" jump gates. Not superhighways. They seem to work differently.

Story-/Egosoft-magic - spoiler:
Spoiler
Show
The "new" gates are not being built. They exist, but are set to "inactive". The story-gates that are built are just dummies. Once you are done with the construction, the dummies are "silently" destroyed and the actual gates are reactivated. If i read and understand the scripts/md-files correctly...

Realspace
Posts: 1412
Joined: Wed, 15. Nov 06, 10:21
x4

Re: [help] Is it possible to fully deactivate (or rebuild) superhighways?

Post by Realspace » Thu, 3. Aug 23, 13:03

Removing superhighways is as easy as doing a diff patch file containing nothing, having the name maps/xu_ep2_universe/sechighways.xml.

Problem is the (sub)sectors would remain disconnected unless you add an accelerator connecting them, which is quite easy (see the tutorials on galaxy creation)

sprIder
Posts: 96
Joined: Sat, 3. Jul 10, 23:23
x4

Re: [help] Is it possible to fully deactivate (or rebuild) superhighways?

Post by sprIder » Thu, 3. Aug 23, 16:49

Thank you, Realspace.

But my wish is to remove and add the superhighway midgame using a md-script. Along with an event like finishing a certain plot. And this "wrapping" is not the problem. Only the proper removal and recreation of the superhighway.

But maybe the easiest solution is indeed to remove the highway with a diff patch like you suggest and just add a [Terran] accelerator via script. Instead of the superhighway. :/
But unfortunately, the gates/accelerators work both ways and not one way. Which is the funny part of superhighways.

Realspace
Posts: 1412
Joined: Wed, 15. Nov 06, 10:21
x4

Re: [help] Is it possible to fully deactivate (or rebuild) superhighways?

Post by Realspace » Thu, 3. Aug 23, 17:02

Then you have not to remove it, it has to be written as a regular superhighway but an md can disable it up to a certain event. You can look at how EGO manages the normal highways in Sanctuary of Darkness. I don't kow if the same can be done with superhighways thou.
Gates can be tagged as inactive, if you look at the gates that open after a certain event as in split or boron plot, in maps/etc/zones.xml, they have properties added as inactive (that can reactivated by script)

snwboardn21
Posts: 236
Joined: Sun, 13. Nov 05, 02:08
x4

Re: [help] Is it possible to fully deactivate (or rebuild) superhighways?

Post by snwboardn21 » Mon, 28. Aug 23, 21:20

Guessing you are having the same ideas as me; "what if I could build a hiway from Earth to Pluto or during wars cut off the Argons from the hiway system.

I love the hiway overall but it could be such a great tool for warfare too if it was more dynamic.
"It is better to keep ones mouth shut and be thought a fool, than to open it and remove all doubt"

Return to “X4: Foundations - Scripts and Modding”