Page 1 of 1

Equipment conditions scripts.

Posted: Wed Jan 22, 2014 2:57 am
by Nyarlatothep
I'm slightly uncomfortable with the way conditions scripts completely override the standard ones, and worried that in the future a custom OXP conditions.js might well not be testing all the (new) required conditions.

Adding an extra option to equipment.plist like "apply_standard_conditions" with values like "before_custom_script", "after_custom_script" and "do_not_apply" could improve the situation no end!

Hope this makes sense,

Rob.

Re: Equipment conditions scripts.

Posted: Wed Jan 22, 2014 5:24 pm
by cim
Overriding a built-in equipment entry is always slightly risky: it's not just the condition script that might change. The old Cloak Repair OXP (obsolete since 1.77 when its functionality made it into the core) is going to cause some issues for people who still have it installed when 1.80 comes out, for instance.

If there's particular OXP-initiated conditions people might find it useful to apply to standard equipment, then we can add those to the standard equipment's condition script, though.

Re: Equipment conditions scripts.

Posted: Wed Jan 22, 2014 5:47 pm
by Nyarlatothep
Ok, I was specifically thinking of the berth control thread (I'll get back to you with the link). If someone wants to use my tweak and to be both 1.77 & 1.79 compatible, with minimal disruption to installed OXPs, there needs to be an extra

Code: Select all

	// OXP hook to allow ships to forbid specific "available to all" equipment
	if (ship.scriptInfo["oolite-barred-equipment"] && ship.scriptInfo["oolite-barred-equipment"].indexOf(equipment) != -1)
	{
		return false;
	}
inside the custom conditions script, enabled for 1.79 and above, but disabled otherwise.

Re: Equipment conditions scripts.

Posted: Wed Jan 22, 2014 6:01 pm
by cim
It probably won't hurt to not disable that line for 1.77, in the OXP: you're just getting the new feature a little in advance for the equipment you modified.