• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Transparency Problem

Status
Not open for further replies.
Level 7
Joined
Jul 12, 2008
Messages
295
Mortred's third spell ''Blur'' gives transparency and a chance that enemies will miss... But on newer versions the transparency is only for the enemies of the mortred but allies see her very clear. How is this done?
 
Level 7
Joined
Jul 12, 2008
Messages
295
Hmm i have done it with custom script... I guy showed me... Anyways do u know how to change the transparence changing for this custom script from 90 to 22.5 * Level of that Spell
call SetUnitVertexColorBJ( udg_Transparency_Unit, 100, 100, 100, 90.00 )
 
Level 6
Joined
Sep 5, 2007
Messages
264
JASS:
local unit hero = GetLevelingUnit()
local player player_local = GetLocalPlayer()
local integer abil_lvl = GetUnitAbilityLevel(hero, <ability>)
if (IsUnitAlly(hero, player_local)) then
        // SetUnitVertexColor(unit, red,green,blue, alpha)
        call SetUnitVertexColor(hero, 255,255,255, 255)
    else
        // SetUnitVertexColor(unit, red,green,blue, alpha)
        call SetUnitVertexColor(hero, 255,255,255, 255 - (64 * abil_lvl))
        // Each level provides 25%(255/64 = ~25%) transparency to enemies.
endif

Is this what you're looking for? I wrote it in JASS, it is a "Hero-levels-up-ability" function. Just set a condition to check if the ability being leveled-up is the "transparency" ability, also add the "transparency" ability rawcode where i said <ability>. :thumbs_up:
 
Level 7
Joined
Jul 12, 2008
Messages
295
BUMP: It says to me for this: call SetUnitVertexColorBJ( udg_Transparency_Unit, 100, 100, 100, 255 - (41.5 * Transparency_lvl)) Expected a name
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
You could do it 'mostly' gui.
You only need to insert two custom texts.

  • InvisForEnemies
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Evasion
    • Actions
      • Custom script: if not IsUnitAlly(GetTriggerUnit(), GetLocalPlayer()) then
      • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with (25.00 x (Real((Level of Evasion for (Triggering unit)))))% transparency
      • Custom script: endif
This should be the simplest way in Gui.
 
Level 7
Joined
Jul 12, 2008
Messages
295
Hmm ok thnx i will test it and give u +rep if it works :p
EDIT: It doesn't work :S... It doesn't change transparency
 
Last edited:
Level 7
Joined
Jul 12, 2008
Messages
295
I know i can't see it i will post my trigger so u can see... Whats wrong here.. Can some 1 test it because i can't test it in multiplayer :S

Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Tidal Bash
Actions
Set Transparency_Unit = (Learning Hero)
Custom script: if IsUnitEnemy (udg_Transparency_Unit, GetLocalPlayer ()) then
Custom script: call SetUnitVertexColorBJ(udg_Transparency_Unit, 100, 100, 100, (GetUnitAbilityLevel(udg_Transparency_Unit, 'A00K')) * 225 * .01)
Custom script: endif
 
Level 7
Joined
Jul 12, 2008
Messages
295
The trigger is learns a skill and when my hero will revive the skill will already be learned... Btw i think that this think is bugged or something... I cr8ed an enemy force player 2 and i gave the skill to the hero and then changed its lvl to 4 and still didn't gave transparency.. Rly i need to test it multiplayer because singleplayer sux and doesn't work... Btw tnx for all your help, Eccho i will give u +rep for the help... ;)
 
Level 6
Joined
Sep 5, 2007
Messages
264
If your hero is revived using triggers, then just refresh the unit's transparency when you revive, otherwise use TriggerRegisterAnyUnitEventBJ(<trigger>, EVENT_UNIT_HERO_REVIVE_FINISH).

Sorry I didn't try to do that trigger in GUI. I got laid off at work yesterday :(
That, and I've been using JASS for a while now, I can't rememeber GUI properly.

Anyways, I hopes that I've helped out. :thumbs_up:
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Okay, a few testing I did responses on the following:

Hmm ok thanks, but what if my hero dies? His transparency will be reseted..?
no... it will maintain its faded appearance.
The trigger is learns a skill and when my hero will revive the skill will already be learned... Btw i think that this think is bugged or something... I cr8ed an enemy force player 2 and i gave the skill to the hero and then changed its lvl to 4 and still didn't gave transparency.. Rly i need to test it multiplayer because singleplayer sux and doesn't work... Btw tnx for all your help, Eccho i will give u +rep for the help... ;)
then you did something wrong. These are my test triggers and they all worked properly.
(on the map I set a demon hunter owned by player blue and in lvl 10)

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Grant shared vision of Demon Hunter 0000 <gen> to Player 1 (Red)
      • Wait 5.00 seconds
      • Hero - Learn skill for Demon Hunter 0000 <gen>: Evasion
  • Fade
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Triggering unit) Equal to Demon Hunter 0000 <gen>
    • Actions
      • Custom script: if not IsUnitAlly(GetTriggerUnit(), GetLocalPlayer()) then
      • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 75.00% transparency
      • Custom script: endif
      • -------- the next part is to check if it resets after dying, which it didnt! --------
      • Wait 5.00 seconds
      • Unit - Kill (Triggering unit)
      • Wait 5.00 seconds
      • Hero - Instantly revive (Triggering unit) at (Center of (Playable map area)), Show revival graphics
 
Status
Not open for further replies.
Top