Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

GRS buoyRepair.oxp

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

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 »

Commander McLane wrote:
So why should the Buoy Repair Services replace a blown-up station with a buoy?
Concerning galNavy, "S" is from the buoy before the station.

Screet
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post by pmw57 »

Ahruman wrote:
pmw57 wrote:
How do you feel about back-breaking labour-intensive hand-coded conversions instead?
I’m in favour of someone else doing them. ;-)

I may finish the converter, but for use as an offline tool. In most cases, though, the resulting code would still require a complete rewrite from the “tickle”-based approach to an event-driven one. Most types of events can’t be reliably extracted automatically. (The exceptions would be launch and entered-system checks, since these are guaranteed to only be evaluated once per relevant event.)
I invite then, people to examine a new wiki page, that is intended to provide information to help people create JavaScript scripts for shipdata.plist

http://wiki.alioth.net/index.php/Oolite ... ip_scripts

Feedback is extremely welcome.
Last edited by pmw57 on Fri Oct 09, 2009 1:22 pm, edited 1 time in total.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

A good beginning there. But there is a little room for expansion:

  • this.shipSpawnedAsEscort might also be worth mentioning.
  • this.shipDied also triggers when a ship is removed by script.
  • This is an ideal place to include a brief tutorial about linking such a ship script to the ships AI plist too (AI - sendScriptMessage: , js - this.ship.AIState, this.ship.reactToAIMessage). Advanced player stuff but a fair few examples around (some of mine and some of Erics for example, plus several others).
  • script_action is more than shipDockedWithStation and shipWasScooped, it can be any of the worldScript events. Certainly valid examples thereof, but people might take it as indicative of all that can be done.
  • The script is unique for that given ship (if you spawn two ships of that particular type, they will both run the same script but independent examples thereof).
  • It is possible to pass parameters from the shipdata.plist to the script (via the script_info key). Again advanced-player stuff but not so difficult.
[/color]
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post by pmw57 »

Thargoid wrote:
A good beginning there. But there is a little room for expansion:


May I suggest that you expand the contents of the page with more useful information.

I'm afraid that I don't know half of what you're talking about there, but if you'd be willing to put together some content about it, I would be capable of working it into a wiki-suitable notation for the page.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Certainly, you just asked for feedback here :)

I'll have a look at it when I get a bit of free time.
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post by pmw57 »

Thargoid wrote:
Certainly, you just asked for feedback here :)

I'll have a look at it when I get a bit of free time.
Thanks, I'll add your comments though to the discussion page http://wiki.alioth.net/index.php/Talk:O ... ip_scripts so that they don't get lost.
Last edited by pmw57 on Fri Oct 09, 2009 1:21 pm, edited 1 time in total.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
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:

Post by Commander McLane »

More comments:

I think the page title is wrong/misleading. What the page is obviously about is ship scripts. So that should be the title. Shipdata scripts don't exist; or they do exist, but are covered in the page http://wiki.alioth.net/index.php/Script ... n_shipdata and are different from ship scripts.

One of the differences gets visible in the very first sentence:
The shipdata.plist file can reference a JavaScipt script to perform behaviours that are executed on the creation or the disappearance of the ship.
That was true for the legacy scripts within shipdata, but covers not even a fraction of what ship scripts are good for. Next to creation (shipSpawned) and disappearance (shipDied), all event handlers marked as usable in ship scripts are, errmmm..., usable in ship scripts. :?

Which also means that the page you are setting up actually already exists. Its http://wiki.alioth.net/index.php/Oolite ... t_handlers and it contains hints on which of the event handlers work with ship scripts as well.

I notice you even have put this very information up on the page:
Any other world script events can be applied to the ship as well.
But again that's not entirely correct. Not any other world script events can be used in a ship script, but exactly those marked as usable in ship scripts. That's why they are marked as usable in ship scripts on the event handler page, i.e. it is explicitely written there that a certain handler can be used in ship scripts as well.
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post by pmw57 »

Commander McLane wrote:
I think the page title is wrong/misleading. What the page is obviously about is ship scripts. So that should be the title.
Good idea, it has been made so. http://wiki.alioth.net/index.php/Oolite ... ip_scripts
Commander McLane wrote:
Not any other world script events can be used in a ship script, but exactly those marked as usable in ship scripts. That's why they are marked as usable in ship scripts on the event handler page, i.e. it is explicitely written there that a certain handler can be used in ship scripts as well.
Thanks. With that "Any world scripts, " I'll added the letter M to change Any into MAnyMany :wink:
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post by pmw57 »

Commander McLane wrote:
The shipdata.plist file can reference a JavaScipt script to perform behaviours that are executed on the creation or the disappearance of the ship.
That was true for the legacy scripts within shipdata, but covers not even a fraction of what ship scripts are good for.
This sounds like a good opportunity to expand on the page. My intention is for the page to be some kind of guide for people who want to move away from plists, to using JavaScript instead.

If we can let them know about other things they can also make good use of the scripts for, then all the better.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
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:

Post by Commander McLane »

pmw57 wrote:
My intention is for the page to be some kind of guide for people who want to move away from plists, to using JavaScript instead.
If you allow me the remark, the subject you chose (ship scripts) sounds a bit odd for this purpose. Ship scripts never existed in legacy (plist scripting), so there is no "instead" in this case. They are a completely new opportunity opened by changing the scripting engine to JS.

If you, however, want something with a before—after effect, you should make a guide for world scripts instead.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

pmw57 wrote:
Commander McLane wrote:
That was true for the legacy scripts within shipdata, but covers not even a fraction of what ship scripts are good for.
This sounds like a good opportunity to expand on the page. My intention is for the page to be some kind of guide for people who want to move away from plists, to using JavaScript instead.

If we can let them know about other things they can also make good use of the scripts for, then all the better.
A lot of the old stuff on the wiki has to be rewritten. It was written with the only focus on legacy (there was no JS at that time). A large part is still better explained in the Legacy version. This encourages people to use the old method. It should be the other way round. Main examples in JS and legacy examples how it used to be so scripters still can understand the old scripts. And that page I once wrote and your new page are a good example of before and after. It now should really start with focus on JS.

One thing that also should be clear is that both script types within a ship definition are never used simultaneously. If a ship contains a JS script, the old scripts are ignored. When converting ships to JS I often leave the old stuff in, so it stays possible to use that ship with Oolite 1.65. That Oolite version than keeps using the old scripts. When not knowing this, the presence of both scripts can confuse people.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

v1.02.6 is online.

Changes:
- Fixes for ATI cards (big thanks to Zieman!)
- Cleanup
- v1.74'ish shipdata
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Post by JazHaz »

Svengali wrote:
v1.02.6 is online.

Changes:
- Fixes for ATI cards (big thanks to Zieman!)
- Cleanup
- v1.74'ish shipdata
Thanks! Does the last feature still need work doing though?
JazHaz

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

JazHaz wrote:
Thanks! Does the last feature still need work doing though?
There's always work left. Things are changing, time passes by and Oolite itself offers new features/ways. Here it is the subentity declaration in shipdata.plist (introduced in v1.73) plus a major cleanup resulting in a lot smaller filesize (496KB -> 450KB).

But I've forgotten one thing - we wanted to change the Armadillo a bit. Argh. Not this time then.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: GRS buoyRepair.oxp

Post by Svengali »

v1.02.7 is online.

Changes:
- Script/AI tweaks for Oolite v1.75, but still works in v1.74.2
- Armadillo a bit more scaled
- Cleanup, etc...
Post Reply