• 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.

[JASS] Changing a unit color when it's damaged

Status
Not open for further replies.
Doesn't work.

Any suggestions?

JASS:
function funCannonColorC takes nothing returns boolean
    return true //GetUnitAbilityLevel(GetTriggerUnit(),'B018')>0
endfunction

function funCannonColorA takes nothing returns nothing
    local integer r = GetRandomInt(1,255)
    local integer g = GetRandomInt(1,255)
    local integer b = GetRandomInt(1,255)
    call SetUnitVertexColor(GetTriggerUnit(),r,g,b,255)
endfunction

function InitTrig_funCannonColor takes nothing returns nothing
    set gg_trg_funCannonColor = CreateTrigger()
    call TriggerRegisterUnitEvent(gg_trg_funCannonColor,udg_PlayerBoat[3],EVENT_UNIT_DAMAGED)
    //call TriggerAddCondition(gg_trg_funCannonColor,Condition(function funCannonColorC))
    call TriggerAddAction(gg_trg_funCannonColor,function funCannonColorA)
endfunction
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
The green text is comments. Should they be?
Right now you allways returning false, and therefor nothing. Or.. ?
Wait. you dont even call the condition, so your just checking the action?

Ahh i know it!
Your setting it to
R,g,b,Opacity
But Opacity can highest be 100 (100 = normal)

Just change 255 to 100 in that line.
 
Status
Not open for further replies.
Top