Page 1 of 3

equipment.plist question

Posted: Thu Feb 18, 2010 11:42 am
by ADCK
Am adding two custom missiles with my behemoths oxp, I can't figure out how to write the plist properly, can get one to work on its own, but not two.

I can't figure out how to do it in openstep, but would the following in XML work?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<array>
		<string>100</string>
		<string>100000</string>
		<string>Thargoid Invader</string>
		<string>adck_thargoid-invader</string>
		<string>You can't read this.</string>
	</array>
	<array>
		<string>100</string>
		<string>100000</string>
		<string>Destroyer Missile</string>
		<string>adck_destroyer-missile</string>
		<string>You can't read this.</string>
	</array>
</array>
</plist>

Posted: Thu Feb 18, 2010 6:32 pm
by Cmdr Wyvern
The syntax is all wrong. Here's a remix with fixed syntax.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
   <array>
      <integer>100</integer>
      <integer>100000</integer>
      <string>Thargoid Invader</string>
      <string>EQ_ADCK_THARGOID_INVADER</string>
      <string>WTF is this? We don't know either, but it sure scares the Bugs. (Renders them feeling terribly uncomfortable and/or inadequate.)</string>
	<dict>
		<key>requires_empty_pylon</key>
		<true/>
		<key>available_to_all</key>
		<true/>
	</dict>
   </array>
   <array>
      <integer>100</integer>
      <integer>100000</integer>
      <string>Destroyer Missile</string>
      <string>EQ_ADCK_DESTROYER_MISSILE</string>
      <string>It does what it says on the tin. Boom, baby, boom!</string>
	<dict>
		<key>requires_empty_pylon</key>
		<true/>
		<key>available_to_all</key>
		<true/>
	</dict>
   </array> 
</array>
</plist>
Forgive the sillyness in the description lines. :P :lol:

Posted: Thu Feb 18, 2010 6:34 pm
by Svengali
http://wiki.alioth.net/index.php/Equipment.plist will help a lot .-)

About OpenStep. Most oxps with Equipment declarations are in XML, but Hyperradio is (like my other oxps too) using OpenStep for all used plists.

Posted: Thu Feb 18, 2010 8:15 pm
by Commander McLane
What will also help a lot is not writing the plist from scratch, but c&p Oolite's built-in plist. Then delete all entries except one or two and edit these entries. Then you're at least sure that your new plist doesn't miss essential features.

Posted: Fri Feb 19, 2010 2:29 am
by ADCK
Cmdr Wyvern wrote:
The syntax is all wrong. Here's a remix with fixed syntax.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
   <array>
      <integer>100</integer>
      <integer>100000</integer>
      <string>Thargoid Invader</string>
      <string>EQ_ADCK_THARGOID_INVADER</string>
      <string>WTF is this? We don't know either, but it sure scares the Bugs. (Renders them feeling terribly uncomfortable and/or inadequate.)</string>
	<dict>
		<key>requires_empty_pylon</key>
		<true/>
		<key>available_to_all</key>
		<true/>
	</dict>
   </array>
   <array>
      <integer>100</integer>
      <integer>100000</integer>
      <string>Destroyer Missile</string>
      <string>EQ_ADCK_DESTROYER_MISSILE</string>
      <string>It does what it says on the tin. Boom, baby, boom!</string>
	<dict>
		<key>requires_empty_pylon</key>
		<true/>
		<key>available_to_all</key>
		<true/>
	</dict>
   </array> 
</array>
</plist>
Forgive the sillyness in the description lines. :P :lol:
Thanks, but isn't having "available to all" kind of redundant if you need a tech level of 100 to buy? :P
Oh and the thargoid invader isn't like that, its what a massive thargoid carrier fires, it fires thargoid warships. (and if possible, i'd like the warships to fire thargons)
So you bassicaly get an instant thargoid army, the carrier fires of its 8 thargoid missiles, which in turn fire off their 5 thargons, so one ship ends up being 1 carrier, 8 warships and 40 thargons :P

Posted: Fri Feb 19, 2010 3:10 am
by ADCK
New problem, slightly related.

The Destroyer missiles work fine, however:

[ship.setUp.missiles]: ----- WARNING: problems initialising missiles for ship 'Thargoid Warship Carrier', please verify missile_role definition.

comes up in the log, thats the ship that fires the thargoid invaders, I can't figure out why it isn't working, so i'll post teh releveant shipdata.plist entries:
Missile:

Code: Select all

	<key>EQ_ADCK_THARGOID_INVADER</key>
	<dict>
		<key>aft_weapon_type</key>
		<string>WEAPON_THARGOID_LASER</string>
		<key>ai_type</key>
		<string>thargletAI.plist</string>
		<key>bounty</key>
		<string>50</string>
		<key>cargo_type</key>
		<string>CARGO_NOT_CARGO</string>
		<key>energy_recharge_rate</key>
		<real>4</real>
		<key>forward_weapon_type</key>
		<string>WEAPON_THARGOID_LASER</string>
		<key>laser_color</key>
		<string>greenColor</string>
		<key>max_energy</key>
		<real>600</real>
		<key>max_flight_pitch</key>
		<real>1</real>
		<key>max_flight_roll</key>
		<real>2</real>
		<key>max_flight_speed</key>
		<real>500</real>
		<key>missiles</key>
		<string>0</string>
		<key>model</key>
		<string>adck_thar3.dat</string>
		<key>name</key>
		<string>Thargoid Invader</string>
		<key>roles</key>
		<string>EQ_ADCK_THARGOID_INVADER</string>
		<key>scanClass</key>
		<string>CLASS_THARGOID</string>
		<key>scanner_range</key>
		<real>50000</real>
		<key>shaders</key>
		<dict>
			<key>adck_thargoid_3.png</key>
			<dict>
				<key>fragment_shader</key>
				<string>adck-bhm.fs</string>
				<key>textures</key>
				<array>
					<string>adck_thargoid_3.png</string>
					<string>adck_thargoid_3_e.png</string>
					<string>adck_thargoid_3_n.png</string>
				</array>
				<key>uniforms</key>
				<dict>
					<key>SpecularRGB</key>
					<dict>
						<key>type</key>
						<string>vector</string>
						<key>value</key>
						<string>1.0 0.7 0.5 1.0</string>
					</dict>
					<key>uColourMap</key>
					<dict>
						<key>type</key>
						<string>texture</string>
						<key>value</key>
						<string>0</string>
					</dict>
					<key>uEngineLevel</key>
					<string>speedFactor</string>
					<key>uFXMap</key>
					<dict>
						<key>type</key>
						<string>texture</string>
						<key>value</key>
						<string>1</string>
					</dict>
					<key>uHullHeatLevel</key>
					<string>hullHeatLevel</string>
					<key>uNormalMap</key>
					<dict>
						<key>type</key>
						<string>texture</string>
						<key>value</key>
						<string>2</string>
					</dict>
					<key>uTime</key>
					<string>universalTime</string>
				</dict>
				<key>vertex_shader</key>
				<string>adck-bhm.vs</string>
			</dict>
		</dict>
		<key>thrust</key>
		<real>50</real>
		<key>unpiloted</key>
		<string>yes</string>
	</dict>
Carrier:

Code: Select all

	<key>adck_thargoid-carrier2</key>
	<dict>
		<key>aft_weapon_type</key>
		<string>WEAPON_THARGOID_LASER</string>
		<key>ai_type</key>
		<string>tcarrierAI.plist</string>
		<key>bounty</key>
		<integer>500</integer>
		<key>cargo_type</key>
		<string>CARGO_NOT_CARGO</string>
		<key>death_actions</key>
		<array>
			<string>commsMessage: [thargoid_curses]</string>
		</array>
		<key>energy_recharge_rate</key>
		<real>100</real>
		<key>forward_weapon_type</key>
		<string>WEAPON_THARGOID_LASER</string>
		<key>has_ecm</key>
		<true/>
		<key>laser_color</key>
		<string>greenColor</string>
		<key>likely_cargo</key>
		<integer>5</integer>
		<key>max_cargo</key>
		<integer>10</integer>
		<key>max_energy</key>
		<real>25000</real>
		<key>max_flight_pitch</key>
		<real>0.050000000000000003</real>
		<key>max_flight_roll</key>
		<real>0.050000000000000003</real>
		<key>max_flight_speed</key>
		<real>280</real>
		<key>max_missiles</key>
		<integer>8</integer>
		<key>missile_launch_position</key>
		<string>0.0 -44.132601 380.560931</string>
		<key>missile_role</key>
		<string>EQ_ADCK_THARGOID_INVADER</string>
		<key>missiles</key>
		<integer>8</integer>
		<key>model</key>
		<string>adck_thar_car.dat</string>
		<key>name</key>
		<string>Thargoid Warship Carrier</string>
		<key>roles</key>
		<string>thargoid-mothership thargoid_carrier</string>
		<key>scanClass</key>
		<string>CLASS_THARGOID</string>
		<key>shaders</key>
		<dict>
			<key>adck_thar_car.png</key>
			<dict>
				<key>fragment_shader</key>
				<string>neolite-std.fs</string>
				<key>textures</key>
				<array>
					<string>adck_thar_car.png</string>
					<string>adck_thar_car_e.png</string>
					<string>adck_thar_car_n.png</string>
				</array>
				<key>uniforms</key>
				<dict>
					<key>SpecularRGB</key>
					<dict>
						<key>type</key>
						<string>vector</string>
						<key>value</key>
						<string>0.5 1.0 0.0 1.0</string>
					</dict>
					<key>uColourMap</key>
					<dict>
						<key>type</key>
						<string>texture</string>
						<key>value</key>
						<string>0</string>
					</dict>
					<key>uEngineLevel</key>
					<string>speedFactor</string>
					<key>uFXMap</key>
					<dict>
						<key>type</key>
						<string>texture</string>
						<key>value</key>
						<string>1</string>
					</dict>
					<key>uHullHeatLevel</key>
					<string>hullHeatLevel</string>
					<key>uNormalMap</key>
					<dict>
						<key>type</key>
						<string>texture</string>
						<key>value</key>
						<string>2</string>
					</dict>
					<key>uTime</key>
					<string>universalTime</string>
				</dict>
				<key>vertex_shader</key>
				<string>neolite-std.vs</string>
			</dict>
		</dict>
		<key>thrust</key>
		<real>2</real>
		<key>weapon_energy</key>
		<real>25</real>
	</dict>
Can anyone see what i'm doing wrong?

..

Posted: Fri Feb 19, 2010 4:28 am
by Lestradae
I am getting this ...
ADCK wrote:
[ship.setUp.missiles]: ----- WARNING: problems initialising missiles for ship 'XXX', please verify missile_role definition.
... in my log, too.

You are running the "1.74" trunk, aren't you? I am only getting this message in the trunk game.

Is "missile_role definition" getting deprecated, can someone perhaps clarify?

Re: ..

Posted: Fri Feb 19, 2010 5:45 am
by ADCK
Lestradae wrote:
I am getting this ...
ADCK wrote:
[ship.setUp.missiles]: ----- WARNING: problems initialising missiles for ship 'XXX', please verify missile_role definition.
... in my log, too.

You are running the "1.74" trunk, aren't you? I am only getting this message in the trunk game.

Is "missile_role definition" getting deprecated, can someone perhaps clarify?
Hmm, but thats weird since my custom destroyer missile isn't getting that warning., the only diff that i can think of is that the thargoid one is more like a thargon than a missile.

Re: ..

Posted: Fri Feb 19, 2010 9:11 am
by Eric Walch
ADCK wrote:
Is "missile_role definition" getting deprecated, can someone perhaps clarify?
In trunk, the missiles are generated on ship creations rather than when it is fired. This forces missiles to be set up as proper equipment now. The new programming rules are not written down yet, but I think all the equipment defined as missile_role must end on: MISSILE, MINE or thargon to be validated as equipment. Look in my latest upload of "behemothSpacewar.oxp". That also was broken by trunk changes and now has the special thargons redefined to be working with trunk.

Posted: Fri Feb 19, 2010 9:25 am
by Thargoid
That sounds like a step backwards in terms of how things work to me, to be honest. Work-aroundable, but could end up being a pain.

Posted: Fri Feb 19, 2010 11:09 am
by ADCK
Ah kay. that explains it. Seems kind of odd that it has to end in one of those 3 names so that the game will know its a missile.

The equipment.plist now looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
   <array>
      <integer>100</integer>
      <integer>100000</integer>
      <string>Thargoid Warship</string>
      <string>EQ_ADCK_THARGOID_MISSILE</string>
      <string>Launches a Thargoid Warship</string>
	<dict>
		<key>requires_empty_pylon</key>
		<true/>
		<key>available_to_all</key>
		<true/>
	</dict>
   </array>
   <array>
      <integer>100</integer>
      <integer>100000</integer>
      <string>Destroyer Missile</string>
      <string>EQ_ADCK_DESTROYER_MISSILE</string>
      <string>It does what it says on the tin. Boom, baby, boom!</string>
	<dict>
		<key>requires_empty_pylon</key>
		<true/>
		<key>available_to_all</key>
		<true/>
	</dict>
   </array> 
</array>
</plist>
and have also changed the relevent info in the shipdata.plist, havn't checked, but it should work now.

Now onto the next part, I brought it up earlier.

Is it to possible to have missiles that fire missiles?

Eg My thargoid Carrier now fires 8 warships (which are technically thargons with warship stats and model) can I get these 8 Thargoids to fire 5 Thargons?
And if I wanted to be really silly, could I make the Thargons fire mini-thargons that fire nano-thargons? :P
Kinds of like a Matryoshka Doll in space?

Posted: Fri Feb 19, 2010 11:22 am
by Commander McLane
ADCK wrote:
Thanks, but isn't having "available to all" kind of redundant if you need a tech level of 100 to buy? :P
Not at all.

There are exactly two ways of making a certain piece of equipment buyable for a certain player ship:

1) You have to define the equipment as an optional_equipment in the ship's shipyard.plist. That's the reason why some of the original ships can buy and install a Military Shield Enhancement, and some can't. It is not in their shipyard.plist. This way you can ensure that there is equipment which can only be bought for certain ships (like only ships above a certain size).

Obviously, that doesn't work for OXP-equipment. In order to make your new shiny piece of equipment actually buyable for anybody, you would have to edit and amend each and every shipyard.plist of all existing ships, and all future ships. This is obviously completely unpractical. Therefore you need:

2) You can make it available to all ships by inserting the available_to_all into its equipment.plist entry. Of course this method has its disadvantage, too: You can't easily exclude some ships. Either everybody can buy it, or nobody. And if nobody can ever buy it, why create the equipment in the first place?

So the availability and the necessary TL are two completely different things. Setting a TL makes sure that the equipment doesn't show up on the F3-screen in stations with an insufficient TL. Not using available_to_all makes sure that the equipment doesn't show up on any F3-screen, ever, regardless of TL.

BTW: If your OXP is all about new kinds of Thargons, which would only be used by NPC Thargoid ships and never by the player, why bother with an equipment.plist at all? equipment.plist is only for equipment which is supposed to be available to the player. The original Thargons are not in equipment.plist. They only have a shipdata.plist-entry.

Posted: Fri Feb 19, 2010 12:36 pm
by Frame
Thargoid wrote:
That sounds like a step backwards in terms of how things work to me, to be honest. Work-aroundable, but could end up being a pain.
I second that,

why fix something that is not broken :/

Posted: Fri Feb 19, 2010 12:54 pm
by JensAyton
Frame wrote:
why fix something that is not broken :/
What makes you assume it wasn’t broken? The way equipment was handled before was very broken indeed.

Posted: Fri Feb 19, 2010 1:21 pm
by Thargoid
As of 1.73.4 (and perhaps 1.74, as I don't have an up to date trunk set-up to validate at the moment):

Firstly as mentioned above, if the missiles etc are not for player use, forget completely about equipment.plist. That's only for player equipment.

To make a ship that fires other ships, all you need to do is put the line missile_role = "<insert-your-role-here>"; (or it's XML equivalent if you prefer to code in angle-brackets) in the shipdata.plist of the parent ship (the one that's doing the firing), where <insert-role-here> is one of the roles included in the role list for the ship that you want to fire (the one that will be the missile).

If you look at the built-in shipdata.plist entry for the thargoid warship you will see the line missile_role = "thargon";, which is what tells the warship to fire something with role "thargon".

If that role is unique (for example if you'd put oolite-tharglet instead of thargon) you'd only ever get that specific entity (in this case a base trunk thargon), but if it is shared between multiple entities then you pick from the pool of ships with that role, using the in-built populator and weighting options etc.

So secondly yes, you can have matryoshka's as much as you wish, although in some cases (if you're launching mines not missiles) you need to get a little creative with the coding to make things transfer targets down etc (but it's not too difficult, a few of my OXPs do it). Basically the launched "missile" is just another ship entity, which in the case of a normal missile just happens to act as it does due to it's AI.

As for things being broken etc, Ahruman or Eric - can you elaborate a bit more on what is broken at the moment (as from "our side" in OXP-land it seems to work), and what exactly will be entailed with the current fix and will need changing in OXPs etc.

As the "thargon" is included in the list I'm presuming this is NPC as well as player oriented, which I think is going to make for some very awkward situations as we're possibly going to have to make equipment plist entries for NPC weaponry too, even if we don't want them as player weapons for whatever reason. Although (I hope) that last paragraph will depend on the answers requested in the previous one.