• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Boolean to Boolexpr

Status
Not open for further replies.
Level 11
Joined
May 31, 2008
Messages
698
So i have this boolean, but i need a boolexpr

JASS:
Condition(IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Caster[udg_A])) == true )
^This is the problem


This is the whole function
JASS:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
    call GroupEnumUnitsInRange(udg_TempGroup[0], GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), (I2R(GetUnitAbilityLevel(udg_Caster[udg_A], 'A002')) - 1) * udg_BaseAOE[udg_A] + udg_AOEIncrement[udg_A], Condition(IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Caster[udg_A])) == true ))
endfunction

It says "cannot convert boolean to code"

So i guess im supposed to put the boolean into a separate function and then call that function, but is there a way to do this without creating another function?
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
A boolexpr is a function that returns a boolean value.

JASS:
function BoolExpr takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Caster[udg_A])) == true
endfunction

function tokwa takes nothing returns nothing
    call GroupEnumUnitsInRange(udg_TempGroup[0], GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), (I2R(GetUnitAbilityLevel(udg_Caster[udg_A], 'A002')) - 1) * udg_BaseAOE[udg_A] + udg_AOEIncrement[udg_A], Condition(function BoolExpr))
endfunction
 
Status
Not open for further replies.
Top