Page 39 of 56

Re: Scripting requests

Posted: Sun Apr 22, 2012 5:12 pm
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.

Re: Scripting requests

Posted: Sun Apr 22, 2012 5:28 pm
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: )

Re: Scripting requests

Posted: Sat Apr 28, 2012 10:36 am
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...

Re: Scripting requests

Posted: Thu May 03, 2012 6:48 pm
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?

Re: Scripting requests

Posted: Sat May 05, 2012 10:36 am
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

Re: Scripting requests

Posted: Sun May 06, 2012 10:43 am
by cim
Cmd. Cheyd wrote:
  • Ability to read player.ship pitch, roll, yaw values from JS
Added in r4910 (and for NPC ships too)

Re: Scripting requests

Posted: Sun May 06, 2012 4:33 pm
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?

Re: Scripting requests

Posted: Sun May 06, 2012 7:05 pm
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.

Re: Scripting requests

Posted: Thu May 10, 2012 9:25 pm
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.

Re: Scripting requests

Posted: Fri May 11, 2012 4:01 am
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.

Re: Scripting requests

Posted: Mon May 14, 2012 8:10 pm
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:

Re: Scripting requests

Posted: Mon May 14, 2012 11:31 pm
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.

Re: Scripting requests

Posted: Tue May 15, 2012 7:12 am
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.

Re: Scripting requests

Posted: Tue May 15, 2012 10:41 am
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.

Re: Scripting requests

Posted: Tue May 15, 2012 11:29 am
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?