various equipment questions
Moderators: winston, another_commander
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
various equipment questions
NPC-only equipment has traditionally been given a TL of 99 in the equipment.plist. Now that TL99 is deprecated and a condition_script is used to prevent these becoming available to players, what TL should we state in the equipment.plist?
Last edited by Smivs on Thu Mar 12, 2015 6:34 pm, edited 1 time in total.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: TL for NPC-only equipment
I haven't got the slightest what's the "correct" way, but I'm using TL0 and thisSmivs wrote:NPC-only equipment has traditionally been given a TL of 99 in the equipment.plist. Now that TL99 is deprecated and a condition_script is used to prevent these becoming available to players, what TL should we state in the equipment.plist?
Code: Select all
this.allowAwardEquipment = function(eqKey, ship, context) {
//only allow via scripting
if (context === "scripted") return true;
return false;
}
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: TL for NPC-only equipment
Same here hence the question.spara wrote:I haven't got the slightest what's the "correct" way...
I'm currently looking at Aliens and want to update the 'Photon Torpedo' which is a special Scorpax weapon which is not available to anybody else.
The equipment.plist is
Code: Select all
(
(
99,
1,
"Photon Torpedo",
"EQ_PHOTONTORP_MISSILE",
"Scorpax photon missile",
{
condition_script = "oolite-conditions.js";
available_to_all = false;
}
)
)
Code: Select all
script_info = {"oolite-barred-equipment" = "EQ_PHOTONTORP_MISSILE"};
It works fine with no log errors in 1.81, but I did wonder about that TL, just out of interest really.
Commander Smivs, the friendliest Gourd this side of Riedquat.
-
- Competent
- Posts: 58
- Joined: Mon Mar 02, 2015 2:08 pm
- Location: drifting in remLock mask near Vezadi Station
Re: TL for NPC-only equipment
Sorry if I've read this (or the documentation) wrong, but isn't there an 'available_to_player' key which you can set 'false' or 'no' in equipment.plist?
I do use and quite like Aliens OXP, btw.
I do use and quite like Aliens OXP, btw.
Re: TL for NPC-only equipment
Sure, but there are cases were finer control is needed. You for example want some mission related equipment to be added to NPC ships only from javascript or you want an NPC equipment to be available only to certain NPC ships.Ngalo wrote:Sorry if I've read this (or the documentation) wrong, but isn't there an 'available_to_player' key which you can set 'false' or 'no' in equipment.plist?
Thinking about the context, it's probably just a placeholder.Smivs wrote:...but I did wonder about that TL, just out of interest really.
My money's on the placeholder .
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: TL for NPC-only equipment
Hi NgaloNgalo wrote:Sorry if I've read this (or the documentation) wrong, but isn't there an 'available_to_player' key which you can set 'false' or 'no' in equipment.plist?
I do use and quite like Aliens OXP, btw.
Yes, it's 'available_to_all' and it is set to false (see above). This whole area is a bit confusing because there are several ways to approach it, and most seem to work.
I'm glad you like the OXP - have you been photon torpedoed yet? They are a bit lethal (as they were developed by the Scorpax as anti-Thargoid weapons) which is why I didn't think they should be on general sale
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: TL for NPC-only equipment
This is quite interesting. One would assume that it prevents "EQ_PHOTONTORP_MISSILE" from the missile itself.Smivs wrote:...and I havein the missile's shipdata.Code: Select all
script_info = {"oolite-barred-equipment" = "EQ_PHOTONTORP_MISSILE"};
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: TL for NPC-only equipment
Again, I'm assuming this is right - it certainly works, but could be redundant. I think 'oolite_barred_equipment' only prevents player access, but clarification would be nice. The Scorpax has these specified in its shipdata
and certainly has them in-game.
Code: Select all
missile_role = "EQ_PHOTONTORP_MISSILE";
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: TL for NPC-only equipment
Yup. I've been reading the equipment.plist page for about million times and still have some trouble grasping it. "Available_to_all" seems to mean "this item can be installed on all ships". So setting it to "no" effectively removes the equipment from shop. I assume that "available_to_NPCs" means that the equipment can be added by the game to NPC ships. So setting that to "no" would stop that. On the other hand, does "available_to_all" already bar it from all ships? After that the only way to add the equipment to a ship would be via script or missile_role assuming of course that my assumptions are correct. Correct, I'm confused with these .Smivs wrote:Again, I'm assuming this is right - it certainly works, but could be redundant. I think 'oolite_barred_equipment' only prevents player access, but clarification would be nice. The Scorpax has these specified in its shipdataand certainly has them in-game.Code: Select all
missile_role = "EQ_PHOTONTORP_MISSILE";
Re: TL for NPC-only equipment
So, a few separate issues here:
While you can stick
TL for NPC equipment is irrelevant in the core game; set it to some reasonable value just in case some OXP is introduced which has persistent NPCs, tracks their equipment purchasing, and supports OXP equipment. TL:99 is an old magic value which allowed the TL to be changed by script (including legacy scripts) - it was never particularly appropriate for items which should never be player-accessible, for which 100 or 98 (or one of the many more specific properties) is better.
available_to_all = false;
means that the equipment can only be fitted to player ships which have the item in either the Standard or Optional Equipment section of their shipyard.plist
definition. Unlikely, for a random piece of OXP equipment, but not impossible. This is what's actually doing the purchase blocking in this case. (Generally I wouldn't recommend using this on OXP equipment unless you want to tie it to a playable ship in the same OXP). Exactly when this is applied to the player ship has varied between Oolite versions [1] ... you should assume that it always applies and situations where it doesn't are bugs to be reported, I think.available_to_player = false;
means that the equipment can't be fitted to a player ship. If you don't want to use a condition script, Ngalo is right that this is the correct property.script_info = {"oolite-barred-equipment" = "EQ_PHOTONTORP_MISSILE"};
when combined with oolite-conditions.js
as the condition script means that the equipment can't be fitted to the ship with that script_info
in its shipdata.plist
, and works on player and NPC ships. In this case, this means that the missile can't mount copies of itself on its pylons as additional ammunition, which will no doubt relieve anyone it's fired at. While you can stick
oolite-conditions.js
on OXP equipment (and perhaps you may as well if you don't need any other condition support), obviously the chance of any core or OXP ship specifically barring it is very low - you're probably better off giving the item its own OXP-specific condition script. In general, condition scripts are the solution to the problem of there being lots of equipment availability properties with overlapping and unclear effects, and in this case a custom one could be used to ensure that not only could the player not fit it, but neither could any non-Scorpax NPC.TL for NPC equipment is irrelevant in the core game; set it to some reasonable value just in case some OXP is introduced which has persistent NPCs, tracks their equipment purchasing, and supports OXP equipment. TL:99 is an old magic value which allowed the TL to be changed by script (including legacy scripts) - it was never particularly appropriate for items which should never be player-accessible, for which 100 or 98 (or one of the many more specific properties) is better.
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: TL for NPC-only equipment
Thanks cim. That's certainly clarified things a bit.
From what you've said, it seems I certainly covered all the bases, but somewhat redundantly. 'available_to_player = false;' sounds like what I really want for this, so I can go tidy things up now.
From what you've said, it seems I certainly covered all the bases, but somewhat redundantly. 'available_to_player = false;' sounds like what I really want for this, so I can go tidy things up now.
Commander Smivs, the friendliest Gourd this side of Riedquat.
-
- Competent
- Posts: 58
- Joined: Mon Mar 02, 2015 2:08 pm
- Location: drifting in remLock mask near Vezadi Station
Re: TL for NPC-only equipment
Haven't been hit by one yet. But I have outrun one on injectors. Didn't fancy going back to finish off the Scorpax though.smivs wrote:I'm glad you like the OXP - have you been photon torpedoed yet?
Re: TL for NPC-only equipment
One more question. How dominant these settings are in relation to adding equipment with awardEquipment or missile_role?
Re: TL for NPC-only equipment
They should override those, too (condition scripts have a mechanism to say in which situations they apply; the rest should be universal)
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: various equipment questions
Back again with another question (and a change of title for this thread as I suspect this won't be the last one).
"installation_time" and "repair_time" are now writable (in 1.81) but how do they work? I notice in another post that they are measured in seconds, but I have a piece of equipment that requires a zero installation time - I've moved on to looking at the Tea Maker, and this concerns the refills, which shouldn't take 11 minutes and 40 seconds to install - that's seems silly to me
Back to the point, havingin the equipment.pist doesn't do anything. Is there not a zero-option or have I mis-understood something?
"installation_time" and "repair_time" are now writable (in 1.81) but how do they work? I notice in another post that they are measured in seconds, but I have a piece of equipment that requires a zero installation time - I've moved on to looking at the Tea Maker, and this concerns the refills, which shouldn't take 11 minutes and 40 seconds to install - that's seems silly to me
Back to the point, having
Code: Select all
"installation_time" = 0;
Commander Smivs, the friendliest Gourd this side of Riedquat.