Page 1 of 2

Chart Screens

Posted: Sat Nov 18, 2023 11:15 am
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

Re: Chart Screens

Posted: Sat Nov 18, 2023 2:24 pm
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

Re: Chart Screens

Posted: Sat Nov 18, 2023 3:41 pm
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.

Re: Chart Screens

Posted: Sat Nov 18, 2023 7:28 pm
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?

Re: Chart Screens

Posted: Sat Nov 18, 2023 7:48 pm
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

Re: Chart Screens

Posted: Sat Nov 18, 2023 7:57 pm
by phkb
With the chart screen, do the page up and page down keys work?

Re: Chart Screens

Posted: Sat Nov 18, 2023 8:21 pm
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.

Re: Chart Screens

Posted: Sun Nov 19, 2023 10:42 am
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.

Re: Chart Screens

Posted: Sun Nov 19, 2023 10:48 am
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.

Re: Chart Screens

Posted: Sun Nov 19, 2023 10:53 am
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?

Re: Chart Screens

Posted: Sun Nov 19, 2023 11:00 am
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";

Re: Chart Screens

Posted: Sun Nov 19, 2023 11:14 am
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?

Re: Chart Screens

Posted: Sun Nov 19, 2023 11:22 am
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?

Re: Chart Screens

Posted: Mon Nov 20, 2023 5:42 pm
by Killer Wolf
nope, still spawns but doesn't write :-/

Re: Chart Screens

Posted: Mon Nov 20, 2023 7:13 pm
by phkb
Can you send me a copy of the OXP as it is now? This one has me a bit stumped as well!