Page 1 of 6

[Test RELEASE:] Interstellar Tweak OXP

Posted: Mon Dec 05, 2011 12:20 am
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.)

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Mon Dec 05, 2011 9:56 pm
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.

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Mon Dec 05, 2011 10:22 pm
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.

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Mon Dec 05, 2011 10:37 pm
by UK_Eliter
Hi Okti

Let me clarify. Yes: interstellar space. No: I don't want witchspace 'arrival' rings.

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Mon Dec 05, 2011 10:42 pm
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.

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Tue Dec 06, 2011 5:39 am
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...

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Tue Dec 06, 2011 6:08 pm
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.

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Tue Dec 06, 2011 6:57 pm
by Okti
Use the this.shipSpawned function in a world script, and check for escapepods and remove them as spammers :D

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Tue Dec 06, 2011 7:38 pm
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")

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Tue Dec 06, 2011 8:32 pm
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.

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Wed Dec 07, 2011 1:52 am
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?)

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Wed Dec 07, 2011 3:16 am
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?

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Wed Dec 07, 2011 5:20 am
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

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Wed Dec 07, 2011 2:26 pm
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

Re: [Test RELEASE:] Interstellar Tweak OXP

Posted: Wed Dec 07, 2011 3:09 pm
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).