availability of equipment depending on other equipment?

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

Moderators: winston, another_commander

Post Reply
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:

availability of equipment depending on other equipment?

Post by Commander McLane »

This has probably been asked and answered before, but I don't recall:

Is it possible in equipment.plist, to make the availability of one item dependent on whether the player has installed another item?

Usually an equipment.plist-entry looks like this:

Code: Select all

	<array>
		<integer>0</integer>                              //TechLevel
		<integer>2</integer>                              //price
		<string>Fuel</string>                             //name
		<string>EQ_FUEL</string>                          //identifier
		<string>Fuel for the witchspace engines.</string> //display text
		<dict>                                            //conditions
			<key>available_to_all</key>
			<true/>
		</dict>
	</array>
In the conditions-part there can be some other stuff as well, like

Code: Select all

			<key>portable_between_ships</key>
			<true/>
or

Code: Select all

			<key>requires_empty_pylon</key>
			<true/>
or

Code: Select all

			<key>requires_mounted_pylon</key>
			<true/>
or

Code: Select all

			<key>requires_cargo_space</key>
			<integer>5</integer>
or

Code: Select all

			<key>incompatible_with_equipment</key>
			<string>EQ_NAVAL_ENERGY_UNIT</string>
These are all examples taken from the built-in equipment.plist, because unfortunately there is no documentation in the wiki (a page about equipment.plist is still missing).

What I want to know is whether there is something like

Code: Select all

			<key>requires_equipment</key>
			<string>EQ_GAL_DRIVE</string>
and what the syntax would be (this one doesn't work; have tested it).

Thanks for any enlightenment!
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

It looks like the dreaded cut & paste bug struck again: at the moment if no 'incompatible_with_equipment' key is set, oolite fills 'incompatible_with_equipment' with what's inside 'requires_equipment'. Then it gets thoroughly confused.
Will fix the bug in trunk now, but there's a workaround for the released version: if you add these lines:

Code: Select all

 <key>incompatible_with_equipment</key>
 <string>EQ_DUMMY_EQUIPMENT</string>
requires_equimpent should start working as intended! :)

There's two more conditions: 'requires_clean' & 'requires_not_clean' that should make equipment available based on the player legal status...

Hope this helps! :D
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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 »

Thanks very much! :D

Also it's good to know that there are these two more keys I didn't know about.

One last request: Would you mind setting up a wiki-page about equipment.plist that contains all this information? It's one of three remaining plists without any documentation (the others being hud.plist and speech_pronunciation_guide.plist, see here).

EDIT: And by the way: It works perfectly! :D My extra equipment appears the very moment I have bought a Galactic Hyperdrive.
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

Cool - I might have to use this trick for dealing with the chaff refills in Missiles and Bombs. The use of legal status could be interesting - even after docking manually a player could be denied some essential supplies and be forced to pay over the odds for fuel and repairs.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Good to know the workaround works! :)
& yes, the legal status conditions do open up a few interesting possibilities. As I was looking at the code, I thought 'people should be told'! :)


I'll try and put a draft equipment.plist page on the wiki tonight, but no firm promises: haven't got tons of free time anymore... now, if I only manage to get sacked.... :mrgreen:
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply