[MOD] OpenMap

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

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

User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

[MOD] OpenMap

Post by YorrickVander »

OpenMap
=======

A small cheat mod for testers to open up a basic galactic map on new game start. No xml is patched, just a basic list walk performed from an additional cue at new game start so should remain compatible with future patches and universe extension mods.

All cluster, sector, zone + station names become known, but are not scanned and no resource information displayed until visited normally.

http://www.nexusmods.com/xrebirth/mods/358/?
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
BadAngel1976
Posts: 185
Joined: Wed, 23. Nov 05, 19:47
x3tc

Post by BadAngel1976 »

did you know, how i can visible stations in the map without moving to the zone?

'set_know' for stations make ist not visible in the map...


PS: sorry for my english ;(
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

It is possible by running some code similar to UniTraders method used in the Info Broker mod. I have however found some instabilities when mass scanning whole stations (ie base station to make it 1% scanned as if you'd flown in range) and each build stage. Occasionally it causes a CTD, possibly by overloading the ui update queues but that's only my theory.

Code: Select all

<do_all exact="$allstations.count" counter="$i">
          <set_object_scanned object="$allstations.{$i}" stage="0" scanner="player.primaryship.scanner"/>
</do_all>
(credit for code snippet is to UniTrader)

My intention for this mod was merely a time saver for testing new patches, to reduce the amount of work needed every time we have to restart from scratch. I'll test this addition later when I have time, in theory it will work but I can't promise no CTD for reasons mentioned above.

EDIT : Come to think of it that probably won't work in new game start, as the players ship will likely not be instantiated at that point. I'll look into a way to do this without burning a menu slot or running more than once.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
BadAngel1976
Posts: 185
Joined: Wed, 23. Nov 05, 19:47
x3tc

Post by BadAngel1976 »

Code: Select all

<set_object_scanned object="$stations.{$i}"
					scanner="player.primaryship.scanner" stage="0" />
it don't work ;( . it's scan, but no visible in the map...
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Using the same method to scan the zones (after game loaded) rather than the stations at least shows jump gates on the map without visiting. Research continues.

EDIT : So far the skunk or another player owned ship entering a zone appears to fill in the basic yield + visible station parts of the map (see Auto Trader mod). It may be necessary to spoof this happening to get the desired effect unless a way to force the event triggers is available.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
BadAngel1976
Posts: 185
Joined: Wed, 23. Nov 05, 19:47
x3tc

Post by BadAngel1976 »

with this you can see the jump gates without moving visiting:

Code: Select all

         <do_all exact="$zones.count" counter="$i">
				<set_known object="$zones.{$i}" known="true" />
				<set_object_scanned object="$zones.{$i}"
					scanner="player.primaryship.scanner" stage="0" />
			</do_all>

create a ship in this sector dont't visible the stations...

Code: Select all

				<create_ship capturable="false" group="masstraffic_albion_universal"
					zone="$stations.{$i}.zone" name="$NPCShip">
					<owner exact="faction.player" />
					<safepos object="$stations.{$i}" radius="0km" />
				</create_ship>

this is the code (only the stations don't work)

Code: Select all

<actions>
			<find_cluster groupname="$clusters" multiple="true" />
			<find_sector groupname="$sectors" space="player.galaxy"
				multiple="true" />
			<find_zone groupname="$zones" space="player.sector"
				multiple="true" />

			<do_all exact="$clusters.count" counter="$i">
				<set_known object="$clusters.{$i}" known="true" />
			</do_all>

			<do_all exact="$sectors.count" counter="$i">
				<set_known object="$sectors.{$i}" known="true" />
			</do_all>

			<do_all exact="$zones.count" counter="$i">
				<set_known object="$zones.{$i}" known="true" />
				<set_object_scanned object="$zones.{$i}"
					scanner="player.primaryship.scanner" stage="0" />
			</do_all>

			<find_station groupname="$stations" space="player.sector"
				multiple="true" />

			<do_all exact="$stations.count" counter="$i">

				<set_known object="$stations.{$i}" known="true" />

				<set_object_scanned object="$stations.{$i}"
					scanner="player.primaryship.scanner" stage="0" />

				<create_ship capturable="false" group="masstraffic_albion_universal"
					zone="$stations.{$i}.zone" name="$NPCShip">
					<owner exact="faction.player" />
					<safepos object="$stations.{$i}" radius="0km" />
				</create_ship>

				<upgrade_object_by_macro object="$NPCShip"
					macro="macro.unit_player_ship_scanner_3_macro" exact="100"
					comment="exact in % of available slots!" />

				<show_notification caption="'Scann Info:'"
					details="[$stations.count, 'Stationsname: ' + $stations.{$i}.name, 'Stations zone: ' + $stations.{$i}.zone.name, 'TZone: ' +  $stations.{$i}.zone.istemporaryzone, 
					$i]"
					timeout="2s" />
				<wait exact="3s" />

			</do_all>

			<remove_value name="$i" />
			<remove_value name="$stations" />

		</actions>
to much patches and restarts.. no fun to explore ;(

i will see the Auto Trader mod...
KongDeluxe
Posts: 343
Joined: Fri, 30. Dec 05, 23:53
x4

Post by KongDeluxe »

i tried out your extension in my campaign but it s not working. Is it not compatible anymore with recent patches?
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

Didnt the "debug mode" -mod have something like this?

Is it possible to make all stations known and have agent in em? This would make play-testing and re-starting SOOOO much easier.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

You may have failed to read the OP. This only runs on new game starts :P It still works for any game version though; if you like you can modify it to work for a current game :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
KongDeluxe
Posts: 343
Joined: Fri, 30. Dec 05, 23:53
x4

Post by KongDeluxe »

YorrickVander wrote:You may have failed to read the OP. This only runs on new game starts :P It still works for any game version though; if you like you can modify it to work for a current game :)
ah thank you. I think i ll find a way to set a new condition for starting it, eventhough my md skills are more than poor. But copy paste from other md scripts should do it.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

KongDeluxe wrote:
YorrickVander wrote:You may have failed to read the OP. This only runs on new game starts :P It still works for any game version though; if you like you can modify it to work for a current game :)
ah thank you. I think i ll find a way to set a new condition for starting it, eventhough my md skills are more than poor. But copy paste from other md scripts should do it.
<event_loaded_savegame /> ;)

and put a <reset_cue cue="this" /> at the end of the <actions/> node - that way it should reveal everything every time the Game is loaded ;) (didnt confirm yet, got this just from reading about how to MD)
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 ;)
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

You are exactly right about the <reset_cue although it's already there on my machine. It's a long time since I made that one though and the nexus version might lack it. As a curiosity, if you don't mind not seeing the encyclopedia entries for scanned station parts you can add this cue to the file as well (code from lhotski) :

Code: Select all

    <cue name="AutoScanZoneStations" instantiate="false" namespace="this">
      <conditions>
        <check_any>
          <event_object_changed_zone object="player.primaryship"/>
          <event_player_created />
          <event_cue_signalled cue="md.Setup.GameStart" />
        </check_any>
      </conditions>
      <actions>    
        <find_station groupname="$allstations" space="player.zone" multiple="true" />
        <do_all exact="$allstations.count" counter="$i">
          <set_object_scanned object="$allstations.{$i}" scanner="player.primaryship.scanner"/>
          <set_value name="$buildplan" exact="$allstations.{$i}.currentbuildplan"/>
          <do_all exact="$buildplan.sequences.count" counter="$s">
            <set_value name="$sequence" exact="$buildplan.sequences.{$s}"/>
            <do_all exact="$buildplan.{$sequence}.stage" counter="$stage">
              <set_object_scanned object="$allstations.{$i}" scanner="player.primaryship.scanner" sequence="$sequence" stage="$stage"/>
            </do_all>
          </do_all>
        </do_all>

        <reset_cue cue="this" />
      </actions>
    </cue>
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
KongDeluxe
Posts: 343
Joined: Fri, 30. Dec 05, 23:53
x4

Post by KongDeluxe »

thanks unitrader but with this condition nithing happens:

Code: Select all

<conditions>
        <event_loaded_savegame />
  </conditions>
Instead i m using the condition that i have to enter a specific sector, which is working.

The only problem i encounter is that stations are not revealed and not scanned, even with the additional cue.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

I gave you the conditions above :)

Code: Select all

          <event_player_created />
          <event_cue_signalled cue="md.Setup.GameStart" /> 
will do the job just fine, the double check is probably superfluous but makes sure the game is ready + the player ship exists so you get the result you want ;)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
KongDeluxe
Posts: 343
Joined: Fri, 30. Dec 05, 23:53
x4

Post by KongDeluxe »

Thanks works for me now. Still don t see stations but I think I ll have to live with it for now :)
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

No it doesn't show the stations until you visit. I'm 99% you can do this via lua but haven't made time to experiment.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Return to “X Rebirth - Scripts and Modding”