• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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