Author Topic: [Solved] death frames and flying units frame issue  (Read 3649 times)

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
[Solved] death frames and flying units frame issue
« on: February 24, 2022, 03:08:22 pm »
I've prepared a sprite-sheet for a flying unit (drawing routine 0) with both male and female torsos, and with 8 death frames, like so:
Code: [Select]
armors:
  - type: STR_CAT_3_YELLOW_ARMOR_UC
    movementType: 1
    deathFrames: 8

The game appears to render the legs and torsos in a strange way.
Kato has also confirmed the problem.
@developers, I can PM the sprite-sheet if required.
« Last Edit: February 12, 2023, 03:14:37 pm by Meridian »

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [possible bug] death frames and flying units frame issue
« Reply #1 on: February 24, 2022, 04:08:39 pm »
Could you show screen shot of it?

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: [possible bug] death frames and flying units frame issue
« Reply #2 on: February 24, 2022, 04:33:05 pm »
Could you show screen shot of it?

Here's a game screenshot, and another cutout of the WIP of the sprite sheet. The remaining 5 death frames are blank.


Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: [possible bug] death frames and flying units frame issue
« Reply #3 on: February 24, 2022, 07:24:07 pm »
Upon further testing and chats, it seems that until the code is fixed, the only way for a flying unit to have more than three death frames (and up to 11 frames) is not to have an alternate female torso and shift back the flying legs to their frame slot as if the death frames were originally the default three.

Edit: add example
« Last Edit: February 24, 2022, 07:47:34 pm by Alex_D »

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: [bug] death frames and flying units frame issue
« Reply #4 on: March 20, 2022, 10:00:49 pm »
Any plans on looking at this bug?

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [bug] death frames and flying units frame issue
« Reply #5 on: March 21, 2022, 01:32:13 am »
Right now no, as there is workaround available, with y-scripts you can shit index of body parts and have space for death frames.

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: [bug] death frames and flying units frame issue
« Reply #6 on: March 23, 2022, 07:10:25 pm »
My expertise of scripts isn't that good. Do you have some examples at hand that could be used to by-pass this problem?

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [bug] death frames and flying units frame issue
« Reply #7 on: March 23, 2022, 10:01:42 pm »
Yes, I can prepare some examples, question is it will be used globally or only for one armor?

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: [bug] death frames and flying units frame issue
« Reply #8 on: March 24, 2022, 01:44:34 pm »
Yes, I can prepare some examples, question is it will be used globally or only for one armor?

I'd prefer globally. However, if the code is small, I assume it can be incorporated on a case-by-case basis, as I doubt this feature is to become the majority anytime soon.
At the moment the issue was for one, maybe two armors for one future mod in Piratez, we used a workaround in the meantime. But I'm thinking about the future of any other mod.

So whichever is easier.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [bug] death frames and flying units frame issue
« Reply #9 on: March 24, 2022, 02:41:01 pm »
ok, I will prepare some examples today. As I check code recently, current version of OXCE do not have enough data exposed to make script like this, I will update engine too to make this script possible or at least more reliable and simple.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [bug] death frames and flying units frame issue
« Reply #10 on: March 25, 2022, 12:35:54 am »
Code: [Select]
extended:
  scripts:
    selectUnitSprite:
      - offset: -2
        code: |
          var int drawingRoutine;
          var int deathFrames;
         
          if or
            eq blit_part blit_torso
            eq blit_part blit_legs
          ;
            var ptr RuleArmor armor;
            unit.getRuleArmor armor;
            armor.getDrawingRoutine drawingRoutine;
            armor.getDeathFrames deathFrames;
            if and
              eq drawingRoutine 0
              gt sprite_index 264  #bigger than first death frame
              gt deathFrames 3
            ;
              sub deathFrames 3;
              add sprite_index deathFrames;
            end;
          end;
          return sprite_index;
Global script, check for `drawingRoutine: 0`  and for e.g. `deathFrames: 5`.

Script shift all frames after death frame by additional death frames.
« Last Edit: March 25, 2022, 12:38:24 am by Yankes »