Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95a is out! (03/26/21); Blog post: Of Slipstreams and Sensor Ghosts (09/24/21)

Author Topic: Mount indicaters are drawn underneath decorative weapons  (Read 3151 times)

Tecrys

  • Admiral
  • *****
  • Posts: 548
  • repair that space elevator!
    • View Profile
Mount indicaters are drawn underneath decorative weapons
« on: June 05, 2014, 04:13:17 AM »

Hi Alex and David!

I don't know if this can be considered a bug but it seems that in refit the mount indicators (blue circle, yellow box, white reticule) are drawn underneath decorative weapons.

Now most people won't have problems with this but I do since I am hiding the ship sprite underneath a decorative weapon which equals the ship sprite to hide vanilla damage textures.
This makes it very hard to actually click on the weapon mounts and swap out weapons, one can hardly see the slots partly because I didn't make visual indicators on the sprite itself.

In my opinion the mount indicators should be on top of everything.

Added a screenshot to show what I mean:
Spoiler
[close]
As soon as you hover over the mounts they get highlighted but on the left you can clearly see that the yellow box is underneath the decorative weapon.
PS: Sorry if this is the wrong subforum, I didn't really know where to post this.
« Last Edit: June 05, 2014, 04:20:32 AM by Tecrys »
Logged
Adopt a mod! (Or parts of it) I'd be happy if Biomancy Genetic Engineering found a new patron or if my little monsters appear in some form or another in someone's mod.
https://fractalsoftworks.com/forum/index.php?topic=7682.0

Tartiflette

  • Admiral
  • *****
  • Posts: 3339
  • Toss a coin to your Modder, O' valley of plenty
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #1 on: June 05, 2014, 05:43:04 AM »

That's weird, I use a lot of decoratives and they are not drawn in the refit screen... But in their script I have a "render below all weapons" flag, so maybe that's why.
Logged
 

Tecrys

  • Admiral
  • *****
  • Posts: 548
  • repair that space elevator!
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #2 on: June 05, 2014, 06:16:48 AM »

That's weird, I use a lot of decoratives and they are not drawn in the refit screen... But in their script I have a "render below all weapons" flag, so maybe that's why.

I do that as well depending on which "layer" the decorative needs to be but I guess the difference is that you don't use entire ship sprites as decoratives.
In the picture shown above you basically see two ships on top of each other, so to say.
Logged
Adopt a mod! (Or parts of it) I'd be happy if Biomancy Genetic Engineering found a new patron or if my little monsters appear in some form or another in someone's mod.
https://fractalsoftworks.com/forum/index.php?topic=7682.0

xenoargh

  • Admiral
  • *****
  • Posts: 4927
  • naively breaking things!
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #3 on: June 05, 2014, 12:01:32 PM »

While we're at it; the other major thing about Decoratives is that they'll show up in combat, too; the player can't do anything with them, but they're showing up in weapons groups. 

Unless I'm doing that wrong?
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19208
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #4 on: June 05, 2014, 12:15:22 PM »

Re: OP - hmm, yeah. This isn't super easy to fix, let me think about it.

Unless I'm doing that wrong?

The slot type should be DECORATIVE.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 4927
  • naively breaking things!
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #5 on: June 05, 2014, 12:20:57 PM »

Slot type is DECORATIVE.

Code
    {
      "angle": 135,
      "arc": 0,
      "id": "WS0006",
      "locations": [
        56,
        37
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "DECORATIVE"
    },

Still shows up in weapons groups in battles... unless I use the Auto button in the Weapon Groups editor.  Hmm.  Probably I can disable that "weapon" and remove it from all of the groups, though, via script, when it initializes.  I'll go look at that.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19208
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #6 on: June 05, 2014, 12:24:51 PM »

Well, yeah, if you have the decorative weapon assigned to a group in your .variant, it'll show up. Don't do that :)
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 4927
  • naively breaking things!
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #7 on: June 05, 2014, 12:31:32 PM »

Yeah, well, SFEd does that.  It won't allow weapons to not get assigned a Group.  I guess I can bug MendoncaTrylobot about that, since Decoratives are much more widely in use than they used to be.

I've gotten around this mainly by piling them into Group 5, so that it's not irksome.

I guess I could grep-comment them all out; then I gotta remember to do it again whenever I change anything with SFEd.  
« Last Edit: June 05, 2014, 12:33:36 PM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Tecrys

  • Admiral
  • *****
  • Posts: 548
  • repair that space elevator!
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #8 on: June 05, 2014, 12:48:44 PM »

What do you mean by SFEd?

When I build ships with Trylobots editor I simply put all decoratives into group 5 and afterwards open it with a simply text editor and remove the whole group, problem solved.

I don't quite understand why that wouldn't work for SFEd.

Thanks for looking into it, Alex!
« Last Edit: June 05, 2014, 12:50:37 PM by Tecrys »
Logged
Adopt a mod! (Or parts of it) I'd be happy if Biomancy Genetic Engineering found a new patron or if my little monsters appear in some form or another in someone's mod.
https://fractalsoftworks.com/forum/index.php?topic=7682.0

xenoargh

  • Admiral
  • *****
  • Posts: 4927
  • naively breaking things!
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #9 on: June 05, 2014, 12:58:07 PM »

Quote
When I build ships with Trylobots editor I simply put all decoratives into group 5 and afterwards open it with a simply text editor and remove the whole group, problem solved.
Well, I have to maintain 196 ships atm, and I change their loadouts pretty frequently, so it's a major pain, lol.

Anyhow, this got me to be un-lazy enough to write a grep script to clean it; now all I gotta do is run it once and everything's cleaned up.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19208
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #10 on: June 05, 2014, 01:18:45 PM »

(Fixed the original rendering issue.)
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 4927
  • naively breaking things!
    • View Profile
Re: Mount indicaters are drawn underneath decorative weapons
« Reply #11 on: June 05, 2014, 08:49:05 PM »

Muahaha; laziest method ever.  Run in a Decorative EveryFrameWeaponEffectPlugin in a one-time loop, to remove those pesky Decoratives from weapon groups automatically:

Code: java
        if(runOnce){
            String weaponSlot = weapon.getSlot().getId();
            List<WeaponGroupSpec> weaponGroups = weapon.getShip().getVariant().getWeaponGroups();
            for(WeaponGroupSpec group : weaponGroups){
                List<String> slots = group.getSlots();
                String slotID = new String();
                for(String slot : slots){
                    if(slot.equalsIgnoreCase(weaponSlot)){
                        slotID = slot.toString();
                    }
                }
                if(slotID.equalsIgnoreCase(weaponSlot)) group.removeSlot(slotID);
            }
        }

I think that's one for the Code Dump, lol.
Logged
Please check out my SS projects :)
Xeno's Mod Pack