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

Chart Screens

General discussion for players of Oolite.

Moderators: another_commander, winston

User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Chart Screens

Post by Killer Wolf »

What am i doing wrong - i've jumped, docked, gone to the chart then searched on a planet name. got the full galaxy map up but from that point i can't get back to the local chart, pressing the key just toggles the "search for planet" on and off.

TIA
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Re: Chart Screens

Post by Killer Wolf »

...and script issues. i'm trying to get the script to work that pop's my new item in a particular place. took a crack at the code phkb pasted, and nothing showed up. i've eventually cut it back to see if it's my amendments or something else, so basically now it should just write a log message when i jump into Ansoreus in Galaxy 2. as far as i'm reading on the wiki, it's planet 191 and the galaxy numbers start at 0 for Galaxy 1, so i've got;-

Code: Select all

this.systemWillPopulate = function() {
	if (galaxyNumber === 1 && system.ID === 191) {
		log("Arrived ");
	}
}
i no longer get compilation errors, log says the world script has loaded, but when i exit witchspace i'm not getting the log message.

TIA
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Chart Screens

Post by spara »

I have no idea what the actual problem is :D, but I suggest debugging by printing galaxyNumber and system.ID to the log.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4666
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Chart Screens

Post by phkb »

With the script issues, it sounds like your function is not being called. Is your script file called “script.js”, located in the Config folder? Or have you created a unique filename in the Scripts folder, and referenced it in world-scripts.plist?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5021
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Chart Screens

Post by Cholmondely »

Killer Wolf wrote: Sat Nov 18, 2023 11:15 am
What am i doing wrong - i've jumped, docked, gone to the chart then searched on a planet name. got the full galaxy map up but from that point i can't get back to the local chart, pressing the key just toggles the "search for planet" on and off.

TIA
The F6 charts were amalgamated back in v.1.82 (2015):
Graphics and interface upgrades

We've made some improvements to some of the graphics and interfaces, with the main one being the fully zoomable and scrollable galaxy map, which replaces the separate short-range and long-range charts. Route plotting has also been improved: with the Advanced Navigational Array, you can set a route to the other side of the chart, and then jump along it a step at a time without having to re-plot.
But, as you noticed, the ability to search for planets seems to have escaped the amalgamation and is now the remaining difference between the two.

Introducing the zoom also made the circle of jumpable range less accurate - and wrecked the original BGS-X addition of templates showing the different regions and the GNN updates of these.

Image
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4666
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Chart Screens

Post by phkb »

With the chart screen, do the page up and page down keys work?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6559
Joined: Wed Feb 28, 2007 7:54 am

Re: Chart Screens

Post by another_commander »

Killer Wolf wrote: Sat Nov 18, 2023 11:15 am
What am i doing wrong - i've jumped, docked, gone to the chart then searched on a planet name. got the full galaxy map up but from that point i can't get back to the local chart, pressing the key just toggles the "search for planet" on and off.

TIA
What has happened is that while working with the chart, you set it to max zoom out using PgUp/PgDn or mousewheel. Then you pressed F6 to search for a planet, then pressed F6 to go back to the local area view of the chart, but because it had been already in full zoom out, you did not notice any change other than toggling the Find Planet text input on and off.

Solution: Zoom back in with mousewheel or PgUp/PgDn.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Re: Chart Screens

Post by Killer Wolf »

phkb wrote: Sat Nov 18, 2023 7:28 pm
With the script issues, it sounds like your function is not being called. Is your script file called “script.js”, located in the Config folder? Or have you created a unique filename in the Scripts folder, and referenced it in world-scripts.plist?
the latter, i was copying the Tianve pulsar thing as that was an example of something that occurs in a specific system. i've got a world-scripts entry from "II_populator.js" and a Scripts folder holding the same-named item. in the log however it says

Code: Select all

15:08:08.569 [script.load.world.listAll]: Loaded 46 world scripts:
...
       II_populator.js.anon-script
is there any significance to it appending "anon-script"? non of the other couple dozen entries have that.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Re: Chart Screens

Post by Killer Wolf »

another_commander wrote: Sat Nov 18, 2023 8:21 pm
Killer Wolf wrote: Sat Nov 18, 2023 11:15 am
What am i doing wrong - i've jumped, docked, gone to the chart then searched on a planet name. got the full galaxy map up but from that point i can't get back to the local chart, pressing the key just toggles the "search for planet" on and off.

TIA
What has happened is that while working with the chart, you set it to max zoom out using PgUp/PgDn or mousewheel. Then you pressed F6 to search for a planet, then pressed F6 to go back to the local area view of the chart, but because it had been already in full zoom out, you did not notice any change other than toggling the Find Planet text input on and off.

Solution: Zoom back in with mousewheel or PgUp/PgDn.
tch! i knew it would be something obvious! cheers.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4666
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Chart Screens

Post by phkb »

Killer Wolf wrote: Sun Nov 19, 2023 10:42 am
is there any significance to it appending "anon-script"? non of the other couple dozen entries have that.
It's probably something significant, and probably also the cause of your issues, but I'm not sure what the cause would be. The main thing is that you can't mix using a "script.js" file with a "world-scripts.plist" file. But if you're not using a script.js, that question is answered. Can you post a copy of the content of your world-scripts.plist file?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4666
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Chart Screens

Post by phkb »

Killer Wolf wrote: Sun Nov 19, 2023 10:42 am
is there any significance to it appending "anon-script"? non of the other couple dozen entries have that.
I had a quick look at the source, and it might occur if you haven't given your script file a "this.name" property at the top. For example, taken from the VimanaX_HUD.js file

Code: Select all

"use strict";
this.name = "VimanaX_HUD"; // << this line
this.author = "Gnievmir, phkb";
this.license = "CC-BY-NC-SA 3.0";
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Re: Chart Screens

Post by Killer Wolf »

ta for that. i've been fiddling re the above comments and in an effort to try and track down what's not working i went back to my simple populator script.js in the config folder. it spawns the item no prob on exit from WS, so i added a line or two;

Code: Select all

this.role = "KWii"; 
this.count = 1; 
this.kwgal = galaxyNumber;
this.kwsys = system.ID;

// Standard attributes 
this.name           = "Spawn-" + this.role; 
this.author         = "Jens Ayton"; 
this.copyright      = "This script is hereby placed in the public domain."; 
this.version        = "1.0.1"; 
this.description    = "Script to make several ships of a given role appear outside the station upon launching." 


//this.shipWillLaunchFromStation = function() 
this.shipWillExitWitchspace = function() 
{ 
	system.addShipsToRoute(this.role, 1, 0.7, "ws")
    //system.legacy_addSystemShips(this.role, this.count, 1.0); 
 //   log("testscript.spawn", "Generated " + this.count + " " + this.role + " for testing purposes."); 
	log("gal" + this.kwgal + " planet " + this.kwsys);
	
} 
when i run and spawn, i got the "generated message" but nothing about the gal/system. i commented out the spawn message, still nothing :-(
no compy errors, why's it ignoring me?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4666
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Chart Screens

Post by phkb »

Can you try changing “this.name” to a basic string eg

Code: Select all

this.name = “spawningmyship”;
and see if that makes a difference?
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Re: Chart Screens

Post by Killer Wolf »

nope, still spawns but doesn't write :-/
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4666
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Chart Screens

Post by phkb »

Can you send me a copy of the OXP as it is now? This one has me a bit stumped as well!
Post Reply