Oolite Bulletins

For information and discussion about Oolite.
It is currently Mon Nov 20, 2017 11:44 am

All times are UTC




Post new topic  Reply to topic  [ 177 posts ]  Go to page Previous 16 7 8 9 1012 Next
Author Message
PostPosted: Mon Dec 24, 2012 5:03 pm 
Offline
Thargoid
Thargoid
User avatar

Joined: Thu Jun 12, 2008 6:55 pm
Posts: 5510
As noted when you reported this before - this one can be ignored. The new way of doing docks (to allow multiple ones) needs to have at least one dock defined for a dockable. Hence "proximity docks" like are used here (and in Lave Academy and Planetfall, amongst others) which don't have such a defined dock need one to be added.

The message is just a notification that the trunk code is doing that (adding a virtual dock), but aside from the notification everything else should continue to work fine. It's not too difficult to add real docks, but it needs new sub-entities hidden within the main model.

_________________
My OXPs via Boxspace or from my Wiki pages :D.

Thargoid TV
Dropbox Referral Link


Top
   
PostPosted: Wed Jan 15, 2014 5:57 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
A question to the script experts. :D :

I want to make the Superhub appear NOT random anymore. I want to spawn it via the code used to spawn the Lave Academy.
Lave Academy uses a following script:
Code:
this.setUpArrays = function()
	{
	this.academyList = [0, 1, 2, 3, 4, 5, 6, 7]; // galaxies 0-7
	this.academyList[0] = [7, 173, 168, 133, 4]; // Lave, Esteonbi, Enonla, Esanbe, Xequerin
	this.academyList[1] = [24, 92, 210, 55, 194]; // Maesaron, Erenanri, Reveabe, Legeara, Tigebere
	this.academyList[2] = [58, 165, 106, 198, 164]; // Radiqu, Edxeri, Ceedleon, Atius,Rerebi
	this.academyList[3] = [13, 47, 130, 18, 122]; // Mavelege, Bemate, Cebitiza,  Mausra, Ensoor
	this.academyList[4] = [16, 193, 231, 92, 9]; // Zaaner, Vebi, Inenares, Azaenbi, Dioris
	this.academyList[5] = [151, 6, 85, 146, 240]; // Teesso, Oresmaa, Celaan, Ariqu, Inesbe
	this.academyList[6] = [189, 146, 130, 118, 37]; // Isdilaon, Aenbi, Ataer, Orreedon, Qutegequ
	this.academyList[7] = [177, 31, 211, 157, 20]; // Ceenza, Aarzari, Biatzate, Inbein, Oredrier
	this.singleList = [7, 24, 58, 13, 16, 151, 189, 177]; // array for when 1 academy per galaxy selected
	}
The Current spawn script for the Superhub is:
Code:
this.name           = "PAGroove_superhubPopulator";
this.author         = "Thargoid";
this.copyright      = "This script is hereby placed in the public domain.";
this.version        = "1.1";
this.description    = "Script to add a single superhub near the system main station";


this.shipWillLaunchFromStation = function(station)
   {
   if(station.isMainStation)
      {
      this.spawnHub();
      }
   }

this.shipWillExitWitchspace = function()
   {
   this.spawnHub();
   }

this.spawnHub = function()
   {
   if(Math.random() < 0.5 || system.techLevel < 11 || system.government < 4 || system.countShipsWithRole("pagroove_superhub") > 0 || this.superHubBlock)   
      {
      this.superHubBlock = true;
      return;
      }
   else
      {
      this.xOffset = (Math.random() * 10000) + 10000; // x offset between 10 and 20km
      this.yOffset = (Math.random() * 10000) + 10000; // y offset between 10 and 20km

      if(Math.random() > 0.5) // 50:50 chance of offsetting in the other direction
         {
         this.xOffset = -this.xOffset;
         }
      if(Math.random() > 0.5) // 50:50 chance of offsetting in the other direction
         {
         this.yOffset = -this.yOffset;
         }

      system.legacy_addShipsAtPrecisely("pagroove_superhub", 1, "abs", system.mainStation.position.add([this.xOffset, this.yOffset, 0]));
      }
   }

this.shipWillEnterWitchspace = function()
   {
   this.superHubBlock = null;
   }
How can the spawn script be adapted so I can handcode the Superhubs per galaxy? I want to do this in such a way that Superhubs appear in Tech 14/14 systems? I made a custom docking tunnel but I can't find super hubs currently because it doesn't spawn very often when visiting a high tech system.

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Wed Jan 15, 2014 6:08 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
User avatar

Joined: Fri Nov 11, 2011 6:19 pm
Posts: 4014
Quote:
How can the spawn script be adapted so I can handcode the Superhubs per galaxy? I want to do this in such a way that Superhubs appear in Tech 14/14 systems? I made a custom docking tunnel but I can't find super hubs currently because it doesn't spawn very often when visiting a high tech system.
To just add them always to all TL 14/15 systems, and never to any others, replace
Code:
   if(Math.random() < 0.5 || system.techLevel < 11 || system.government < 4 || system.countShipsWithRole("pagroove_superhub") > 0 || this.superHubBlock)   
with
Code:
   if(system.techLevel < 13 || system.countShipsWithRole("pagroove_superhub") > 0 || this.superHubBlock)   
On the rest of the script, 1.79 will include two changes of relevance:
1) The ability to save at non-main stations. This will cause potential problems with that script unless you change
Code:
   if(station.isMainStation)
      {
      this.spawnHub();
      }
to
Code:
      this.spawnHub();
Making that change will not break the script in current Oolite versions.

2) A new way of running the system populator. There is no hurry to switch to this, and it wouldn't work with older versions if you did, but certain ways of using it will mean that the SuperHub could become a non-main station you could save at, and it could also make the script simpler.

_________________
OXPs: [EliteWiki] New Cargoes, [EliteWiki] Skilled NPCs, [EliteWiki] Curse of the Black Sunspot, and more


Top
   
PostPosted: Wed Jan 15, 2014 6:15 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
Thanks CIM. I have changed the script and I will now start testing.
:D

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Wed Jan 15, 2014 6:44 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
Mmm it doesn't spawn. Flew a few times into Maraus and nothing:

This is the current script. Any faults?
Code:
this.name           = "PAGroove_superhubPopulator";
this.author         = "Thargoid";
this.copyright      = "This script is hereby placed in the public domain.";
this.version        = "1.1";
this.description    = "Script to add a single superhub near the system main station";


this.shipWillLaunchFromStation = function(station)
   {
    this.spawnHub();
   }

this.shipWillExitWitchspace = function()
   {
   this.spawnHub();
   }

this.spawnHub = function()
   {
   if(system.techLevel < 13 || system.countShipsWithRole("pagroove_superhub") > 0 || this.superHubBlock)     
      {
      this.superHubBlock = true;
      return;
      }
   else
      {
      this.xOffset = (Math.random() * 10000) + 10000; // x offset between 10 and 20km
      this.yOffset = (Math.random() * 10000) + 10000; // y offset between 10 and 20km

      if(Math.random() > 0.5) // 50:50 chance of offsetting in the other direction
         {
         this.xOffset = -this.xOffset;
         }
      if(Math.random() > 0.5) // 50:50 chance of offsetting in the other direction
         {
         this.yOffset = -this.yOffset;
         }

      system.legacy_addShipsAtPrecisely("pagroove_superhub", 1, "abs", system.mainStation.position.add([this.xOffset, this.yOffset, 0]));
      }
   }

this.shipWillEnterWitchspace = function()
   {
   this.superHubBlock = null;
   }

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Wed Jan 15, 2014 7:37 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
The log says this a syntax error on line 25
Code:
    ~/Games/Oolite Trunk 1.79-10jan2014/AddOns/Superhubv1.5t.oxp
    ~/Games/Oolite Trunk 1.79-10jan2014/AddOns/superico.oxp
20:24:18.881 [plist.parse.failed]: Failed to parse /Users/pagroove/Games/Oolite Trunk 1.79-10jan2014/AddOns/Superhubv1.5t.oxp/Config/shipdata.plist as a property list.
20:24:36.623 [script.javaScript.exception.syntaxError]: ***** JavaScript exception (Superhubv1.5t.anon-script): SyntaxError: syntax error
20:24:36.623 [script.javaScript.exception.syntaxError]:       /Users/pagroove/Games/Oolite Trunk 1.79-10jan2014/AddOns/Superhubv1.5t.oxp/Config/script.js, line 25:    else
20:24:36.623 [script.javaScript.load.failed]: ***** Error loading JavaScript script /Users/pagroove/Games/Oolite Trunk 1.79-10jan2014/AddOns/Superhubv1.5t.oxp/Config/script.js -- compilation failed
    CargoTypeExtension-Station-SuperHub 1.2.3
20:25:36.050 [script.javaScript.exception.syntaxError]: ***** JavaScript exception (Superhubv1.5t.anon-script): SyntaxError: syntax error
20:25:36.050 [script.javaScript.exception.syntaxError]:       /Users/pagroove/Games/Oolite Trunk 1.79-10jan2014/AddOns/Superhubv1.5t.oxp/Config/script.js, line 25:    else
20:25:36.051 [script.javaScript.load.failed]: ***** Error loading JavaScript script /Users/pagroove/Games/Oolite Trunk 1.79-10jan2014/AddOns/Superhubv1.5t.oxp/Config/script.js -- compilation failed
    CargoTypeExtension-Station-SuperHub 1.2.3
What goes wrong here?

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Wed Jan 15, 2014 8:04 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
User avatar

Joined: Fri Nov 11, 2011 6:19 pm
Posts: 4014
Code:
20:24:18.881 [plist.parse.failed]: Failed to parse /Users/pagroove/Games/Oolite Trunk 1.79-10jan2014/AddOns/Superhubv1.5t.oxp/Config/shipdata.plist as a property list.
This may be why you never saw one before.
Code:
20:24:36.623 [script.javaScript.exception.syntaxError]: ***** JavaScript exception (Superhubv1.5t.anon-script): SyntaxError: syntax error
Line 25 of the script as pasted above looks fine to me, as do the ones around it. Indeed, copying and pasting into a JS file here, Oolite loads it just fine.

I've thought of another change that might be useful, though it won't fix the error.
Code:
if(system.techLevel < 13 || system.countShipsWithRole("pagroove_superhub") > 0 || this.superHubBlock) 
should really be
Code:
if(this.superHubBlock || system.techLevel < 13 || system.countShipsWithRole("pagroove_superhub") > 0)
The reason is that the conditions are checked from left to right, so the efficiency of checking this.superHubBlock only does any good if it's the first thing checked.

_________________
OXPs: [EliteWiki] New Cargoes, [EliteWiki] Skilled NPCs, [EliteWiki] Curse of the Black Sunspot, and more


Top
   
PostPosted: Wed Jan 15, 2014 11:12 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
I solved it. It was a problem in the .plist. I tried to add a docking tunnel but introduced new errors. I now have it working and have beautiful tunnel now too. Screenshots soon.

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Wed Jan 15, 2014 11:18 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
Here it is (The new SuperHub launch tunnel)
Coming soon in the new version.

Image

Is it possible to generate different cargo contracts and carrier markets than the main station on a dockable?

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Wed Jan 15, 2014 11:38 pm 
Online
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 12918
Location: Corke's Drift
Oooh... shiny!

_________________
The only good fnord is a dead fnord!


Top
   
PostPosted: Thu Jan 16, 2014 12:45 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
Updated the OXP:

v 1.5
-SuperHubs now appear at all Tech 14 and Tech 15 planets. (no more Random)
-Added a BGS Launch tunnel
-Added a License (See wiki page and in read me for details)

Download Link:

https://app.box.com/s/cd4ontw41gody7ckctu8

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Thu Jan 16, 2014 12:50 am 
Online
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 12918
Location: Corke's Drift
Maraus is gonna be a little crowded, what with a Torus Station, a Zieman Habitat, and now a Superhub - cool.

_________________
The only good fnord is a dead fnord!


Top
   
PostPosted: Thu Jan 16, 2014 12:52 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
Quote:
Maraus is gonna be a little crowded, what with a Torus Station, a Zieman Habitat, and now a Superhub - cool.
Well it is a HUB region. :)
The Maraus Hub (Should be on the Vector Maps IMO.

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
PostPosted: Thu Jan 16, 2014 12:55 am 
Online
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 12918
Location: Corke's Drift
Quote:
The Maraus Hub (Should be on the Vector Maps IMO.
I've been operating in and around the Maraus Hub for quite a while now - it's the sweet spot in G7.

_________________
The only good fnord is a dead fnord!


Top
   
PostPosted: Thu Jan 16, 2014 1:00 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Feb 21, 2007 11:52 pm
Posts: 3025
Location: On a famous planet
Quote:
Quote:
The Maraus Hub (Should be on the Vector Maps IMO.
I've been operating in and around the Maraus Hub for quite a while now - it's the sweet spot in G7.
Also my current base of operations. And don't forget the RSS Galactic HQ that is also stationed in the Maraus System.

_________________
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
http://aegidian.org/bb/viewtopic.php?f=4&t=13709


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 177 posts ]  Go to page Previous 16 7 8 9 1012 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited