[SCRIPT] X3 TC / AP : Sectormap Revamped 2.1 dd 11-jun-2013

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

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

[SCRIPT] X3 TC / AP : Sectormap Revamped 2.1 dd 11-jun-2013

Post by qwizzie » Fri, 17. May 13, 23:22

This script will give all ships and stations that are viewable
in the sectormap race-specific colors. It will start automatically
through three AL plugins that are active from start.

Every 10 seconds an AL plugin will check for claimable ships to color
Every 5 minutes an AL plugin will check for race ships to color
Every 30 minutes an AL plugin will check for race stations to color.

(You can switch these AL plugins on & off at will).


Pictures of how this script will look ingame :

[ external image ]
[ external image ]
[ external image ]

Advice : best to install this script on a savegame of at least 15 minutes old so all the lasertowers get colored correctly (so after their cooldown time of 10 minutes)

This script is best to use with my Universe Colored Map : http://forum.egosoft.com/viewtopic.php?t=302247 as it complements
it rather nicely and has the same race colors.

Also made an optional coloring of asteroids, they will display white in sectormap and after scanning show seperate colors for ore, silicon and nividium. It is in the optional - with colored asteroids folder.
The reason i made this optional is because the ware ''ore'' gets colored as well in tradingstations and ore mines. Decide for yrself if this matters for you or not.

For users that used my Sectormap Revamped 1.0 or 2.0 the following files need to be deleted before using this newer version:

1.0

scripts

setup.colored.race.ships.xml
setup.colored.stations.xml
colored.race.ships.xml
colored.stations.xml

director :

Colored_Race_Ships.xml

2.0

scripts

al.plugin.colored.ships.and.stations.xml
colored.pirates.xml
colored.ships.and.stations

For users who also use my Colored Claimable Ships script pls remove following files as those are now integrated in this script:

director :

Colored Claimable Ships.xml

scrips :

colored.claimable.ships.xml

Credits go to Apricotslide who posted a code on another post which enables us to color abandonned ships in a certain color. I got the idea to just apply that concept on a much larger scale, ending up with this script.

Download : as usual this script (as all my scripts and mods) can be downloaded from my skydrive

https://skydrive.live.com/?cid=fae3da27 ... F440%21105

Extract the winrar file to your installation directory (for AP inside the addon folder and for TC the normal installation directory)

note :

This script will conflict with the best buy command, in that it looses the race rank requirements visibility to buy items at stations (best buy command will not show you anymore if you have the right rank to buy that item or not).

This script will have english & german language support

See second post for uninstall information. Although that uninstall methode works it has some side-effects. Its better to make a backup of yr savegames before trying this script out.


have fun,


qwizzie
Last edited by qwizzie on Wed, 12. Jun 13, 18:51, edited 26 times in total.

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Fri, 17. May 13, 23:22

Uninstall information :

Found a way to uninstall all colorcodes on ships and stations.
This can only be done once and you will not be able to recolor anymore after that !! Inspiration for this uninstall methode and from using the AL plugin itself came from studying graxster's script [AL Plugin] Remove Prefix "Your" from Player Property.
http://forum.egosoft.com/viewtopic.php?t=225432
I just made it a hotkey methode and reworked the code somewhat so it ended up removing the colorcodes.


I added two extra files in the winrar file and uploaded it. Just download or re-download from first post. This will add an extra hotkey to uninstall the colorcodes on both ships and stations. Hotkey is called ''uncoloring ships and stations'' and can be found just like the other two hotkeys in the controls / interface part.

Uninstall procedure is as follows :

1 set AL plugins ''Colored Race Ships enabled'', ''Colored stations enabled'' and ''Colored Claimable Ships'' on ''No'' in gameplay - Artificial Life settings

2 : assign key and use hotkey ''uncoloring ships and stations''

All ships and stations will now be cleaned except the civilian ships which i couldnt get to color in the first place.

This cleaning will have the side-effect that these civilian ships will most likely be missing a first letter. Just keep in mind all these civilian ships will be ended by the jobs engine eventually and respawn with correct shipnames.

Also any lasertowers that are beeing cleaned during their warm-up time will have the time frozen in the names, if you started a new game it is best to wait at least 15 minutes after start of the script before uninstalling so the lasertowers will have time to get deployed and will end up getting cleaned correctly.

The following files can now be removed from the following folders :

scripts :

setup.colorcleanershipsandstations.xml
colorcleanershipsandstations
al.colored.claimable.ships.events.xml
al.colored.claimable.ships.main.xml
al.colored.ships.events.xml
al.colored.ships.main.xml
al.colored.stations.events.xml
al.colored.stations.main.xml
al.plugin.colored.ships.xml
al.plugin.colored.stations
al.plugin.colored.claimable.ships

t :

9920-L044.xml t/m 9927-L044.xml


qwizzie
Last edited by qwizzie on Tue, 11. Jun 13, 16:38, edited 5 times in total.

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Fri, 17. May 13, 23:23

Fantastic. Good work!

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Fri, 17. May 13, 23:27

Thanks JoelR. By the way i will post the coloring of claimable ships via another post... should be up in a few minutes also.

qwizzie

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Fri, 17. May 13, 23:32

Just loaded it up in my game. It looks great. This should have been in vanilla. Now I know exactly who is in the sector without having to look through the list.

Vayde
Posts: 850
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Sat, 18. May 13, 10:44

Nice one qwizzie. I'm starting a new 3.0 AP game shortly so will set it away and go make a cuppa while it gets to work.

Ta muchly

Vayde
Still life in the old dog yet...

Vayde
Posts: 850
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Sat, 18. May 13, 11:16

As a side effect of this script, are pirates unmasked and show their true colours :)

I have noticed two ships are red but are not called pirate in their descriptions.
Still life in the old dog yet...

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Sat, 18. May 13, 14:56

thanks for the reply's guy's.

Vayde : i noticed this side-effect too but decided it looks better this way
then those masked pirate raceships not having any color at all which would lead to questions. Lets just say there is no hiding for the pirates now :)

qwizzie

edit : almost forgot to ask following to mod forum

does anyone know what race the civilian race ships have ? i had trouble finding the correct race for them..... wanted to color them white.

Miravlix
Posts: 243
Joined: Mon, 13. May 13, 01:14
x4

Post by Miravlix » Mon, 20. May 13, 15:40

Unfortunately the coloring isn't fully supported by the game.

Bestbuy colors station names red if your race rank is too low to buy an item, but the station keeps it's "racial" color applied by this script, so you have to dock to see if you can buy an item.

Since bestbuy doesn't seem to be a script, I'm not sure how to recode it, could one make a script that removes colors in the local sector, calls bestbuy, then recolors?

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Mon, 20. May 13, 17:32

Sorry to hear that it conflicts with the bestbuy command in that way.
Unfortunetely this script is to general of nature and too difficult to
uncolor afterwards for IS (In Sector) / local sectors.

All i can do at the moment is mention in the first post that this script will conflict with the best buy command .. in that it looses the race rank requirements visibility to buy items at stations.

I'm also trying out a more IS approach with this script which will make things even more difficult with yr request i'm afraid.

i will keep yr request in mind, maybe i can find something that i can use
later on.


qwizzie

Miravlix
Posts: 243
Joined: Mon, 13. May 13, 01:14
x4

Post by Miravlix » Mon, 20. May 13, 19:26

Removing the colors is easy, even if you can't regexp a text to remove the two chars in front, you can simply store the uncolored name.

$station -> set local variable: oldname=$old.name

Easy as pie to do a $station-> set name to $station-> get local variable: oldname.

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Mon, 20. May 13, 22:40

This script operates on global stations level, with just the focus on race. What you suggest could only work if all uncolored stationsnames were stored before this script starts. This will cause twice as much lagg
in the initial stage. And even then its not safe proof with GOD removing
and adding stations in the background....

Sorry, but for now i'm leaving this script as is.

qwizzie

Miravlix
Posts: 243
Joined: Mon, 13. May 13, 01:14
x4

Post by Miravlix » Tue, 21. May 13, 04:21

qwizzie wrote:This script operates on global stations level, with just the focus on race. What you suggest could only work if all uncolored stationsnames were stored before this script starts. This will cause twice as much lagg
in the initial stage. And even then its not safe proof with GOD removing
and adding stations in the background....

Sorry, but for now i'm leaving this script as is.

qwizzie
Huh, what are you talking about, why would you need to store them all before the script is run.

I can't fix a current game, because you didn't bother to consider making a way to undo coloring, but a new game and code could store each station's name as you change them.

Not that it matters, I don't like using the extra memory on storing the old name, when the scripting language has support for regexp, so I can just search and replace to remove the color coding.

$PageID = 9921
load text: id=$PageID

$array.station = get station array: of race [Argon] class/type=[Station]
$size = size of array $array.station
while $size > 0
dec $size
$station = $array.station[$size]
$is.renamed = $station-> get local variable: name='AS.Is.Renamed'
if $is.renamed
$station-> set local variable: name='AS.Is.Renamed' value=[FALSE]
$old.name = $station-> get name
$temp = sprintf: pageid=$PageID textid=100,null, null, null, null, null
$new.name = substitute in string $old.name: pattern $temp with null
$station-> set name to $new.name
end

do if $size == ($size / 20) * 20
= wait 100 ms
end

Only problem is that the code does nothing, I expected it to either destroy all my Argon station names (subsitute in string returns -1 if I did it wrong), but instead it does nothing at all.

Archaryon
Posts: 6
Joined: Tue, 30. Apr 13, 18:02

Post by Archaryon » Wed, 22. May 13, 13:10

How can i disable the script? I removed all the files, but still have the names of the stations and ships colored

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Wed, 22. May 13, 15:29

i'm afraid the colorcodes are stored in yr latest savegames, try to revert
back to an earlier savegame (before you tried this script) or start a new game.

I updated the first post to alert ppl about this.


qwizzie

EDIT : corrected on next post, found an uninstall method.
Last edited by qwizzie on Thu, 23. May 13, 01:27, edited 1 time in total.

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Thu, 23. May 13, 01:16

Found a way to uninstall all colorcodes on ships and stations.
This can only be done once and you will not be able to recolor anymore after that !!

I added two extra files in the winrar file and uploaded it. Just download or re-download from first post. This will add an extra hotkey to uninstall the colorcodes on both ships and stations. Hotkey is called ''uncoloring ships and stations'' and can be found just like the other two hotkeys in the controls / interface part.

Uninstall procedure is as follows :

1 : assign key and use hotkey ''colored raceships''
2 : assign key and use hotkey ''colored stations''

** above is to update any ships or stations which GOD / Job engine created after the initial start of this script, so they wont get left out in the cleaning process **

3 : assign key and use hotkey ''uncoloring ships and stations''

All ships and stations will now be cleaned except the civilian ships which i couldnt get to color in the first place.

This cleaning will have the side-effect that these civilian ships will most likely be missing a first letter. Just keep in mind all these civilian ships will be ended by the jobs engine eventually and respawn with correct shipnames.

Also any lasertowers that are beeing cleaned during their warm-up time will have the time frozen in the names, if you started a new game it is best to wait at least 15 minutes after start of the script before uninstalling so the lasertowers will have time to get deployed and will end up getting cleaned correctly.

The following files can now be removed from the following folders :

director :

Colored_Race_Ships.xml

scripts :

setup.colorcleanershipsandstations.xml
setup.colored.race.ships
setup.colored.stations
colorcleanershipsandstations
colored.race.ships
colored.stations

t :

9921-L044.xml t/m 9927-L044.xml


qwizzie

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Sat, 25. May 13, 17:22

Uploaded newer version 2.0, pls download again from first post.

- switched from MD to AL plugin which seems to help a lot with the impact this script has on the engine (hardly any lagg anymore)
- the AL plugin will check every 10 seconds for uncolored ships and stations
and color them when found.
- added coloring of claimable ships in color purple in this script as well so it could profit from the AL plugin.

note : See first post for more information on how to upgrade from version 1.0 to version 2.0 and also what to do when using my Colored Claimable Ships script

note : i noticed the AL plugin code in graxster's script [AL Plugin] Remove Prefix "Your" from Player Property and decided to use the AL plugin method instead of MD recue.

User avatar
Phinixa
Posts: 320
Joined: Sun, 4. Apr 10, 01:47
x4

Post by Phinixa » Mon, 3. Jun 13, 23:34

Does this script works with the german version of the game? I installed it to my AP 3.0 directory and the sector map shows only ReadTexts :(

qwizzie
Posts: 562
Joined: Thu, 1. Jun 06, 12:17
x4

Post by qwizzie » Tue, 4. Jun 13, 07:31

not yet.

Pls try the following Phinixa :

Step 1

for X3 AP : locate ''t'' folder in the addon folder in yr X3 installation directory
for X3 TC : locate ''t'' folder in the X3 installation directory

For STEAM users the X3 installation directory can be found here :

X3 AP : "C:\Program Files (x86)\Steam\steamapps\common\X3 Terran Conflict\addon"
X3 TC : "C:\Program Files (x86)\Steam\steamapps\common\X3 Terran Conflict"

For DVD / Disc users the X3 installation directory can be found by checking the target of the shortcut you use to start X3 AP or X3 TC)

Step 2

Rename the following t files there as follows :

9921-L044.xml --> rename to 9921-L049.xml

Step 3

open t file 9921-L049 with wordpad and change
<language id="44"> to <language id="49">

Repeat step 2 and 3 with t files 9922-L044 till 9927-L044

let me know if this works and i will add german support

Thanks in advance

qwizzie

User avatar
Phinixa
Posts: 320
Joined: Sun, 4. Apr 10, 01:47
x4

Post by Phinixa » Tue, 4. Jun 13, 12:22

Jep, it works now. But I had to start a new game.
I also did the same thing with the t-file of your colored universe map.
Now, the map is completely english(But it works!). Any easy way to translate the content of the t-file automatically? Or should I translate it?

Post Reply

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