aliens

Author Topic: [Solved] spriteFacility for 2x2 facilities.  (Read 1724 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
[Solved] spriteFacility for 2x2 facilities.
« on: May 30, 2024, 10:52:07 pm »
As for now, 2x2 modules use only spriteShape sprite. Some kind of "lower level" for buildings. But in mods there can be high 2x2 modules, so facility builded higher than 2x2 (1 tile to the north) can "overdraw" part of 2x2 building. In vanilla it can not be, because all basebit sprites are "short", but in mods we can get ugly mix.

So, suggestion: use spriteFacility for 2x2 buildings if it is set.

Thanks.
« Last Edit: June 07, 2024, 01:49:03 pm by Nord »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: [Suggestion] spriteFacility for 2x2 facilities.
« Reply #1 on: June 01, 2024, 12:06:07 pm »
I don't understand this.

Is there a visual example of what's wrong?

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [Suggestion] spriteFacility for 2x2 facilities.
« Reply #2 on: June 01, 2024, 04:55:40 pm »
Ok, will try to explain. (Sorry for bad english)
Lets suggest that we want to make open-grounded base module. In my example it will be enlarged fusion ball defenses.
Spoiler"facilities.rul":
facilities:
  - type: STR_FUSION_BALL_DEFENSES
    connectorsDisabled: true
    spriteShape: 28
    spriteFacility: 2
  - type: STR_LABORATORY
    connectorsDisabled: true
Here i changed places of spriteShape and spriteFacility.
On the screenshot you can see what i got: lab is drawed over the fusion defense, but hangar is drawn under it. 

Offline Pendra37

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: [Suggestion] spriteFacility for 2x2 facilities.
« Reply #3 on: June 02, 2024, 09:27:47 pm »
You mean you want a facility that is over another facility? Like build a 1x1 Defence installation which has a 1x2 sprite that goes "over" the hangar? Not in functionality, just the looks. That is dealing with the Z order.
If I understand correctly, you want something like an "always on top" tag to make the tagged facility sprites always cover the normal, lower level facilities. Like how it happens in case of the hangars.
« Last Edit: June 03, 2024, 01:42:24 am by Pendra37 »

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [Suggestion] spriteFacility for 2x2 facilities.
« Reply #4 on: June 03, 2024, 01:49:35 am »
Not ower whole facility, but only over the edge. In my case it is a southern tunnel exits and outside equipment, like gas ballons and antennaes.
Instead "Always on top" we allready have 2 layers: lower (spriteShape) and upper (spriteFacility). It is enough, but it works only for 1x1 facilities.

Offline WarStalkeR

  • Captain
  • ***
  • Posts: 56
  • Repensum Est Canicula
    • View Profile
Re: [Suggestion] spriteFacility for 2x2 facilities.
« Reply #5 on: June 07, 2024, 09:53:28 am »
The "spriteEnabled" is your best friend https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom) to allow "spriteShape" and "spriteFacility" for facilities bigger then 1x1. Was implemented quite some time ago.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [Suggestion] spriteFacility for 2x2 facilities.
« Reply #6 on: June 07, 2024, 01:48:10 pm »
Many thanks. How can i miss that...