Ah, I see. (Common Radar mod seems to work fine rendering in advance() though, in terms of not having crashes attributed to it)
Ah, good to know. Interesting!
I'll try creating a custom entity and moving it around to "stick" to the player. For the future, perhaps we could get an interface for campaign layer rendering without a sector entity?
Yeah, I can see adding a callback for UI rendering; I'll keep it in mind. An entity is probably the best bet for in-engine-coordinates rendering, though, especially since layer control etc is already there.
Btw - as far as moving the entity - maybe you're already planning it this way, but based on what you're saying, it sounds like you
might not be, so I thought I'd mention it:
(I'd suggest using its advance() method to make sure it's always in the player's current LocationAPI, and not worrying about the coordinates too much - using the player fleet's coordinates directly for any rendering, and having getRenderRange() return some absurdly high value to make sure it's always rendered if it's in the current location. Apologies if this is obvious!)
Bug report, found while experimenting with a script to mirror weapons on the left/right sides of the ship (based on Wyvern's code here):
After calling WeaponSpecAPI.ensureClonedSpec(), modifying the weapon's fire offsets still affects all weapons of that type. Angle offset works correctly.
I'm guessing this is because the spec cloning does a shallow copy on the fire offsets (a list of Vector2fs)?
Sample EveryFrameWeaponPlugin code
Thank you! ... checking the SVN history, it looks like I actually fixed this some number of months ago, so it must've come up. Ah, I vaguely remember noticing this while looking at something semi-related. And, yeah, the clone() method wasn't deep-copying the fire offsets.