specific color for abandoned ship???
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
specific color for abandoned ship???
Hi,
is there a script to have name of abandoned ship in a different color in the sector map menu??
I know that with X3TC XTC (and its scripts included), the abandoned ships appeared in blue, which was convenient to identify them, but I play with X3AP XRM right now and I don't have this "option"
is there a script to have name of abandoned ship in a different color in the sector map menu??
I know that with X3TC XTC (and its scripts included), the abandoned ships appeared in blue, which was convenient to identify them, but I play with X3AP XRM right now and I don't have this "option"
- Lord Dakier
- Posts: 3243
- Joined: Fri, 8. Dec 06, 13:45
- apricotslice
- Posts: 14129
- Joined: Sun, 16. May 04, 13:01
In my mod, they appear in orange. I'd have to look to see which script does it, as it was a long time ago it was written for me.
Its not inherently difficult to do though, using a text file.
edit : found it. This checks the sector and automatically changes all abandonned ships to an orange colour. You can run it manually, or call it from a script you do run regularly.
And the text file is ....
Its not inherently difficult to do though, using a text file.
edit : found it. This checks the sector and automatically changes all abandonned ships to an orange colour. You can run it manually, or call it from a script you do run regularly.
Code: Select all
001 $PageID = 9915
002 load text: id=$PageID
003
004 $array.ship = get ship array: of race Neutral Race class/type=Ship
005 $size = size of array $array.ship
006
007 while $size > 0
008 |dec $size =
009 |$ship = $array.ship[$size]
010 |$is.renamed = $ship -> get local variable: name='AS.Is.Renamed'
011 |if $is.renamed != [TRUE]
012 ||$ship -> set local variable: name='AS.Is.Renamed' value=[TRUE]
013 ||$old.name = $ship -> get name
014 ||$new.name = sprintf: pageid=$PageID textid=100, $old.name, null, null, null, null
015 ||$ship -> set name to $new.name
016 |end
017 |skip if not $size == ( $size / 20 ) * 20
018 @ ||= wait 100 ms
019 end
020 return null
021
022
023
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<language id="44">
<page id="9915" title="Messages" descr="Info Nom">
<t id="100">\033O%s\033x</t>
</page>
</language>
very nice script Apricotslice .. thanks for putting it in this post.
For my own use i changed ''Ship'' to ''Moveable Ship'' in line 004 so astronauts will be excluded from the ''paintjob''
To get your script (which i named ''Colored.xml'') going on in the background you could use for example this MD code
(which needs to be put in the directory folder) :
For my own use i changed ''Ship'' to ''Moveable Ship'' in line 004 so astronauts will be excluded from the ''paintjob''
Code: Select all
004 $array.ship = get ship array: of race Neutral Race class/type=Ship
To get your script (which i named ''Colored.xml'') going on in the background you could use for example this MD code
(which needs to be put in the directory folder) :
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="Colored Claimable Ships" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
<documentation>
<author name="qwizzie" />
<content name="Colored Claimable Ships" description="Installs Colored Claimable Ships" />
<version number="1.0" date="16/05/13" status="active" />
</documentation>
<cues>
<cue name="Colored Claimable Ships">
<condition>
<check_all>
<check_age value="{player.age}" min="1s" />
</check_all>
</condition>
<action>
<do_all>
<run_script script="Colored" />
<cues>
<cue name="restart MD">
<timing>
<time exact="180s" comment="180 sec delay"/>
</timing>
</cue>
</cues>
<reset_cue cue="Colored Claimable Ships"/>
</do_all>
</action>
</cue>
</cues>
</director>
- apricotslice
- Posts: 14129
- Joined: Sun, 16. May 04, 13:01
The script was written originally by Logain Abler, for a specific situation. I call it from various places, such as my jump to derelict script, so that the first thing that happens after jumping to a new sector with a derelict ship in it, is that all such ships turn orange on the nav map.
I deliberately left astronuts in the script, so I could see immediately how many there were, since for a long time, I used to collect them all.
I deliberately left astronuts in the script, so I could see immediately how many there were, since for a long time, I used to collect them all.
- apricotslice
- Posts: 14129
- Joined: Sun, 16. May 04, 13:01
Sorry, I missed your question.
You can name scripts anything you like, but setup at the beginning is only for scripts that run on startup, and ! on the beginning refers to egosoft core scripts.
The only way you can cut and paste code is to use excriptor or the other external script editor. Otherwise, yes, you need to use the internal editor to script in each line of code from scratch. Major pain, but as you said, it is a lesson in scripting.
You can name scripts anything you like, but setup at the beginning is only for scripts that run on startup, and ! on the beginning refers to egosoft core scripts.
The only way you can cut and paste code is to use excriptor or the other external script editor. Otherwise, yes, you need to use the internal editor to script in each line of code from scratch. Major pain, but as you said, it is a lesson in scripting.
I keep getting this error in Exscriptor when I try to save the script. Any idea why?apricotslice wrote:Sorry, I missed your question.
You can name scripts anything you like, but setup at the beginning is only for scripts that run on startup, and ! on the beginning refers to egosoft core scripts.
The only way you can cut and paste code is to use excriptor or the other external script editor. Otherwise, yes, you need to use the internal editor to script in each line of code from scratch. Major pain, but as you said, it is a lesson in scripting.
Saving file...
Save failed because of compilation errors - please compile again
Save failed due to compilation errors!
- Error on line 4 - Unrecognised symbol in expression: get
- Error on line 8 - Unrecognised symbol in expression: dec
- Error on line 9 - Error in expression: expected a number, [constant], 'string', {literal}, null, or (subexpression) but found |.
- Error on line 10 - Unrecognised symbol in expression: get
- Error on line 11 - Error in expression: expected a number, [constant], 'string', {literal}, null, or (subexpression) but found |.
- Error on line 12 - Unrecognised symbol in expression: set
- Error on line 13 - Unrecognised symbol in expression: get
- Error on line 14 - Unrecognised symbol in expression: sprintf
- Error on line 15 - Unrecognised symbol in expression: set
- Error on line 16 - Unrecognised symbol in expression: end
- Error on line 17 - Error in expression: expected a number, [constant], 'string', {literal}, null, or (subexpression) but found |.
- Error on line 18 - Unrecognised symbol in expression: wait
Warnings:
Variable array.ship is being used on line 5 before being assigned to.
- apricotslice
- Posts: 14129
- Joined: Sun, 16. May 04, 13:01
Heres a link:apricotslice wrote:Can you do a screen dump of what excripter is showing ?
Easier to help when we can see what you see.
http://i.imgur.com/LzaTTdm.png
- apricotslice
- Posts: 14129
- Joined: Sun, 16. May 04, 13:01
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Did you copy and paste that code into Exscriptor?
It looks as though you have tab characters (which are not allowed).
It looks as though you have tab characters (which are not allowed).
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Ok removing the tab characters got rid of most of the errors but im still getting two errors for lines 4 and 17:
These are the lines in question:
Anything obvious? Have I used the correct characters?
Code: Select all
- Error on line 4 - Unrecognised symbol in expression: get
- Error on line 17 - Error in expression: expected a number, [constant], 'string', {literal}, null, or (subexpression) but found not.
Code: Select all
Line 4- $array.ship = get ship array: of race Neutral Race class/type=Ship
and
Line 17- skip if not $size == ( $size / 20 ) *20
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Coloring all ship names is not so much difficult as it is prone to conflicts. The above script could easily be adapted. However, scripts that auto-rename ships may not work with colored names (or may just overwrite the colored names).
Updating new ships when they are created is slightly trickier. It requires either a signal_changesector script or a potentially performance-affecting global task.
The color-coded freight menu mod is cool but conflicts with something else that I use... cannot recall what off the top of my head. I think it was the packaging of the mod itself that caused the problem, because I use the technique in my own current game (to give me hints about some of the less-common missiles).
Anyhow, it should be easy enough to do if you want it.
Updating new ships when they are created is slightly trickier. It requires either a signal_changesector script or a potentially performance-affecting global task.
The color-coded freight menu mod is cool but conflicts with something else that I use... cannot recall what off the top of my head. I think it was the packaging of the mod itself that caused the problem, because I use the technique in my own current game (to give me hints about some of the less-common missiles).
Anyhow, it should be easy enough to do if you want it.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
is it happens i was yesterday also thinking in that direction.. which resulted in this script
[SCRIPT] X3 TC / AP : Sectormap Revamped 1.0 dd 17-05-2013
http://forum.egosoft.com/viewtopic.php?t=336711
to OP with regards to coloring claimable ships :
[SCRIPT] X3 TC / AP : Colored Claimable Ships dd 17-05-2013
http://forum.egosoft.com/viewtopic.php?t=336717
[SCRIPT] X3 TC / AP : Sectormap Revamped 1.0 dd 17-05-2013
http://forum.egosoft.com/viewtopic.php?t=336711
to OP with regards to coloring claimable ships :
[SCRIPT] X3 TC / AP : Colored Claimable Ships dd 17-05-2013
http://forum.egosoft.com/viewtopic.php?t=336717