Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

mission.markSystem question

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

mission.markSystem question

Post by Smivs »

The wiki states
Multiple systems may be marked at once, as in mission.markSystem(4, 54, 222).
and gives this code

Code: Select all

mission.markSystem({
   system: 55,
   name: "my_oxp",
   markerColor: "cyanColor",
   markerScale: 1.5,
   markerShape: "MARKER_DIAMOND"
});
but how do you mark more than one?
I tried this format

Code: Select all

mission.markSystem({
   system: (55, 100),
   name: "my_oxp",
   markerColor: "cyanColor",
   markerScale: 1.5,
   markerShape: "MARKER_DIAMOND"
});
but while it marked both systems with a red cross, only the second got the cyan diamond. Does each system need to be coded separately to get the markers working?
Edited to add:- Coding both separately does work, although you still get the red cross as well as the diamond, which I wasn't expecting.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: mission.markSystem question

Post by Eric Walch »

Smivs wrote:
I tried this format....
try every system as a separate object:

Code: Select all

mission.markSystem({
   system: (55),
   name: "my_oxp",
   markerColor: "cyanColor",
   markerScale: 1.5,
   markerShape: "MARKER_DIAMOND"
},
{
   system: (100),
   name: "my_oxp",
   markerColor: "cyanColor",
   markerScale: 1.5,
   markerShape: "MARKER_DIAMOND"
});
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: mission.markSystem question

Post by Smivs »

Yes, I have and that does work.

Edited to add:- Actually, having just tried that, it doesn't work. What does work is

Code: Select all

mission.markSystem({
   system: 55,
   name: "my_oxp",
   markerColor: "cyanColor",
   markerScale: 1.5,
   markerShape: "MARKER_DIAMOND"
});
mission.markSystem({
   system: 100,
   name: "my_oxp",
   markerColor: "cyanColor",
   markerScale: 1.5,
   markerShape: "MARKER_DIAMOND"
});
The only surprise is that you get the red cross as well - I was expecting just the diamond.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: mission.markSystem question

Post by Eric Walch »

Sounds like a bug although I don't see any weird in the code.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: mission.markSystem question

Post by Smivs »

I did wonder about a possible bug, not that I can help much if it is.
Just to be clear by the way, when I refer to a red cross it is an 'X' rather than a crucifix-type cross.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: mission.markSystem question

Post by Eric Walch »

I can't reproduce.

Code: Select all

    mission.markSystem({
       system: 55,
       name: "my_oxp",
       markerColor: "orangeColor",
       markerScale: 1.1,
       markerShape: "MARKER_DIAMOND"
    },
{
       system: 100,
       name: "my_oxp",
       markerColor: "orangeColor",
       markerScale: 1.1,
       markerShape: "MARKER_DIAMOND"
    })
shows 2 orange diamonds. (My code from the first message has wrong () around the system numbers.)
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: mission.markSystem question

Post by Smivs »

Eric Walch wrote:
(My code from the first message has wrong () around the system numbers.)
Ah, I hadn't spotted that either. I just did a c&p. Yes, the above is working fine, (albeit with the red 'X').
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: mission.markSystem question

Post by Eric Walch »

(albeit with the red 'X').
Is there not other code in your script that also places a red cross at the same time?

Or did you test it by pasting the code directly into the console.

[off-topic](Im just mentally preparing for the match of the orange against the blue/white that starts in a hour)[on-topic]
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: mission.markSystem question

Post by Smivs »

Eric Walch wrote:
(albeit with the red 'X').
Is there not other code in your script that also places a red cross at the same time?

Or did you test it by pasting the code directly into the console.

[off-topic](Im just mentally preparing for the match of the orange against the blue/white that starts in a hour)[on-topic]
No other code as far as I know. I'm actually checking that at the moment but am pretty sure there's not. Somehting must be causing it though, so I'll keep looking. I'm tweaking the script and re-starting rather than using the console.
[Off topic] Yes, me too. I hope it's a bit more two-sided than last night! :lol: [/off topic]
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: mission.markSystem question

Post by Smivs »

Mystery solved!
I was using a Commander who had tested this mission before, and the save-file is the culprit. i'm getting a load of

Code: Select all

__oolite_legacy_destinations
like this

Code: Select all

	<dict>
	    <key>markerColor</key>
	    <string>redColor</string>
	    <key>markerScale</key>
	    <real>1</real>
	    <key>markerShape</key>
	    <string>MARKER_X</string>
	    <key>name</key>
	    <string>__oolite_legacy_destinations</string>
	    <key>system</key>
	    <integer>100</integer>
	</dict>
Using a virgin jameson, I just get the diamonds :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16071
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: mission.markSystem question

Post by Cody »

Smivs wrote:
Using a virgin jameson, I just get the diamonds
Damned useful, those virgin Jamesons! Go Holland!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
Post Reply