Page 1 of 1

equipment.plist questions

Posted: Tue Dec 02, 2008 10:52 pm
by Lestradae
Two questions ...

1.) Does anyone know, if I want a piece of equipment to be only available to be bought if the player`s ship has a certain weapons energy or higher, how to do this with the conditions key in the equipment.plist?

Would do it somewhat like this:

Code: Select all

<dict>
                        <key>available_to_all</key>
                        <true/>
                        <key>conditions</key>
                        <array>
                                <string>weapon_energy greaterthan 100</string>
                        </array>
                </dict>
... actually work ingame?

If not, how then, or is it even possible to set such a condition?

2.) I want to create a new equipment item that reduces the hyperspace_motor_spin_time of a ship to a certain value. How do I do that?

:?:

L

Posted: Tue Dec 02, 2008 11:00 pm
by Svengali
I don't think that it is possible. The conditions part depends on legacy scripting and getting properties is JS only. But maybe I'm wrong.

Re: equipment.plist questions

Posted: Wed Dec 03, 2008 9:12 am
by Commander McLane
Lestradae wrote:
Two questions ...

1.) Does anyone know, if I want a piece of equipment to be only available to be bought if the player`s ship has a certain weapons energy or higher, how to do this with the conditions key in the equipment.plist?

Would do it somewhat like this:

Code: Select all

<dict>
                        <key>available_to_all</key>
                        <true/>
                        <key>conditions</key>
                        <array>
                                <string>weapon_energy greaterthan 100</string>
                        </array>
                </dict>
... actually work ingame?

If not, how then, or is it even possible to set such a condition?
Like Svengali said, not possible. Via conditions in equipment.plist (or in any legacy-script) only the states available to legacy scripts can be queried, and the list of these states is unfortunately brief. You find it in the Querying states section of the legacy-methods documentation. If a whatever_number is not mentioned there, you can't use it.
Lestradae wrote:
2.) I want to create a new equipment item that reduces the hyperspace_motor_spin_time of a ship to a certain value. How do I do that?
Also not possible. Hyperspace_motor_spin_time is set once and for all in shipdata.plist. You cannot change it from a script. This would require to make it a read/write JS-property, preferably of PlayerShip, which it doesn't yet seem to be.

So you would have to request it first.

..

Posted: Wed Dec 03, 2008 1:34 pm
by Lestradae
Thanks, guys, for the helpful comments, even if they didn`t bring a solution the way I hoped they would :(