[Beta] Release of Telescope 2.0

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

Moderators: another_commander, winston

cag
Deadly
Deadly
Posts: 197
Joined: Fri Mar 17, 2017 1:49 am

Re: [Beta] Release of Telescope 2.0

Post by cag »

The first one is a simple fix. The second I cannot reproduce using Norby's escortDeck.

Telescope 2.0 doesn't use $TelescopeList anymore and is supported for oxp compatibility. Its indexOf function was written just for escortDeck. I'll need a copy of your version to track down the problem.
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [Beta] Release of Telescope 2.0

Post by Milo »

There’s a bug in Towbar 1.1 that overwrites TelescopeList instead of TelescopeListi.
cag
Deadly
Deadly
Posts: 197
Joined: Fri Mar 17, 2017 1:49 am

Re: [Beta] Release of Telescope 2.0

Post by cag »

Thanks for the quick heads-up. No doubt you've saved us some wasted time. It's funny how much havoc can sometimes be unleashed by changing one single character!
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [Beta] Release of Telescope 2.0

Post by Milo »

Should the operator on these lines be >= ?

Code: Select all

			if( 	 ps_mass > 1e8 ) mult = 8;						//baseship scan double range third time
			else if( ps_mass > 1e6 ) mult = 4;						//huge player ship double range another time
cag
Deadly
Deadly
Posts: 197
Joined: Fri Mar 17, 2017 1:49 am

Re: [Beta] Release of Telescope 2.0

Post by cag »

Yes, they should, to be consistent with a test ps_mass >= 1e8 in update_grav_scan().

These inequalities were copied from Norby's version, so this has always been there. AFAIK, ship's mass is calculated based on ships volume, so there's no danger of a ship designer setting mass to a power of 10.
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4643
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: [Beta] Release of Telescope 2.0

Post by phkb »

I've just posted a small update to Telescope v2 (taking it to v2.1.3) which removes the monkey patches it was using to fix some HUD Selector issues. With the recent updates to HUD Selector, these monkey patches are no longer required. Should be in the manager shortly.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4643
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: [Beta] Release of Telescope 2.0

Post by phkb »

Another small update, now v2.1.4. Just added some code so that the current mode of the primable equipment is readable by other OXP's. Not writable, though.
User avatar
MrFlibble
Deadly
Deadly
Posts: 170
Joined: Sun Feb 18, 2024 12:13 pm

Re: [Beta] Release of Telescope 2.0

Post by MrFlibble »

Attempting to use the collect_shipdata.py script. Totally ignorant as to whether it'll make any difference to the "no problem" I have.

Tried using python 2.7 and 3.10. Both spit out an error like this and give a Pdb prompt.

Code: Select all

_load_effects, Error: name 'load' is not defined
Traceback (most recent call last):
  File "/tmp/collect_shipdata.py", line 486, in _load_effects
    parsed = load( fp )
NameError: name 'load' is not defined
> /tmp/collect_shipdata.py(529)_load_effects()
-> CurrentFile = None
No harm is done. No files are changed.

Does it work for anyone else on a current Linux?
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sat Aug 09, 2014 4:16 pm

Re: [Beta] Release of Telescope 2.0

Post by Commander_X »

MrFlibble wrote: Sun Apr 14, 2024 4:18 pm
[...]
Tried using python 2.7 and 3.10. Both spit out an error like this and give a Pdb prompt.

Code: Select all

_load_effects, Error: name 'load' is not defined
Traceback (most recent call last):
  File "/tmp/collect_shipdata.py", line 486, in _load_effects
    parsed = load( fp )
NameError: name 'load' is not defined
> /tmp/collect_shipdata.py(529)_load_effects()
-> CurrentFile = None
[...]
Does it work for anyone else on a current Linux?
It works here, without telescope extension installed.

Code: Select all

** Failed to locate Telescope oxp, cannot update.

Processed 5 files, new entities registered: 229

  input:    shipdata     213,682

 output:    required           0
            generated    103,289
            total        103,289
I don't have a lot of AddOns, and no ManagedAddOns.
I didn't encounter your error, but it seems that it should be caused by the fact that at line 486 is used a "load" call which should be replaced with "readPlistFile" for python 3.x (as defined on line 21). Although the "readPlistStream" (imported next) is used once in the file, the "readPlistFile" is not, which leads me to think line 486 was left unprocessed during python2/3 adjustment.
User avatar
MrFlibble
Deadly
Deadly
Posts: 170
Joined: Sun Feb 18, 2024 12:13 pm

Re: [Beta] Release of Telescope 2.0

Post by MrFlibble »

Commander_X wrote: Sun Apr 14, 2024 8:55 pm
I didn't encounter your error, but it seems that it should be caused by the fact that at line 486 is used a "load" call which should be replaced with "readPlistFile" for python 3.x (as defined on line 21). Although the "readPlistStream" (imported next) is used once in the file, the "readPlistFile" is not, which leads me to think line 486 was left unprocessed during python2/3 adjustment.
Thank you.

Changed line 486 to

Code: Select all

				parsed = readPlistFile( fp )
and all runs well in python 3.10.

It now breaks differently in python 2.7, but I doubt that is of current relevance as python 3 ought to be default for most folk by now.

Code: Select all

Collected 2218 ents from 73 files, output is 786475

ouput_update, 'module' object has no attribute 'unpack_archive'
Traceback (most recent call last):
  File "collect_shipdata.py", line 2114, in ouput_update
    shutil.unpack_archive(TelescopeOxz, tmpFolder, 'zip')
AttributeError: 'module' object has no attribute 'unpack_archive'
--Return--
> /tmp/collect_shipdata.py(2152)ouput_update()->None
-> pdb.set_trace()
Traceback (most recent call last):
  File "collect_shipdata.py", line 2425, in <module>
    sys.exit(1 if main() else 0)
  File "collect_shipdata.py", line 2406, in main
    err, update = update_eff_data()
  File "collect_shipdata.py", line 2212, in update_eff_data
    fallback = ouput_update(output)
  File "collect_shipdata.py", line 2152, in ouput_update
    pdb.set_trace()
  File "/usr/lib/python2.7/bdb.py", line 53, in trace_dispatch
    return self.dispatch_return(frame, arg)
  File "/usr/lib/python2.7/bdb.py", line 88, in dispatch_return
    self.user_return(frame, arg)
  File "/usr/lib/python2.7/pdb.py", line 190, in user_return
    self.interaction(frame, None)
  File "/usr/lib/python2.7/pdb.py", line 210, in interaction
    self.cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 130, in cmdloop
    line = raw_input(self.prompt)
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [Beta] Release of Telescope 2.0

Post by Cholmondely »

MrFlibble wrote: Mon Apr 15, 2024 2:11 pm
I doubt that is of current relevance as python 3 ought to be default for most folk by now.
I'm using an AppleMac and know nothing about any of this. I thought that OXPs were in OpenStep/XML or Javascript, not Python. How would I tell if I have Python 3 or 2? I presume that this is why I only sometimes see the Masslock borders.
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
MrFlibble
Deadly
Deadly
Posts: 170
Joined: Sun Feb 18, 2024 12:13 pm

Re: [Beta] Release of Telescope 2.0

Post by MrFlibble »

Cholmondely wrote: Mon Apr 15, 2024 4:11 pm
MrFlibble wrote: Mon Apr 15, 2024 2:11 pm
I doubt that is of current relevance as python 3 ought to be default for most folk by now.
I'm using an AppleMac and know nothing about any of this. I thought that OXPs were in OpenStep/XML or Javascript, not Python. How would I tell if I have Python 3 or 2? I presume that this is why I only sometimes see the Masslock borders.
The script gleans ship data for the 3d views in telescope and inserts a plist into the OXP. It needs to be run when ships are added to the OXP mix if you use the 3d views else you'll get question marks for non-core ships. The python script is in the OXZ, and can be extracted to anywhere for execution.

To check python version, open a terminal and type

Code: Select all

python --version
Some installations might have python as a symlink to a specific version, so python might be linked to python3, which is in turn linked to python 3.10, and python2 will likely link to python2.7. So running "python2 script.py" should execute script.py using python version 2.
User avatar
MrFlibble
Deadly
Deadly
Posts: 170
Joined: Sun Feb 18, 2024 12:13 pm

Re: [Beta] Release of Telescope 2.0

Post by MrFlibble »

Code: Select all

ls -al $(which python)
...will show whether python is a link and to what.
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [Beta] Release of Telescope 2.0

Post by Cholmondely »

Thanks for that!

I've got Python 2.7.16 on my 2020 AppleMac.

ls -al $(which python) did not link to anything obviously Oolitical.
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?
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sat Aug 09, 2014 4:16 pm

Re: [Beta] Release of Telescope 2.0

Post by Commander_X »

For some reasons the messages after the one I posted were not picked by the rss/atom feed.
Cholmondely wrote: Mon Apr 15, 2024 4:27 pm
[...]
I've got Python 2.7.16 on my 2020 AppleMac.
[...]
Yes, it seems there is a bit of love/hate relationship between Apple and Python community -- you might be able to pick more current versions from homebrew or the other brew channels.
MrFlibble wrote: Mon Apr 15, 2024 2:11 pm
[...]
Changed line 486 to

Code: Select all

				parsed = readPlistFile( fp )
and all runs well in python 3.10.

It now breaks differently in python 2.7, but I doubt that is of current relevance as python 3 ought to be default for most folk by now.
[...]
The new break seems to be caused by the fact that there is no unpack_archive in shutil module of python 2 (2.7.18 version, here), only in python 3.
Post Reply