Scripting requests

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: Scripting requests

Post by CommonSenseOTB »

Please make everything settable in the .plists and read/writeable in JS.

And if you have time, the perfect cup of tea as well.

Please and thankyou in advance and much appreciated.
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Scripting requests

Post by Capt. Murphy »

Capt. Murphy wrote:
Hi,

In preparation for future stable releases being in deployment build format, but with developer releases in test-release format could we add a property to the Oolite object - something along the lines of buildType - a string which is either "deployment", "test" or "snapshot". This would allow scripters to continue to utilise non deployment scripting features in OXPs like TAF and scripted screenshots, but automatically disable them if the OXP is running in a deployment context.

Edit to add - alternatively is the status of scriptable TAF/screenshots and availability in deployment builds an item open for discussion?
Thinking about this it would probably easier to have a property Oolite.isDeployment - set as true, with an override in between debug flags to set it as false? (He says pretending to know what he's talking about... :wink: )
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Scripting requests

Post by Lone_Wolf »

Make Laser temperature readable from JS .

from https://bb.oolite.space/viewtopic.php?f=6&t=11884 :
CommonSenseOTB wrote:
However I would like my oxp to be changed by the laser. Specifically, I would like to be able to read the JS of laser teperature so I can make custom gauges for HUDs that show the laser temperature. It's going to be really awkward to spend all the time and effort to make a hud with custom gauges that match and still be stuck with a stock bar gauge to show laser temperature. And when I start using images for gauges they really are going to be a mismatch to the stock laser temperature bar gauge.

Please help me devs...
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Phasted
Competent
Competent
Posts: 51
Joined: Wed Jun 09, 2010 3:56 pm

Re: Scripting requests

Post by Phasted »

cim wrote:
Phasted wrote:
An event-handler (well, two actually) that triggers when the player buys or sells cargo (passing commoditiy name, quantity, and price).
playerBoughtCargo(commodity,units,price) and playerSoldCargo(commodity,units,price) are available as of r4851.
Thank you, kindly.


While I'm at it...

Would it be possible to give each station entity its own market object (along the same lines as the player's manifest object), allowing the harried, overworked OXP-writer direct access to prices and quantities without the need to horse around with that @#&%$ commodities.plist?
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Scripting requests

Post by Capt. Murphy »

Can we consider making the recently added read only player.ship.serviceLevel read/write?

I can't see any problems with this. It's already possible via script in 1.76 to reset it upwards by manually awarding then removing EQ_RENOVATION, thus avoiding maintenance overhauls, so making it read/write wouldn't create a new 'exploit'. And being able to set it downwards would be a useful feature in a variety of contexts.

The main reason for asking is so that serviceLevel can be restored to a previous value if a stored player ship is restored using Ship_Storage_Helper.....https://bb.oolite.space/viewtopic.ph ... 15#p170242
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Scripting requests

Post by cim »

Cmd. Cheyd wrote:
  • Ability to read player.ship pitch, roll, yaw values from JS
Added in r4910 (and for NPC ships too)
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...

Re: Scripting requests

Post by Cmd. Cheyd »

Thanks cim!

Now, how about an older, and slightly more difficult request?

The ability to control relative volume of a SoundSource? A range of 0-100 as percentage? I know Ahruman was talking of overhauling the complete sound system and moving to OpenSound (think it was OS) and this was postponed based on that. I don't know if that's still on anyone's roadmap. Or if this could be accomplished without the overhaul?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Scripting requests

Post by cim »

Cmd. Cheyd wrote:
The ability to control relative volume of a SoundSource? A range of 0-100 as percentage? I know Ahruman was talking of overhauling the complete sound system and moving to OpenSound (think it was OS) and this was postponed based on that. I don't know if that's still on anyone's roadmap. Or if this could be accomplished without the overhaul?
I think the problem is that we currently have two different sound libraries (CoreAudio and SDL) in use, so any change would need to be made - in different ways - in both. I think I can see what's needed to make the SDL change, but I don't know about CoreAudio and couldn't test it even if I did. So I can see why it was postponed pending moving to a new sound library. I'd need to look at it a bit more to see if that was practical.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Scripting requests

Post by Thargoid »

Could either the is_submunition key be modified or a new key given which would allow proper OXP external weaponry? By this I mean that when they achieve a kill, both the bounty and kill-count increase is automatically passed onto the ship that spawned/fired them, and that when the kill happens the parameter passed to shipDied is the mother/spawner rather than the weapon?

Basically working the same way as a missile currently does, but to allow OXP weapons to work properly without risking missions etc by assigning the kill to the wrong entity.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Scripting requests

Post by Capt. Murphy »

cim wrote:
Cmd. Cheyd wrote:
The ability to control relative volume of a SoundSource? A range of 0-100 as percentage? I know Ahruman was talking of overhauling the complete sound system and moving to OpenSound (think it was OS) and this was postponed based on that. I don't know if that's still on anyone's roadmap. Or if this could be accomplished without the overhaul?
I think the problem is that we currently have two different sound libraries (CoreAudio and SDL) in use, so any change would need to be made - in different ways - in both. I think I can see what's needed to make the SDL change, but I don't know about CoreAudio and couldn't test it even if I did. So I can see why it was postponed pending moving to a new sound library. I'd need to look at it a bit more to see if that was practical.
In a similar vein, and possible a little more achievable could the contents of the customsounds.plist keys be made visible to JS and read/write so a script could temporarily switch sound files to either a dummy silent sound file, or null if the core game code can handle it.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Scripting requests

Post by Capt. Murphy »

Can we make the model parameter of mission.runScreen accept both a role string or a dataKey string as valid inputs? :wink:
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Scripting requests

Post by Switeck »

Can system.addships or system.addGroup accept defined ship names as well as roles?
I ask because ships like Anaconda and Boa lack specifically defining roles and adding a defining role to every ship in the game is annoying.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripting requests

Post by Smivs »

Hmmm, intersting. They did used to. The Anaconda used to have roles of "trader oolite_anaconda" and the others had similar, but in the current verion plist they seem to have lost the defining role.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Scripting requests

Post by Commander McLane »

Smivs wrote:
Hmmm, intersting. They did used to. The Anaconda used to have roles of "trader oolite_anaconda" and the others had similar, but in the current verion plist they seem to have lost the defining role.
The unique roles of the in-built ships have been removed somewhere around 1.73. I still haven't really understood why.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Scripting requests

Post by cim »

Capt. Murphy wrote:
Can we make the model parameter of mission.runScreen accept both a role string or a dataKey string as valid inputs? :wink:
So try to interpret it as a role, and if that fails try to interpret it as a shipdata key? (and the same for addShips, etc.)

Alternatively there could be separate parameters and functions in the same way that escort_role and escort_ship are separated. Which is less likely to be confusing?
Post Reply