equipment.plist question

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

Moderators: winston, another_commander

User avatar
ADCK
---- E L I T E ----
---- E L I T E ----
Posts: 771
Joined: Thu Dec 24, 2009 12:30 am
Location: Sydney
Contact:

equipment.plist question

Post 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>
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post 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:
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post 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.
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 »

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.
User avatar
ADCK
---- E L I T E ----
---- E L I T E ----
Posts: 771
Joined: Thu Dec 24, 2009 12:30 am
Location: Sydney
Contact:

Post 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
User avatar
ADCK
---- E L I T E ----
---- E L I T E ----
Posts: 771
Joined: Thu Dec 24, 2009 12:30 am
Location: Sydney
Contact:

Post 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?
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post 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?
User avatar
ADCK
---- E L I T E ----
---- E L I T E ----
Posts: 771
Joined: Thu Dec 24, 2009 12:30 am
Location: Sydney
Contact:

Re: ..

Post 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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: ..

Post 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.
Last edited by Eric Walch on Fri Feb 19, 2010 1:38 pm, edited 1 time in total.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
ADCK
---- E L I T E ----
---- E L I T E ----
Posts: 771
Joined: Thu Dec 24, 2009 12:30 am
Location: Sydney
Contact:

Post 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?
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 »

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.
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post 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 :/
Bounty Scanner
Number 935
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

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