Jan. 18, 2018

Hello der,  Guest
Trader Name:
 | Home | Forum List | Active Threads | Search:
Page: of 1   
TWX Support > RFC(Request For Comments) for TWXProxy  
<< Thread >>

Joined: Apr 2005

posted: 02/28/2008 at 02:16 AM Post #1

From looking at the documentation for TWXProxy specifically the GetSector command I saw that there are numerous "semi-static" variables set when you call the GetSector command.  (i.e the SECTOR.WARP[1-6] variable is built in the source code.)
I propose to add another "semi-static" variable and call it SECTOR.PARM.
This is an idea for discussion we could eliminate some script calls such as GetSectorParameters if the code in the GetSector function could also build these "semi-static" variables.  Now it has been months since I have looked at the source code and I don't know if this is doable or not so please bear with me.  IIRC each and every time GetSector is called it builds these so-called "semi-static" variables so all we need to do is to expand on that by internally calling the GetSectorParameters and building our own SECTOR.PARM array. 

If we designed this correctly existing scripts that still use Get/SetSectorParameter would still work and scripts that are compiled would still work without change.  They would not know how to access these new variables so the work we have done would be wasted, but a new script could be written to take advantage of these new variables.

I am just a shade-tree programmer (cut my teeth on C and if you believe it APL but thankfully I have recovered from that) haven't had the time nor the patience to re-live my Delphi days but would be willing to assist anyone that would like to submit any code, ideas, bug fixes, suggestions for new features, or even an occasional gripe session. 

From what I remember from my last perusal of the source code the possible solution lies in wherever Xide decided to build the SECTOR.WARPS[1-6], SECTOR.SHIPS type of variables that scripters can use.

Considering my Internet connection is now once again flaky I had better post this before I lose everything.


Joined: Feb 2006

posted: 03/05/2008 at 01:51 PM Post #2

no one uses Getsector anymore. Its been replaced with Sector.figs.owner[$sector] sector.tradercount[$sector] and alike.
TWX Development Team

Joined: Mar 2005

posted: 03/06/2008 at 04:53 PM Post #3

Yes and No pacman... accessing a couple of sector-specific constants makes more sense than using getSector, but if you were accessing numerous sector-specific constants, then it's still faster to use getSector... though fewer scripters do that today.  I did make the sector/port-specific constants complete in 2.04, so that all getSector values are likewise available from a constant.

Maniac, the problem with doing that for sector parameters is that they are queried by name.  Before 2.04, you didn't even have a way to determine what sector parameters existed.  Now you have listSectorParameters which creates an array of the parameter names.  Perhaps SECTOR.PARAMETER.NAME[sector] & SECTOR.PARAMETER.VALUE[sector] would work.  That's actually a good idea, along with the count, as SECTOR.PARAMETERS[sector].

I see no reason not to implement that, though I would hate to implement the getSector equivalent, since it is sort of deprecated by consensus.

I am planning a new source release of TWX in the next 2 months... hopefully by late April.  So now is a good time to be bouncing ideas.


Haggle Blog-> http://jroller.com/page/ElderProphet
TWX Support >  RFC(Request For Comments) for TWXProxy
<< Thread >>
 | Home | Forum List | Active Threads | Search:
Page: of 1   

"why hello der matey! have a sit and buy me an ale, eh?" -- The Grimy Old Trader

The Grimy Trader is best viewed at 1024x768 resolution -- this page was generated in: 0.337 seconds.