Scripting requests

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Scripting requests

Post by another_commander »

I see what you mean. However, this would go beyond the scope of bug fixing. Double clicking on menu items in gui screens does not take in consideration the position of the cursor at the time of double click, it just activates the selected item and this is consistent throughout all screens. Try it in the load screens and you will see: Select a savegame, then move the mouse to some neutral position and double-click. It will load the selected game.

For now, I would just apply the fix to enable mouse control in mission screens with choices and consider changing the gamewide behaviour for double clicks to take into account the cursor coordinates after 1.76.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Scripting requests

Post by Svengali »

Muchas gracias a_c.-)
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 »

Very interesting. Down the road there could be control panels that one can use by clicking the mouse on a button or lever or screen. That could be useful and immersive. Post 1.76 is gonna rock. :)
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
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: Scripting requests

Post by Okti »

Can we have all properties for a ship that are defined in the shipdata.plist exposed to JS as read-only please?. After 1.76 ofcourse.
My OXP's
And Latest Mission Coyote's Run
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 »

Currently, the only way to 'label' an NPC as 'Alien' is to give it CLASS_THARGOID. However giving an NPC this SCAN_CLASS also gives it certain qualities that may not be wanted.
The Wiki wrote:
Oolite uses scan_class internally to determine the behaviour of some ships .... don't allocate CLASS_POLICE or CLASS_THARGOID to ships lightly!
This became a problem while authoring Xeptatl's Sword, as the game's internal behaviour was overriding an AI which we wrote (for a Thargoid vessel), but could be even more of a problem for anybody wanting to introduce non-Thargoid aliens to the Ooniverse.
Would it be possible (after MNSR) to also have a CLASS_ALIEN made available? This would allow the introduction of other aliens who would show as 'Alien' on the Targeting system, but would not be affected by any of the game's internal mechanisms.
Commander Smivs, the friendliest Gourd this side of Riedquat.
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 »

"the clearing of marked systems [is] the main reason I stuck in the ability to manually mark a system as a destination on the map so players can reinstate mission or contract destinations. It won't break a mission or contract if the system isn't marked on the map. Unfortunately there is no way in JS to check if a system is marked or not as it stands."

So...why not add a way for JS to check if a system is marked?
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 »

Making markSystem and unmarkSystem return true or false depending on whether the system is already marked or not would do the trick.
[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 »

Capt. Murphy wrote:
Making markSystem and unmarkSystem return true or false depending on whether the system is already marked or not would do the trick.
Even better - though presumably much harder for the devs to implement - would be to give each worldScript its own mark/unmark namespace (as they currently have for F5 mission texts) and mark a system if any worldScript is marking it.
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 »

Could we have read-only access in the Station object to its docking queue and launching queue, please? (Making the length of the two queues available as a shader uniform would be handy, too)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Scripting requests

Post by Thargoid »

A few thoughts now we're through MNSR:

  • A ship/world script event this.equipmentRepaired(equipment), working as a mirror to this.equipmentDamaged(equipment), triggered when things get fixed (go from "EQUIPMENT_DAMAGED" to "EQUIPMENT_OK" rather than the other way about).
  • A shipdata.plist key isPlayerWeapon or isSubWeapon or something similar - to make kills made by the entity be attributed to the player or mother entity that spawned it along with bounty, score (kill-score) and legal status adjustments if appropriate. Would ideally send shipDied of the victim the identity of the player or mother rather than itself. Purpose would be to allow the making by weaponry by OXP without the problems of breaking missions and having to mess around simulating bounty and kill awards etc. An extension of the idea of subMunition basically.
  • Making beacon code read/write rather than just read - so beacons can be added to existing ships without having to do a swap-over to a like_ship version with it set. So ships can be tagged and untagged on the fly.
  • An AI command performFollow - kinda like flyToRangeFromDestination but relating to a target and persistent until told to do otherwise. Ideally with some sort of spacing to allow for formation-flying (ad-hoc escort or group mode) with frustrated if not achieved in a given time period, plus the usual target lost etc if the target dies.
[/color]
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 »

Can a station's launch queue be made available as a property, preferably returning the to-be-launched ships in an array? Also, the current launch status, for instance, what, if anything, is preventing the station from launching whatever it was scripted to launch.

It's not so much useful for scripting, but would be very useful for debugging. For instance right now I am watching a station which was ordered by an NPC's AI (via safeScriptActionOnTarget: launchShipWithRole: ...) to launch a ship with a certain role. I am watching the scene for a couple of minutes now, all ships that had been waiting for docking have docked long ago, afterwards a random trader launched, but there is no trace of the ship I'm waiting for. And I don't know any way of debugging the situation and finding out what's happening.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Scripting requests

Post by Svengali »

Commander McLane wrote:
It's not so much useful for scripting, but would be very useful for debugging. For instance right now I am watching a station which was ordered by an NPC's AI (via safeScriptActionOnTarget: launchShipWithRole: ...) to launch a ship with a certain role. I am watching the scene for a couple of minutes now, all ships that had been waiting for docking have docked long ago, afterwards a random trader launched, but there is no trace of the ship I'm waiting for. And I don't know any way of debugging the situation and finding out what's happening.
When I was working on Localhero2 I've had a similiar situation. The missionship sometimes simply didn't launch even after minutes. So I had to find a solution. The trick was to place a fugitive nearby (a very weak pirate). This forced the station to react and after launching one or two police ships the missionship was launched too. Funny.
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: Scripting requests

Post by Eric Walch »

Commander McLane wrote:
. For instance right now I am watching a station which was ordered by an NPC's AI (via safeScriptActionOnTarget: launchShipWithRole: ...) to launch a ship with a certain role.
Yes, the launch queue is not accessible. Therefor I did al my tests with: this.testship = station.launchShipWithRole("myRole"). You than always have access to the ship by examining this.testship, even when still docked. And for mac-only you can use: this.testship = station.launchShipWithRole("myRole").inspect(). That will immediately open a target inspector for the ship. But, it needs JS, it will not work with your old legacy example.
Storm
Dangerous
Dangerous
Posts: 91
Joined: Mon Jan 30, 2012 10:27 pm
Location: UK

Re: Scripting requests

Post by Storm »

Could we have the ability to access the 'special subentities' flashers and exhausts as well please? for example something along the lines of this.ship.flashersCount, this.ship.flashers[x], this.ship.exhaustsCount, this.ship.exhausts[x] and ability to change their positions, size, color etc. accordingly. The ability to turn specific flashers (and maybe exhaust trails) on and off as well would be nice 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 »

Can we get a modification to system.info so that when we assign a texture, alter a description, change the sun's corona, etc. - we can pass a parameter that'll tell Oolite NOT to add the change to the save-game file? The default could be to still do so, so it maintains backwards compatibility, but I'd like to be able to tell it NOT to do this.

DH_Systems v1 is bad enough in that I bloat the save-game with the corona information for every system, but v2 was going to have to do it for a whole host more stuff. I don't want to be the cause of 20K lines of crap in someone's save-game. Please, tell me we can?
Post Reply