• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[LUA] Unable to make dynamic filters

Status
Not open for further replies.

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,906
For some reason I can't figure out how to make a dynamic filter/condition so that it can be used for unit enumerations are stuff like that, lua always gives me a vague error "unknown compile error". I've tried endless possibilities and can't wrap my head about it...
Lua:
function A()
    local b = Condition(function AFunction()
    return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
    end)
--blaaaablabla
--(...)
    GroupEnumUnitsInRange(g, someX, someY, 256., b)
end
Either the solution is simple or I'm just overcomplicating it while there is an easier way.
Would be nice to have a documentation about lua on this
 
Status
Not open for further replies.
Top