equipment_price_factor - accessible from JS?

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

equipment_price_factor - accessible from JS?

Post by Screet »

Hi,

I currently would like to access the key "equipment_price_factor" but searching the wiki I have not come up with any access methods.

Is there something or a workaround for it?

Screet
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

One of the more knowledgable I'm sure can give you a precise answer, but I believe it's set in the station's shipdata plist. Least, that's where I set it for one of my WiP OXP's and it worked.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Cmd. Cheyd wrote:
One of the more knowledgable I'm sure can give you a precise answer, but I believe it's set in the station's shipdata plist. Least, that's where I set it for one of my WiP OXP's and it worked.
Yes, it's in there - but how to access it from JS? I need to know how the current station does affect the equipment price...

Screet
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

To the best of my knowledge, there's no way of finding out the equipment price factor from javascript...

Nor there's a way to change equipment prices from javascript either.

One thing you might be able to do is to refund part of the price, if you think the player was charged too much, or charge more if they paid too little.

The way prices are calculated can be a bit tricky to get right, and looking at that part of the code is probably something we will do post for EMMSTRAN.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: equipment_price_factor - accessible from JS?

Post by Eric Walch »

Screet wrote:
Hi,

I currently would like to access the key "equipment_price_factor" but searching the wiki I have not come up with any access methods.

Is there something or a workaround for it?

Screet
McLane asked the same recently in scripting requests. It would be very easy to make it a read-only property of station when needed.

As a workaround you could store the price of a missile on startup and compare it with the local value. (I guess it should work as a workaround)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

The equipmentPriceFactor read-only property for stations is now accessible from JS.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

another_commander wrote:
The equipmentPriceFactor read-only property for stations is now accessible from JS.
Many thanks!!!

Screet
Post Reply