Hello again,
A few weird issues have sprung up, and I was hoping if anyone could shed some light on them.
Firstly, that armor regeneration "weapon" script I was working on a few posts back? I've been making use of the
void maintainStatusForPlayerShip(Object key, String spriteName, String title, String data, boolean isDebuff) method from
engineAPI to display the current armor percentage, in a fashion similar to those buff/debuff indicators in the bottom left widget of the combat interface.
private String AAG_SPRITE = "Sprite Path Goes Here";
...
...
if (player)
{
if ( (int)currArmorPercentage < 100 )
{
engine.maintainStatusForPlayerShip(STATUSKEY_REPAIR_PERCENT, AAG_SPRITE, weaponAPI.getDisplayName(), "armor integrity: " + String.format("%.2f", currArmorPercentage) + "%", true);
} else {
engine.maintainStatusForPlayerShip(STATUSKEY_REPAIR_PERCENT, AAG_SPRITE, weaponAPI.getDisplayName(), "armor integrity: " + String.format("%.2f", currArmorPercentage) + "%", false);
}
}
...
...
While the indicators are showing up fine in-game, the green mono-colored icon to the left sometimes doesn't show up at all, depending on what I put into
private String AAG_SPRITE, which in turn, is passed onto the
String spriteName parameter.
For instance, in my mod's folder, I have a
graphics/icons/hullsys/advanced_phase_cloak.png (which is really just a copy/paste of the vanilla
phase_cloak.png). When I feed that as the path string, it shows up fine (albeit with some weird random artifacts at times, probably an engine issue).
But for some reason, that appears to be the only icon that works properly. If I, say, copy the
damper_field.png icon from vanilla and paste it into my mod folder as
ablative_armor_generator.png, using
graphics/icons/hullsys/ablative_armor_generator.png as the path string results in a blank icon instead.
Other than making file renames, I haven't touched the icons' pixels themselves with any image editors, and I've also made sure that there are no multiple copies in both the vanilla core folders and my own mod folder... yet there is no way for me to reliably predict whether an icon will work or not.
Might this have anything to do with the way the game engine looks up the icon path? Do I need to include the parent directory (i.e. the name of my mod) in the path name as well, to explicitly separate it from the vanilla path?
The second one is much more minor: a custom ship I am working on (in the same mod folder) has its own entry in a new
ship_data.csv, where it is listed as
Phase Frigate under the
designation column. Since that's two words, however, when in-game and entering a custom variant name in the Refit screen, the game engine has a nasty habit of separating those two words and shoving the variant input field in the middle, like
Phase [Enter Variant Name] Frigate.
Most ships in vanilla only use one word for their
designation, and they simply end up like
[Enter Variant Name] Frigate. I've even seen the Hound, which is designated as a
Combat Freighter, show up in game as
[Enter Variant Name] Combat Freighter.
Is the game engine hardcoded to make an exception for ships with the word "Phase" in their designations? Is there some way to work around it, or should I just use another word other than "Phase" instead?