Ok so was trying to compress my scripts and noticed that the game is totally fine with everything being on a single line (i'd tried this before but it didnt work, must have missed a bracket last time)
Anyway.
Now... I feed this in to excel and dynamically swap out these 3 sub-strings:
wh_network_1
wh_network_node_set_1
wh_network_station_nexus_set_1
and do autofill... for 2000 rows.
I now have a 1.6 MEGABYTE TEXT FILE filled with 2000 valid scripted bypasses.
Next step - in my theory - is to add a new megastructure that can be built... The wormhole network station [one per system]. Its only buildable by countries with the "Wormhole drive empire" civic (not removable after start, doesnt consume a civic slot but has a very low chance to appear in-game on random AIs).
From here, on completion of the WH Station, several things need to happen.
Also Have a separate script that can undo all of this if the megastructure is dismantled via event (e.g. if you want crises to "blow these up" when they kill the local starbase).
Now, perhaps its possible to compress most of this into scripted effects and only call relevant functions as needed, vastly cutting down on the amount of text - otherwise more dynamic macros need to be made in excel to account for all 2000 permutations of this (if wh_network_1111 = xyz else wh_network_1112 = ....) - for testing/development you'd just start with say _1, _2, _3 networks and if it works well you can scale up via macro.
You then give all ships for empires using this civic a "Wormhole FFID" FTL drive that doesnt actually let them use hyperlanes (just copy-paste the HL component but remove the hyperdrive property and change the fluff text) as these WH bypasses have a check in them to see if countries with this civic can use them (you'll get a few odd events where you inherit hyperlane ships - but a housekeeping event could hot-swap their FTL drives at the end of the month)
Surely I'm missing something obvious here? The LGate script works on the same basis as the old wormholes (ie. you can jump out to any target system, but you have to go via the L-cluster to visit another L-gate) so it near-perfectly mimics how wormholes used to play.
How it would play:
..... And that is it. Wormhole drives and stations are back in Stellaris?
Surely it's not this easy? Right?
Anyway.
You can compress - say the Bypass function into a single string like the above. Now i've copy-pasted the L-Gate script and changed the words to read Wormhole network.wh_network_1 = { name = WH_NETWORK_NAME is_pathfind = yes uses_action = no requires_exploration = no always_active = yes windup_time = 30 winddown_time = 30 ftl_multiplier = 1 icon_frame = 25 remember_instances = no galactic_map_tooltip_header = WH_NETWORK_HEADER galactic_map_tooltip_desc = WH_NETWORK_DESC connection_type = scripted_connection animation_time = 30 ftl_ship_effect = "gateway_ftl_ship_effect_entity" ftl_bypass_effect = "gateway_ftl_bypass_effect_entity" country_can_use = { custom_tooltip = { fail_text = WH_NETWORK_COUNTRY_CANNOT_USE has_civic = wh_network_civilization_civic_1 } } scripted_connection = { node = { has_star_flag = wh_network_node_set_1 } nexus = { has_star_flag = wh_network_station_nexus_set_1 } } }
Now... I feed this in to excel and dynamically swap out these 3 sub-strings:
wh_network_1
wh_network_node_set_1
wh_network_station_nexus_set_1
and do autofill... for 2000 rows.

wh_network_2000 = { name = WH_NETWORK_NAME is_pathfind = yes uses_action = no requires_exploration = no always_active = yes windup_time = 30 winddown_time = 30 ftl_multiplier = 1 icon_frame = 25 remember_instances = no galactic_map_tooltip_header = WH_NETWORK_HEADER galactic_map_tooltip_desc = WH_NETWORK_DESC connection_type = scripted_connection animation_time = 30 ftl_ship_effect = "gateway_ftl_ship_effect_entity" ftl_bypass_effect = "gateway_ftl_bypass_effect_entity" country_can_use = { custom_tooltip = { fail_text = WH_NETWORK_COUNTRY_CANNOT_USE has_civic = wh_network_civilization_civic } } scripted_connection = { node = { has_star_flag = wh_network_node_set_2000 } nexus = { has_star_flag = wh_network_station_nexus_set_2000 } } }
I now have a 1.6 MEGABYTE TEXT FILE filled with 2000 valid scripted bypasses.
Next step - in my theory - is to add a new megastructure that can be built... The wormhole network station [one per system]. Its only buildable by countries with the "Wormhole drive empire" civic (not removable after start, doesnt consume a civic slot but has a very low chance to appear in-game on random AIs).
From here, on completion of the WH Station, several things need to happen.
- Upon completion, search the system for flags, make sure it doesnt have a "has_wormhole_network" flag.
- Then search global_flags for a free index (wormhole_network_used_1, wormhole_network_used_2, wormhole_network_used_3, ... wormhole_network_used_2000)
- Find the next free one, and assign that to your system with the wormhole station,
- using an if-statement attach the equivalent bypass to the station
- e.g. system now has "active_wh_station_1439". attach bypass "wh_network_1439" to the wormhole station megastructure
- spawn a wormhole disk entity by/above the wormhole station (just for graphics)
- run an event that uses distance to find all stars within range
- distance = { source = [the WH Station's system] min = 0 max = @max_wh_station range type= euclidean uses_bypass= no }
- spawn "wh_network_node" megastructures randomly on the edges of all previously flagged systems (that do NOT* spawn megastructure icons on the galaxy map)
- assign the same bypass ID number to those flagged systems (e.g. wh_network_1439)
Also Have a separate script that can undo all of this if the megastructure is dismantled via event (e.g. if you want crises to "blow these up" when they kill the local starbase).
Now, perhaps its possible to compress most of this into scripted effects and only call relevant functions as needed, vastly cutting down on the amount of text - otherwise more dynamic macros need to be made in excel to account for all 2000 permutations of this (if wh_network_1111 = xyz else wh_network_1112 = ....) - for testing/development you'd just start with say _1, _2, _3 networks and if it works well you can scale up via macro.
You then give all ships for empires using this civic a "Wormhole FFID" FTL drive that doesnt actually let them use hyperlanes (just copy-paste the HL component but remove the hyperdrive property and change the fluff text) as these WH bypasses have a check in them to see if countries with this civic can use them (you'll get a few odd events where you inherit hyperlane ships - but a housekeeping event could hot-swap their FTL drives at the end of the month)
Surely I'm missing something obvious here? The LGate script works on the same basis as the old wormholes (ie. you can jump out to any target system, but you have to go via the L-cluster to visit another L-gate) so it near-perfectly mimics how wormholes used to play.
How it would play:
- First you build a WH station (or start with one, thanks to the civic running an event on start).
- Your ships would only be able to travel from the wormhole_station_IDX to any wormhole_node_IDX of the same IDX number (ie only to wormhole points in nearby stars)
- But you can then go to another system and build another wormhole station megastructure with a new IDX number - now your ships can travel from home, to a system with two different network's nexuses (e.g. Alpha Cen has the wormhole_nexus_1 and wormhole_nexus_2 egress points in it) and use that to hop between networks and travel the galaxy (SOL / wh_network_1 station to blorgalorg / wh_network_2 station)..
- The system above would be good for 2000 wormhole networks/stations - but you can only have 1 station per star (with maybe 50 more generated at runtime in a game, tops) so it'd work with larger mod galaxies (up to say 1800 too) - and I could easily generate a file with 10000 bypasses in it (4mb probably)
- WH station range could be tweaked to find something decent.
- You could even bring back 3 tiers of WH drive, increasing range - but this would involve re-calculating scripts for distance, so a bad idea, better to pick 1 WH network range and stick to it.
- Navigation: Yes. If it can use L-gates, it can navigate this and path between different bypasses no problem.
- Construction: A bit trickier.... but yes. With work.The AI could be given decisions that automates the build process (probably best, less confused constructors flying around) or pulsed events could fire ordering it to it build a network on any star X-Y distance away from its stations (i.e. on the leading edge of it's "wormhole bubble").
- An event that (every 6m) flags stars X dist away from existing AI wormhole_networks ("build a station here") in owned territory [destroyed if outpost changes hands] could be used as a targeter for where to build these things - via event or via constructor given scripted orders.
..... And that is it. Wormhole drives and stations are back in Stellaris?
Surely it's not this easy? Right?
Last edited:
- 2
- 1