aliens

Author Topic: [Solved][help needed]No hair recolor if armor have recolor script.  (Read 1288 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
So, as mentioned here, if i add this script to the armor definition:
Code: [Select]
    scripts: #glowing of golden stripes
      recolorUnitSprite: |
        var int color;
        var int temp;
        var int flash_color 1; #gold
        set temp 0;

        get_color color new_pixel;
        if eq color flash_color;
          set temp anim_frame;
          wavegen_tri temp 16 19 15;
          mul temp -1;
          add temp 8;
          limit_upper temp 2; # For non-black glow
          add_shade new_pixel temp;
        end;
        return new_pixel;

It will work, producing nice glow of golden suit parts. But hair recolor of this unit stops function.
What am i doing wrong?
(i know that men have wrong hair color, it will be fixed. But women's hair must work properly)
« Last Edit: September 14, 2023, 08:19:41 pm by Nord »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [help needed]No hair recolor if armor have recolor script.
« Reply #1 on: August 30, 2023, 01:01:51 pm »
You changing default recolor script, and this mean you override "hair recolor" recolor as its was stored there.

To restore original behavior you need add missing operations:
Code: [Select]
unit.getRecolor new_pixel; add_burn_shade new_pixel burn shade; return new_pixel;

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [help needed]No hair recolor if armor have recolor script.
« Reply #2 on: August 30, 2023, 03:50:43 pm »
Thanks.