Thanks again, I have the equipment being for sale at specific planets working.
I do however have another problem which stumbles me: I can use the "legends" key in the hud.plist to display images on screen (code from DeepSpace HUD):
Code: Select all
<key>legends</key>
<array>
<dict><!-- crosshair -->
<key>height</key>
<integer>128</integer>
<key>width</key>
<integer>128</integer>
<key>image</key>
<string>crosshair.png</string>
<key>x</key>
<integer>0</integer>
<key>y</key>
<integer>0</integer>
<key>alpha</key>
<real>0.3</real>
</dict>
<dict><!-- dashboard -->
<key>image</key>
<string>base.png</string>
<key>height</key>
<integer>137</integer>
<key>width</key>
<real>640</real>
<key>x</key>
<integer>0</integer>
<key>y</key>
<integer>-185</integer>
<key>alpha</key>
<real>1.00</real>
</dict>
</array>
I can also replace the complete hud from a script (code from Generic HUD):
Code: Select all
switch(newCondition)
{
case 0: // we're docked
{
player.ship.hud = "kwtradinghud.plist"; // set the docked HUD
break;
}
case 1: // we're at green alert
case 2: // or we're at yellow alert
{
if(player.ship.energy > 108) // if we're not using the damaged HUD
{
player.ship.hud = "kwnormalhud.plist"; // set the standard HUD
}
break;
}
case 3: // we're at red alert
{
if(player.alertHostiles && player.ship.energy > 108) // and under attack and not using the damaged HUD
{
player.ship.hud = "kwcombathud.plist"; // set the combat HUD
}
break;
}
}
I'm trying to have different images being displayed at different times but in several combinations. So, let's say I have 3 images A, B and C. At time 1, I want images A & B being displayed. At time 2, I want images B & C being displayed. At time 3 I want to see all images and at time 4 I do not want to see any of them. Each image has a fixed position on screen. Is this possible?
One way I see is to define
as many HUDs as there are permutations of the images I want to display (meaning that if I have 5 images which can be displayed independently, I need 5 factorial = 120 plist definitions to switch between from the script) 2^n HUDS for n images (so 5 images need 2^5=32 plists), but this approach is very impractical. Another problem with this is that the player loses any OXP altered HUD in the proces, I would prefer a solution where the previous HUD is preserved.
I also looked at the jellybaby dispenser (my apologies for even mentioning this most dangerous subject) for inspiration, but there the trumbles mechanism is used to display the images, so that is not a solution for me.
Anybody has any better ideas on how to do this?
EDIT: corrected my math