Team colors and transparency

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Team colors and transparency

Post by Helmet »

I made the sprite for a unit with wings, then team-colored the wings. I'd like the wings to be semi-transparent; unfortunately, team colors only work when I make the wings opaque. The wings don't look as good when they're opaque, though.

Evidently semi-transparent team colors is do-able. Is there an extra step I need to do to make it work? I'm using version 1.15.6.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Nyanyanyan
Posts: 73
Joined: May 11th, 2018, 10:40 pm

Re: Team colors and transparency

Post by Nyanyanyan »

First of all, I'm not sure using the dev version is a good idea when doing anything multiplayer, since it has a lot of new features (ways to filter for example) that, if I understand this correctly, won't be understood by the stable release.

Anyway, regarding your question, couldn't you do it using a transparent halo?
Didn't try it, but from the wiki, halo_mod=~O( factor or percentage% ) should do the trick.
Author of Age of Lords and the Revolution and Civil War and Expendable Leaders 2 multiplayer mods.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: Team colors and transparency

Post by Helmet »

Nyanyanyan wrote: November 5th, 2020, 12:05 pm ...couldn't you do it using a transparent halo?
Didn't try it, but from the wiki, halo_mod=~O( factor or percentage% ) should do the trick.
H, Nyanyanyan. The campaign is single-player.

I went to the Wiki, like you suggested. I do not understand halo_mod and string modifications and ImagePathFunctions. I'm guessing that it wouldn't work, however. If I put the wings on a separate layer for a halo effect, the transparency would probably apply to the entire wing, right? This is not ideal, because the wing was designed with opaque colors, colors that have 30% opacity, and colors that have 70% opacity.

Here is the image. If someone can provide the code which gets team colors working, I'd appreciate it. As required, I only used magenta on the wings.

dragonfly.png
dragonfly.png (4.71 KiB) Viewed 500 times
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
MoonyDragon
Posts: 149
Joined: November 29th, 2017, 5:46 pm

Re: Team colors and transparency

Post by MoonyDragon »

You can also use this Dragonfly from Age of Tentacles by Wayirr. Simply recolor the blue part to magenta, if you want to add teamcolors to that unit. The CC-BY-SA License allows that, provided you credit him.
Default L0 Era - Level 1 leaders with level 0 recruits!
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: Team colors and transparency

Post by Helmet »

MoonyDragon wrote: November 5th, 2020, 5:05 pm You can also use this Dragonfly from Age of Tentacles by Wayirr. Simply recolor the blue part to magenta, if you want to add teamcolors to that unit. The CC-BY-SA License allows that, provided you credit him.
Thanks for the info. I checked-out the dragonfly unit from Age of Tentacles. Nice sprite! But I already animated my unit with flying, melee, and death, so I'm inclined to keep using it. I decided to team-color the wings as an afterthought.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Post Reply