Oolite Bulletins

For information and discussion about Oolite.
It is currently Tue Nov 21, 2017 12:08 pm

All times are UTC




Post new topic  Reply to topic  [ 816 posts ]  Go to page Previous 151 52 53 54 55
Author Message
 Post subject: Re: Scripting requests
PostPosted: Sun Mar 20, 2016 10:49 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Oct 20, 2007 2:52 pm
Posts: 2267
Could we get an option to set light position and color in mission.runScreen? Maybe even with the possibility to change it on-the-fly? I'm aware that we can pass them to the shader, but writable properties which can be bound are rare.

Image

Edit:Updated pic.


Top
   
 Post subject: Re: Scripting requests
PostPosted: Mon Jul 24, 2017 11:16 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2469
Location: Finland
I want to set materials for a ship using a ship script. Currently I can easily do that in shipSpawned event. That however, does not work when the ship is being displayed on mission screen.

Ideally I would like to have an ship script event shipDisplayed with a suitable handle to the ship model, that would trigger when a ship is being shown.


Top
   
 Post subject: Re: Scripting requests
PostPosted: Tue Oct 17, 2017 1:51 am 
Offline
Competent
Competent

Joined: Fri Mar 17, 2017 1:49 am
Posts: 62
- be able to provide a destination for data to reduce garbage generation

1) calls to filteredEntities or entitiesWithScanClass return arrays, thus generate garbage
- if I could supply an array as a parameter for the result, there'd be no garbage to be collected
(ok, that's a bad solution, how about a separate method?)

[Aside: I replaced a single call to filteredEntities with 11 to entitiesWithScanClass, as that was much faster. But the former creates 3.43 x's as much garbage! filteredEntities must be creating JS objects rather than core ones, no?}

2) during frame callbacks, I often refer to .position & .orientation data, which genereate garbage
- if I could provide a Vector3D object (or better still, an array) for the data to be copied to, no garbage is created

Also, are there any pre-determined garbage collection calls? I'm recycling arrays to reduce how many I create and if I know when a pre-determined GC will occur, I can purge some if my pool gets too big. I currently do purge much in shipWillDockWithStation & shipWillEnterWitchspace on the assumption GC may happen but knowing actually when/if might be helpful.

_________________
"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.


Top
   
 Post subject: Re: Scripting requests
PostPosted: Tue Oct 17, 2017 2:42 am 
Offline
Competent
Competent

Joined: Fri Mar 17, 2017 1:49 am
Posts: 62
I'd like programatic access to the data logged by console.writeJSMemoryStats():
JS heap, limit, # collections to date
- really only need the 1st but with fine resolution (not MiB)
- it could be used to monitor rate of production, isolate which areas are responsible

_________________
"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.


Top
   
 Post subject: Re: Scripting requests
PostPosted: Tue Oct 17, 2017 5:07 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 551
Quote:
Also, are there any pre-determined garbage collection calls? I'm recycling arrays to reduce how many I create and if I know when a pre-determined GC will occur, I can purge some if my pool gets too big. I currently do purge much in shipWillDockWithStation & shipWillEnterWitchspace on the assumption GC may happen but knowing actually when/if might be helpful.
http://www.aegidian.org/bb/viewtopic.ph ... 45#p259439


Top
   
 Post subject: Re: Scripting requests
PostPosted: Tue Oct 17, 2017 11:48 pm 
Offline
Competent
Competent

Joined: Fri Mar 17, 2017 1:49 am
Posts: 62
D'oh! Perfectly demonstrates the value of a wiki over BB. I must've scrolled past that a number of times, it's so small. Such a declarative and authoritative statement
should be writ large,
don't you think? :D

Anyway, it doesn't appear to matter if you use
  • shipWillDockWithStation or shipDockedWithStation
  • shipWillExitWitchspace or shipExitedWitchspace,
as they're invoked on consecutive lines in the code. The is no shipEnteredWitchspace, so all that remains is
  • shipWillLaunchFromStation or shipLaunchedFromStation
which would only concern station based oxp's (and really, how much garbage can they generate!)

Unless you can think of a problem, I suggest the wiki advise purges/freeing be done in the 'Will' events, to keep is simple & consistent.

_________________
"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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 816 posts ]  Go to page Previous 151 52 53 54 55

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 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