[Test RELEASE:] Interstellar Tweak OXP

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

Moderators: winston, another_commander

UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

[Test RELEASE:] Interstellar Tweak OXP

Post by UK_Eliter »

This OXP creates a chance that misjumps will leave you in unpopulated areas of witchspace. See the README within the file for a bit more info.

I've put the OXP under the 'work in progress' part of the OXP wiki. Feedback welcome!


EDIT: I've just come across the Borg OXP. Perhaps we could make it possible to encounter the Borg in witchspace. (Or, is that already possible with that OXP?) In fact, I'd like to make it possible that one encounters only a Borg cube in witchspace (i.e. when it shows up, it shows up alone.)
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by UK_Eliter »

I'd like to ask for some help.

I want to create derelict ships. At present I do it thus:

Code: Select all

this.derelictShip = system.addShips("trader", 1, player.ship.position, this.derelictRange);
this.derelictShip[0].fuel = 0;
this.derelictShip[0].switchAI("interstellarTweak_nullAI.plist");
- where the AI is one that sets the speed to zero and, otherwise, does nowt. Problem is, the ships still launch escape pods (sometimes) and don't show up as white on the scanner. But the ship attributes which would change those things (if those attributes were changed) are read-only. Do I have to go to the lengths of the Special Interstellar Repairs Facility OXP, or crib its (extensive shipdata.plist) code, to fix this? All advice appreciated (either on here or by PM). Thanks.

EDIT: I'm doing this in interstellar space. And I don't want witchspace 'arrival' rings.
Last edited by UK_Eliter on Mon Dec 05, 2011 10:36 pm, edited 1 time in total.
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: [Test RELEASE:] Interstellar Tweak OXP

Post by Okti »

There are couple of problems, If you change the ships position at shipWillExitWitchspace, you won't get witchspace exit thingie shown.

And derelict ships in interstellar space you mean?

I don't think Borg Oxp is at a playable state atm.
My OXP's
And Latest Mission Coyote's Run
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by UK_Eliter »

Hi Okti

Let me clarify. Yes: interstellar space. No: I don't want witchspace 'arrival' rings.
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: [Test RELEASE:] Interstellar Tweak OXP

Post by Okti »

Then you must use a clever AI and combinatıon of a script to make them derelict, and make sure you get rid of the escape pods as well. But I am not sure if the commands to do that will work at interstellar space, may be a good thing to try for you. And keep us posted please.
My OXP's
And Latest Mission Coyote's Run
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by Capt. Murphy »

Hi,

It's not documented properly in the wiki (it's mentioned in the JS reference but not in shipdata.plist), but I'm sure (if I'm reading the source code right) that is_hulk = true; is a valid shipdata.plist key. So you could make a shipdata.plist that like_ship to the models you want to use, but give them a role of "UKE_derelict" and set is_hulk = true in the shipdata. The limitation being that you are limiting the derelicts to those models you include an entry for.

For the core ships if you are clever with is_external_dependency and role probabilities you can ensure both the Griff models and the standard/reskinned variety are spawned correctly depending on what the player has installed (high probability for the Griff models, very low probability for the standard/reskinned variety).

The other alternative is as Okti says. Spawn them as standard traders, given them an abandonShip() command via JS and then the new pods give a remove(true) command via JS. If they haven't got pods, abandonShip() will return false and you'll have to detect that and manually change the AI, and set custom scanner colours with JS. If they have got pods the abandonShip() command will return true and also automatically set the SCAN_CLASS and AI appropriately.

this.shipSpawned will be a useful handler to do this work under. The initial spawning do under this.shipWillExitWitchSpace handler so it all happens before the player has exited the witchspace tunnels.

Shout if you need a hand implementing either of these options.

Edit to add - it might be a nice feature to have the derelicts leak fuel that can be scooped (maybe when they are shot?) Shouldn't be difficult to script...
[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
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by UK_Eliter »

Okti, Murphy

Thank you both - very helpful. However, the 'is_hulk' doesn't seek to work. So I've gone for the other method. And its working, except I don't know how to remove an escape pod. How do I get the handler - the reference - for the pod? I.e. how to I get a ship variable that I call call the 'remove' command on? Do I have to do a search for an escape pod in the vicinity, and then remove any result from that? Cheers.
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: [Test RELEASE:] Interstellar Tweak OXP

Post by Okti »

Use the this.shipSpawned function in a world script, and check for escapepods and remove them as spammers :D
My OXP's
And Latest Mission Coyote's Run
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by cim »

UK_Eliter wrote:
Okti, Murphy

Thank you both - very helpful. However, the 'is_hulk' doesn't seek to work. So I've gone for the other method. And its working, except I don't know how to remove an escape pod. How do I get the handler - the reference - for the pod? I.e. how to I get a ship variable that I call call the 'remove' command on? Do I have to do a search for an escape pod in the vicinity, and then remove any result from that? Cheers.
The shipLaunchedEscapePod handler (ship scripts) gives a reference to the escape pod.

So, have a ship script that contains

Code: Select all

this.shipLaunchedEscapePod = function (escapepod) {
  escapepod.remove(true);
}
Before you call ship.abandonShip() call ship.setScript("removeescapepod.js")
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by Capt. Murphy »

You can also do it from a worldscript with

Code: Select all

this.shipSpawned = function (ship)
{
if (system.isInterstellarSpace && ship.primaryRole === "escape-capsule")
{ship.remove(true);}
}
You might also want to include a check for ship.owner in the function to check that only escape pods launched by your derelicts are removed.

Ooops didn't see Okti's post above.
[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
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by UK_Eliter »

Excellent tips. I've made progress - in what I was trying to do and in some extra (but rarely-to-be-encountered scenarios). I've uploaded a new version to the existing URL.

However, my 'trapDerelict' routine, which means to create a derelict ship and then drop a load of Thargoids in, seems not to be working. Also, the Fuel Collector (from the OXP) doesn't work on my derelicts. (It doesn't even give a 'no fuel in tank' message.) I'll have to look at how that OXP works. [EDIT.]
Finally: it's a shame the 'is_hulk' key doesn't work. (Or perhaps I was just using it wrongly?)
Last edited by UK_Eliter on Wed Dec 07, 2011 2:23 pm, edited 1 time in total.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by Wildeblood »

UK_Eliter wrote:
I've uploaded a new version to the existing URL.
But you removed the pre-existing URL from the OP?
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by Capt. Murphy »

UK_Eliter wrote:

Finally: it's a shame the 'is_hulk' key doesn't work. (Or perhaps I was just using it wrongly?)
is_hulk is valid, but on it's own all is seems to do is report back that ship.isDerelict is true from JS. If you set other shipdata keys as appropriate (ai_type = "nullAI.plist"; scan_class = "CLASS_CARGO", "unpiloted" = yes; as a minimum) it should spawn as a proper derelict. You can also override the sub-entity flashers in shipdata.

re FuelCollector - it looks like it checks for standard roles and the standard nullAI.plist in the derelicts which is why it doesn't work as it stands. You can always change primaryRole via script after spawning, and I see no reason that you can't use the standard nullAI.plist
[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
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by UK_Eliter »

Wildeblood wrote:
UK_Eliter wrote:
I've uploaded a new version to the existing URL.
But you removed the pre-existing URL from the OP?
Oops. But you can get the OXP from the wiki - or directly from here: http://www.box.com/shared/moreq536ht
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [Test RELEASE:] Interstellar Tweak OXP

Post by UK_Eliter »

Capt. Murphy wrote:
UK_Eliter wrote:

Finally: it's a shame the 'is_hulk' key doesn't work. (Or perhaps I was just using it wrongly?)
is_hulk is valid, but on it's own all is seems to do is report back that ship.isDerelict is true from JS. If you set other shipdata keys as appropriate (ai_type = "nullAI.plist"; scan_class = "CLASS_CARGO", "unpiloted" = yes; as a minimum) it should spawn as a proper derelict. You can also override the sub-entity flashers in shipdata.
Doing it that way avoids some complications. Done! (By the way Murphy: I've pm-ed you about the Escape Pod Locator OXP. But this new way of doing my hulks means that I no longer have to spawn and then delete an escape pod. .)

As to the Fuel collector, I'll look into that (and I've already modified my version of that OXP to make it work with this new one).
Post Reply