Error; For something that doesnt exists.

Crazy_Dead

New Member
I get an error when i saving my map, when i just installed EGUI.
It says Function Redeclared: GetUnitId, which collides with AIDS.

But the real problem is This Errors with GetLastOrder library( By Rising_Dusk ).
And I havent get that Trigger. :p

Does anyone know the sulution to this?

Greetz.
 

SineCosine

I'm still looking for my Tangent
Why do you want to use EGUI?
I know I said (somewhere) that EGUI shouldn't be used until it's updated ._.
 

Komaqtion

You can change this now in User CP.
Back to the problem...
The problem is that that library exists in the (I think) EGUI Core trigger, or whatever it's called :S

I'd simply suggest you either use EGUI and code in GUI (And also remove or just disable AIDS) or you learn v/JASS and remove EGUI and code with AIDS as the Unit-Indexer ;)

That's the only solution I can see XD
 

Jesus4Lyf

Good Idea™
Gone are the days where people care to investigate the problem...

EGUI uses the deprecated system UnitIndexingUtils. To use EGUI with AIDS with no penalty (as far as I know), install AIDS into your map as per usual, and then in the Knockback "trigger" in the EGUI folder, replace the whole thing with this:
JASS:
//******************************************************************************
//*                                                                            *
//*                             K N O C K B A C K                              *
//*                                Actual Code                                 *
//*                                   v1.06                                    *
//*                                                                            *
//*                              By: Rising_Dusk                               *
//*                                                                            *
//******************************************************************************

library Knockback initializer Init needs TerrainPathability, GroupUtils, UnitIndexingUtils, LastOrder
globals
    //*********************************************************
    //* These are the configuration constants for the system
    //*
    //* EFFECT_ATTACH_POINT:  Where on the unit the effect attaches
    //* EFFECT_PATH_WATER:    What special effect to attach over water
    //* EFFECT_PATH_GROUND:   What special effect to attach over ground
    //* DEST_RADIUS:          Radius around which destructs die
    //* DEST_RADIUS_SQUARED:  Radius squared around which destructs die
    //* ADJACENT_RADIUS:      Radius for knocking back adjacent units
    //* ADJACENT_FACTOR:      Factor for collision speed transfers
    //* TIMER_INTERVAL:       The interval for the timer that gets run
    //* ISSUE_LAST_ORDER:     A boolean to issue last orders or not
    //*
    private constant string         EFFECT_ATTACH_POINT = "origin"
    private constant string         EFFECT_PATH_WATER   = "MDX\\KnockbackWater.mdx"
    private constant string         EFFECT_PATH_GROUND  = "MDX\\KnockbackDust.mdx"
    private constant real           DEST_RADIUS         = 180.
    private constant real           DEST_RADIUS_SQUARED = DEST_RADIUS*DEST_RADIUS
    private constant real           ADJACENT_RADIUS     = 180.
    private constant real           ADJACENT_FACTOR     = 0.75
    private constant real           TIMER_INTERVAL      = 0.05
    private constant boolean        ISSUE_LAST_ORDER    = true
    
    //*********************************************************
    //* These are static constants used by the system and shouldn't be changed
    //*
    //* Timer:                The timer that runs all of the effects for the spell
    //* Counter:              The counter for how many KB instances exist
    //* HitIndex:             Indexes for a given unit's knockback
    //* Knockers:             The array of all struct instances that exist
    //* Entries:              Counters for specific unit instances in system
    //* ToClear:              How many instances to remove on next run
    //* DesBoolexpr:          The check used for finding destructables
    //* AdjBoolexpr:          The check for picking adjacent units to knockback
    //* DestRect:             The rect used to check for destructables
    //*
    private          timer          Timer               = CreateTimer()
    private          integer        Counter             = 0
    private          integer  array HitIndex
    private          integer  array Knockers
    private          integer  array Entries
    private          integer  array ToClear
    private          boolexpr       DesBoolexpr         = null
    private          boolexpr       AdjBoolexpr         = null
    private          rect           DestRect            = Rect(0,0,1,1)
    
    //* Temporary variables used by the system
    private          real           TempX               = 0.
    private          real           TempY               = 0.
    private          unit           TempUnit1           = null
    private          unit           TempUnit2           = null
endglobals

//* Functions for the destructable destruction
private function KillDests_Check takes nothing returns boolean
    local real x = GetDestructableX(GetFilterDestructable())
    local real y = GetDestructableY(GetFilterDestructable())
    return (TempX-x)*(TempX-x) + (TempY-y)*(TempY-y) <= DEST_RADIUS_SQUARED
endfunction

private function KillDests takes nothing returns nothing
    call KillDestructable(GetEnumDestructable())
endfunction

//* Functions for knocking back adjacent units
private function KnockAdj_Check takes nothing returns boolean
    return TempUnit2 != GetFilterUnit() and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(TempUnit1)) and IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) and not IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) and GetWidgetLife(GetFilterUnit()) > 0.405 and GetUnitAbilityLevel(GetFilterUnit(), 'Avul') <= 0
endfunction

//******************************************************************************
//* Some additional functions that can be used
function KnockbackStop takes unit targ returns boolean
    local integer id = GetUnitId(targ)
    set ToClear[id] = Entries[id]
    return ToClear[id] > 0
endfunction
function IsKnockedBack takes unit targ returns boolean
    return Entries[GetUnitId(targ)] > 0
endfunction

//* Struct for the system, I recommend leaving it alone
private struct knocker
    unit Source      = null
    unit Target      = null
    group HitGroup   = null
    effect KBEffect  = null
    integer FXMode   = 0
    boolean KillDest = false
    boolean KnockAdj = false
    boolean ChainAdj = false
    real Decrement   = 0.
    real Displace    = 0.
    real CosA        = 0.
    real SinA        = 0.
    
    public method checkterrain takes knocker n returns integer
        local real x = GetUnitX(n.Target)
        local real y = GetUnitY(n.Target)
        if IsTerrainPathingType(x, y, TERRAIN_PATHING_LAND) then
            return 1
        endif
        if IsTerrainPathingType(x, y, TERRAIN_PATHING_SHALLOW) then
            return 2
        endif
        return 0
    endmethod
    static method create takes unit source, unit targ, real angle, real disp, real dec, boolean killDestructables, boolean knockAdjacent, boolean chainAdjacent returns knocker
        local knocker n = knocker.allocate()
        set n.Target    = targ
        set n.Source    = source
        set n.FXMode    = n.checkterrain(n)
        set n.HitGroup  = NewGroup()
        set n.KillDest  = killDestructables
        set n.KnockAdj  = knockAdjacent
        set n.ChainAdj  = chainAdjacent
        set n.Decrement = dec
        set n.Displace  = disp
        set n.CosA      = Cos(angle)
        set n.SinA      = Sin(angle)
        
        if n.FXMode == 1 then
            set n.KBEffect = AddSpecialEffectTarget(EFFECT_PATH_GROUND, n.Target, EFFECT_ATTACH_POINT)
        elseif n.FXMode == 2 then
            set n.KBEffect = AddSpecialEffectTarget(EFFECT_PATH_WATER, n.Target, EFFECT_ATTACH_POINT)
        debug else
            debug call BJDebugMsg(SCOPE_PREFIX+" Error (On Create): Unknown Terrain Type")
        endif
        
        return n
    endmethod
    private method onDestroy takes nothing returns nothing
        local integer id = GetUnitId(this.Target)
        set Entries[id] = Entries[id] - 1
        if GetWidgetLife(this.Target) > 0.405 and Entries[id] <= 0 and ISSUE_LAST_ORDER then
            call IssueLastOrder(this.Target)
        endif
        call DestroyEffect(this.KBEffect)
        call ReleaseGroup(this.HitGroup)
    endmethod
endstruct

private function Update takes nothing returns nothing
    local unit u       = null
    local unit s       = null
    local rect r       = null
    local knocker n    = 0
    local knocker m    = 0
    local integer i    = Counter - 1
    local integer j    = 0
    local integer mode = 0
    local integer id   = 0
    local real xi      = 0.
    local real yi      = 0.
    local real xf      = 0.
    local real yf      = 0.
    
    loop
        exitwhen i < 0
        set n    = Knockers<i>
        set u    = n.Target
        set mode = n.FXMode
        set id   = GetUnitId(u)
        
        set xi   = GetUnitX(u)
        set yi   = GetUnitY(u)
        
        if n.Displace &lt;= 0 or ToClear[id] &gt; 0 then
            //* Clean up the knockback when it is over
            if ToClear[id] &gt; 0 then
                set ToClear[id] = ToClear[id] - 1
            endif
            call n.destroy()
            set Counter = Counter - 1
            if Counter &lt; 0 then
                call PauseTimer(Timer)
                set Counter = 0
            else
                set Knockers<i> = Knockers[Counter]
            endif
        else
            //* Propagate the knockback in space and time
            set xf = xi + n.Displace*n.CosA
            set yf = yi + n.Displace*n.SinA
            call SetUnitPosition(u, xf, yf)
            set n.FXMode = n.checkterrain(n)
            
            //* Modify the special effect if necessary
            if n.FXMode == 1 and mode == 2 then
                call DestroyEffect(n.KBEffect)
                set n.KBEffect = AddSpecialEffectTarget(EFFECT_PATH_GROUND, n.Target, EFFECT_ATTACH_POINT)
            elseif n.FXMode == 2 and mode == 1 then
                call DestroyEffect(n.KBEffect)
                set n.KBEffect = AddSpecialEffectTarget(EFFECT_PATH_WATER, n.Target, EFFECT_ATTACH_POINT)
            debug elseif n.FXMode == 0 then
                debug call BJDebugMsg(SCOPE_PREFIX+&quot; Error (In Update): Unknown Terrain Type&quot;)
            endif
            set n.Displace = n.Displace - n.Decrement
            
            //* Destroy destructables if desired
            if n.KillDest then
                set TempX = GetUnitX(u)
                set TempY = GetUnitY(u)
                call MoveRectTo(DestRect, TempX, TempY)
                call EnumDestructablesInRect(DestRect, DesBoolexpr, function KillDests)
            endif
            
            //* Knockback nearby units if desired
            if n.KnockAdj then
                set xi         = GetUnitX(u)
                set yi         = GetUnitY(u)
                set TempUnit1  = n.Source
                set TempUnit2  = u
                call GroupEnumUnitsInRange(ENUM_GROUP, xi, yi, ADJACENT_RADIUS, AdjBoolexpr)
                loop
                    set s = FirstOfGroup(ENUM_GROUP)
                    exitwhen s == null
                    if not IsUnitInGroup(s, n.HitGroup) then
                        set xf = GetUnitX(s)
                        set yf = GetUnitY(s)
                        call GroupAddUnit(n.HitGroup, s)
                        set m = knocker.create(n.Source, s, Atan2(yf-yi, xf-xi), n.Displace*ADJACENT_FACTOR, n.Decrement, n.KillDest, n.ChainAdj, n.ChainAdj)
                        call GroupAddUnit(m.HitGroup, u)
                        set Knockers[Counter] = m
                        set Counter           = Counter + 1
                    endif
                    call GroupRemoveUnit(ENUM_GROUP, s)
                endloop
            endif
        endif
        set i = i - 1
    endloop
    
    set u = null
    set s = null
endfunction

//******************************************************************************
//* How to knockback a unit
function KnockbackTarget takes unit source, unit targ, real angle, real startspeed, real decrement, boolean killDestructables, boolean knockAdjacent, boolean chainAdjacent returns boolean
    local knocker n  = 0
    local integer id = GetUnitId(targ)
    
    //* Protect users from themselves
    if decrement &lt;= 0. or startspeed &lt;= 0. or targ == null then
        debug call BJDebugMsg(SCOPE_PREFIX+&quot; Error (On Call): Invalid Starting Conditions&quot;)
        return false
    endif
    //* Can't chain if you don't knockback adjacent units
    if not knockAdjacent and chainAdjacent then
        set chainAdjacent = false
    endif
    set n = knocker.create(source, targ, angle*bj_DEGTORAD, startspeed*TIMER_INTERVAL, decrement*TIMER_INTERVAL*TIMER_INTERVAL, killDestructables, knockAdjacent, chainAdjacent)
    if Counter == 0 then
        call TimerStart(Timer, TIMER_INTERVAL, true, function Update)
    endif
    
    set Entries[id]       = Entries[id] + 1
    set HitIndex[id]      = Counter + 1
    set Knockers[Counter] = n
    set Counter           = Counter + 1
    return true
endfunction

private function Init takes nothing returns nothing
    call SetRect(DestRect, -DEST_RADIUS, -DEST_RADIUS, DEST_RADIUS, DEST_RADIUS)
    set DesBoolexpr = Condition(function KillDests_Check)
    set AdjBoolexpr = Condition(function KnockAdj_Check)
endfunction
endlibrary

library LastOrder initializer Init needs UnitIndexingUtils
//******************************************************************************
//* BY: Rising_Dusk
//* 
//* This library has a lot of usefulness for when you want to interface with the
//* last order a unit was given. This can be useful for simulating spell errors
//* and where you'd want to give them back the order they had prior to the spell
//* cast (whereas without this library, they'd just forget their orders).
//* 
//* There are some handy interfacing options for your use here --
//*     function GetLastOrderId takes unit u returns integer
//*     function GetLastOrderString takes unit u returns string
//*     function GetLastOrderType takes unit u returns integer
//*     function GetLastOrderX takes unit u returns real
//*     function GetLastOrderY takes unit u returns real
//*     function GetLastOrderTarget takes unit u returns widget
//*     function AbortOrder takes unit u returns boolean
//*
//* There are also some order commands that can be useful --
//*     function IssueLastOrder takes unit u returns boolean
//*     function IssueSecondLastOrder takes unit u returns boolean
//*     function IsLastOrderFinished takes unit u returns boolean
//* 
//* You can access any information you'd like about the orders for your own
//* order handling needs.
//* 
globals
    //* Storage for last order
    private          integer array Order
    private          integer array Type
    private          widget  array Targ
    private          boolean array Flag
    private          real    array X
    private          real    array Y
    
    //* Storage for second last order
    private          integer array P_Order
    private          integer array P_Type
    private          widget  array P_Targ
    private          boolean array P_Flag
    private          real    array P_X
    private          real    array P_Y
    
    //* Order type variables
            constant integer       ORDER_TYPE_TARGET    = 1
            constant integer       ORDER_TYPE_POINT     = 2
            constant integer       ORDER_TYPE_IMMEDIATE = 3
    
    //* Trigger for the order catching
    private          trigger       OrderTrg             = CreateTrigger()
endglobals

function GetUnitId takes handle h returns integer
    return GetHandleId(h)
endfunction

//**********************************************************
function GetLastOrderId takes unit u returns integer
    return Order[GetUnitId(u)]
endfunction
function GetLastOrderString takes unit u returns string
    return OrderId2String(Order[GetUnitId(u)])
endfunction
function GetLastOrderType takes unit u returns integer
    return Type[GetUnitId(u)]
endfunction
function GetLastOrderX takes unit u returns real
    return X[GetUnitId(u)]
endfunction
function GetLastOrderY takes unit u returns real
    return Y[GetUnitId(u)]
endfunction
function GetLastOrderTarget takes unit u returns widget
    return Targ[GetUnitId(u)]
endfunction
//**********************************************************
private function OrderExclusions takes unit u, integer id returns boolean
    //* Excludes specific orders or unit types from registering with the system
    //* 
    //* 851972: stop
    //*         Stop is excluded from the system, but you can change it by
    //*         adding a check for it below. id == 851972
    //* 
    //* 851971: smart
    //* 851986: move
    //* 851983: attack
    //* 851984: attackground
    //* 851990: patrol
    //* 851993: holdposition
    //*         These are the UI orders that are passed to the system.
    //* 
    //* &gt;= 852055, &lt;= 852762
    //*         These are all spell IDs from defend to incineratearrowoff with
    //*         a bit of leeway at the ends for orders with no strings.
    //* 
    return id == 851971 or id == 851986 or id == 851983 or id == 851984 or id == 851990 or id == 851993 or (id &gt;= 852055 and id &lt;= 852762)
endfunction
private function LastOrderFilter takes unit u returns boolean
    //* Some criteria for whether or not a unit's last order should be given
    //* 
    //* INSTANT type orders are excluded because generally, reissuing an instant
    //* order doesn't make sense. You can remove that check below if you'd like,
    //* though.
    //* 
    //* The Type check is really just to ensure that no spell recursion can
    //* occur with IssueLastOrder. The problem with intercepting the spell cast
    //* event is that it happens after the order is 'caught' and registered to
    //* this system. Therefore, to just IssueLastOrder tells it to recast the
    //* spell! That's a problem, so we need a method to eliminate it.
    //* 
    local integer id = GetUnitId(u)
    return u != null and GetWidgetLife(u) &gt; 0.405 and Type[id] != ORDER_TYPE_IMMEDIATE
endfunction
private function SecondLastOrderFilter takes unit u returns boolean
    //* Same as above but with regard to the second last order issued
    local integer id = GetUnitId(u)
    return u != null and GetWidgetLife(u) &gt; 0.405 and P_Type[id] != ORDER_TYPE_IMMEDIATE and P_Order[id] != Order[id]
endfunction
//**********************************************************

function IsLastOrderFinished takes unit u returns boolean
    return (GetUnitCurrentOrder(u) == 0 and Order[GetUnitId(u)] != 851972) or Flag[GetUnitId(u)]
endfunction

function IssueLastOrder takes unit u returns boolean
    local integer id = GetUnitId(u)
    if LastOrderFilter(u) and Order[id] != 0 and not Flag[id] then
        if Type[id] == ORDER_TYPE_TARGET then
            return IssueTargetOrderById(u, Order[id], Targ[id])
        endif
        if Type[id] == ORDER_TYPE_POINT then
            return IssuePointOrderById(u, Order[id], X[id], Y[id])
        endif
        if Type[id] == ORDER_TYPE_IMMEDIATE then
            return IssueImmediateOrderById(u, Order[id])
        endif
    endif
    return false
endfunction

function IssueSecondLastOrder takes unit u returns boolean
    //* This function has to exist because of spell recursion
    local integer id = GetUnitId(u)
    if SecondLastOrderFilter(u) and P_Order[id] != 0 and not P_Flag[id] then
        if P_Type[id] == ORDER_TYPE_TARGET then
            return IssueTargetOrderById(u, P_Order[id], P_Targ[id])
        endif
        if P_Type[id] == ORDER_TYPE_POINT then
            return IssuePointOrderById(u, P_Order[id], P_X[id], P_Y[id])
        endif
        if P_Type[id] == ORDER_TYPE_IMMEDIATE then
            return IssueImmediateOrderById(u, P_Order[id])
        endif
    endif
    return false
endfunction

function AbortOrder takes unit u returns boolean
    if IsUnitPaused(u) then
        return false
    endif
    if not IsUnitPaused(u) then
        call PauseUnit(u, true)
        call IssueImmediateOrder(u, &quot;stop&quot;)
        call PauseUnit(u, false)
    endif
    return true
endfunction
//**********************************************************

private function Conditions takes nothing returns boolean
    return OrderExclusions(GetTriggerUnit(), GetIssuedOrderId())
endfunction

private function Actions takes nothing returns nothing
    local unit    u  = GetTriggerUnit()
    local integer id = GetUnitId(u)
    
    //* Store second to last order to eliminate spell recursion
    set P_Order[id]  = Order[id]
    set P_Targ[id]   = Targ[id]
    set P_Type[id]   = Type[id]
    set P_Flag[id]   = Flag[id]
    set P_X[id]      = X[id]
    set P_Y[id]      = Y[id]
    
    set Flag[id]     = false
    set Order[id]    = GetIssuedOrderId()
    if GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER then
        set Targ[id] = GetOrderTarget()
        set Type[id] = ORDER_TYPE_TARGET
        set X[id]    = GetWidgetX(GetOrderTarget())
        set Y[id]    = GetWidgetY(GetOrderTarget())
    elseif GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER then
        set Targ[id] = null
        set Type[id] = ORDER_TYPE_POINT
        set X[id]    = GetOrderPointX()
        set Y[id]    = GetOrderPointY()
    elseif GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_ORDER then
        set Targ[id] = null
        set Type[id] = ORDER_TYPE_IMMEDIATE
        set X[id]    = GetUnitX(u)
        set Y[id]    = GetUnitY(u)
    debug else
        debug call BJDebugMsg(SCOPE_PREFIX+&quot; Error: Order Doesn't Exist&quot;)
    endif
    
    set u = null
endfunction
//**********************************************************

private function SpellActions takes nothing returns nothing
    set Flag[GetUnitId(GetTriggerUnit())] = true
endfunction
//**********************************************************

private function Init takes nothing returns nothing
    local trigger trg = CreateTrigger()
    call TriggerAddAction(OrderTrg, function Actions)
    call TriggerAddCondition(OrderTrg, Condition(function Conditions))
    call TriggerRegisterAnyUnitEventBJ(OrderTrg, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
    call TriggerRegisterAnyUnitEventBJ(OrderTrg, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
    call TriggerRegisterAnyUnitEventBJ(OrderTrg, EVENT_PLAYER_UNIT_ISSUED_ORDER)
    
    call TriggerAddAction(trg, function SpellActions)
    call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    
    set trg = null
endfunction
endlibrary

library UnitIndexingUtils uses AIDS
endlibrary

library TerrainPathability initializer Initialization
//******************************************************************************
//* BY: Rising_Dusk
//* 
//* This can be used to detect the type of pathing a specific point of terrain
//* is, whether land, shallow water, or deep water. This type of detection
//* should have been easy to do using natives, but the IsTerrainPathable(...)
//* native is very counterintuitive and does not permit easy detection in one
//* call. For that reason, this library was developed.
//*
//* The system requires a dummy unit of some sort. There are no real
//* requirements upon the dummy unit, but it needs a non-zero movement speed.
//* More importantly than the dummy unit, though, it needs a custom windwalk
//* based unit ability with a 0.00 duration and no fade time. Both of those
//* raw id's (for the unit and windwalk dummy) need to be configured below.
//*
//* There is an objectmerger call available for those of you too lazy to build 
//* your own windwalk based ability. Simply uncomment it below and save once,
//* then close and reopen your map and recomment the line.
//*
globals
    constant integer TERRAIN_PATHING_DEEP                           = 1
    constant integer TERRAIN_PATHING_SHALLOW                        = 2
    constant integer TERRAIN_PATHING_LAND                           = 3
    constant integer TERRAIN_PATHING_WALKABLE                       = 4
    
    private unit Dummy                                              = null
    private constant integer DUMMY_UNIT_ID                          = 'hfoo'
    private constant integer DUMMY_WINDWALK_ID                      = 'win&amp;'
    private constant player OWNING_PLAYER                           = Player(15)
    
    //* These variables shouldn't be adjusted
    private real WorldMinX                                          = 0.
    private real WorldMinY                                          = 0.
endglobals

////! external ObjectMerger w3a ANwk win&amp; anam &quot;Collision Ability&quot; ansf &quot;&quot; Owk3 1 0.0 Owk4 1 0 Owk2 1 0.0 Owk1 1 0.0 acdn 1 0.0 ahdu 1 0.0 adur 1 0. aher 0 amcs 1 0

function IsTerrainPathingType takes real x, real y, integer terrainPathingType returns boolean
    local boolean b = false
    if terrainPathingType == TERRAIN_PATHING_DEEP then
        return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)
    endif
    if terrainPathingType == TERRAIN_PATHING_SHALLOW then
        return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)
    endif
    if terrainPathingType == TERRAIN_PATHING_LAND then
        return IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY)
    endif
    if terrainPathingType == TERRAIN_PATHING_WALKABLE then
        call SetUnitPosition(Dummy, x, y)
        set b = GetUnitX(Dummy) == x and GetUnitY(Dummy) == y and not (not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY))
        call SetUnitX(Dummy, WorldMinX)
        call SetUnitY(Dummy, WorldMinY)
    endif
    return b
endfunction

private function Initialization takes nothing returns nothing
    local rect r = GetWorldBounds()
    
    set WorldMinX = GetRectMinX(r)
    set WorldMinY = GetRectMinY(r)
    set Dummy = CreateUnit(OWNING_PLAYER, DUMMY_UNIT_ID, 0., 0., 0.)
    call UnitAddAbility(Dummy, DUMMY_WINDWALK_ID)
    call UnitAddAbility(Dummy, 'Avul')
    call IssueImmediateOrderById(Dummy, 852129)
    call SetUnitX(Dummy, WorldMinX)
    call SetUnitY(Dummy, WorldMinY)
    
    call RemoveRect(r)
    set r = null
endfunction
endlibrary

library GroupUtils
//******************************************************************************
//* BY: Rising_Dusk
//* 
//* This library is a simple implementation of a stack for groups that need to
//* be in the user's control for greater than an instant of time. Additionally,
//* this library provides a single, global group variable for use with user-end
//* enumerations. It is important to note that users should not be calling
//* DestroyGroup() on the global group, since then it may not exist for when it
//* it is next needed.
//*
//* The group stack removes the need for destroying groups and replaces it with
//* a recycling method.
//*     function NewGroup takes nothing returns group
//*     function ReleaseGroup takes group g returns boolean
//*     function GroupRefresh takes group g returns nothing
//* 
//* NewGroup grabs a currently unused group from the stack or creates one if the
//* stack is empty. You can use this group however you'd like, but always
//* remember to call ReleaseGroup on it when you are done with it. If you don't
//* release it, it will 'leak' and your stack may eventually overflow if you
//* keep doing that.
//* 
//* GroupRefresh cleans a group of any shadow references which may be clogging
//* its hash table. If you remove a unit from the game who is a member of a unit
//* group, it will 'effectively' remove the unit from the group, but leave a
//* shadow in its place. Calling GroupRefresh on a group will clean up any
//* shadow references that may exist within it.
//* 
globals
    //* Group for use with all instant enumerations
    group ENUM_GROUP = CreateGroup()
    
    //* Temporary references for GroupRefresh
    private boolean Flag                                              = false
    private group Refr                                                = null
    
    //* Assorted constants
    private constant integer MAX_HANDLE_COUNT                         = 408000
    private constant integer MIN_HANDLE_ID                            = 0x100000
    
    //* Arrays and counter for the group stack
    private group array Groups
    private integer array Status[MAX_HANDLE_COUNT]
    private integer Count                                             = 0
endglobals

private function H2I takes handle h returns integer
    return GetHandleId(h)
endfunction

private function AddEx takes nothing returns nothing
    if Flag then
        call GroupClear(Refr)
        set Flag = false
    endif
    call GroupAddUnit(Refr, GetEnumUnit())
endfunction
    
function GroupRefresh takes group g returns nothing
    set Flag = true
    set Refr = g
    call ForGroup(Refr, function AddEx)
    if Flag then
        call GroupClear(g)
    endif
endfunction

function NewGroup takes nothing returns group
    if Count == 0 then
        set Groups[0] = CreateGroup()
    else
        set Count = Count - 1
    endif
    set Status[H2I(Groups[Count])-MIN_HANDLE_ID] = 1
    return Groups[Count]
endfunction

function ReleaseGroup takes group g returns boolean
    local integer stat = Status[H2I(g)-MIN_HANDLE_ID]
    if g == null then
        debug call BJDebugMsg(SCOPE_PREFIX+&quot; Error: Null groups cannot be released&quot;)
        return false
    endif
    if stat == 0 then
        debug call BJDebugMsg(SCOPE_PREFIX+&quot; Error: Group not part of stack&quot;)
        return false
    endif
    if stat == 2 then
        debug call BJDebugMsg(SCOPE_PREFIX+&quot; Error: Groups cannot be multiply released&quot;)
        return false
    endif
    if Count == 8191 then
        debug call BJDebugMsg(SCOPE_PREFIX+&quot; Error: Max groups achieved, destroying group&quot;)
        call DestroyGroup(g)
        return false
    endif
    if Count != 8191 then
        call GroupClear(g)
        set Groups[Count]                = g
        set Count                        = Count + 1
        set Status[H2I(g)-MIN_HANDLE_ID] = 2
    endif
    return true
endfunction
endlibrary
</i></i>

Problem solved. Happy mapping...

If you want to understand what I did, all I did was strip out the UnitIndexingUtils library and replace it with:
JASS:
library UnitIndexingUtils uses AIDS
endlibrary

The function name happens to be precisely the same, so it's a cheap win. :)

Let me know how you fare. If it fails, for some reason, you may need to replace it manually. Let us know if that gives you any trouble. ;)
 

Crazy_Dead

New Member
THANKS!!

NOW IT WORKS!

Thanks J4L!! :thup:

EDIT: Or not :(
Error: On External Call : //! external UnitPropertiesGenerator.lua Doesnt Exist

I know the error; but not how to solve it. The file is in the EGUIfolder. And my map is in the Warcraft3/Maps/Downloads.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • tom_mai78101 tom_mai78101:
    You need to buy a laptop that supports external GPUs for this.
  • tom_mai78101 tom_mai78101:
    I'm pretty lucky to get myself an Alienware 15 with RTX 2070.
  • Varine Varine:
    I think I'm moving back up north for the summer, I got offered my job as the tournant chef back and I'm tired of struggling down here, it pays like twice as much too
  • Varine Varine:
    I think imma give four or five weeks of notice today to my boss, and see how much that backfires on me. I know he's struggling to hire anyone though, so it's like, do a couple weeks of interviews with me and then we'll have two or three weeks to train someone to take over for me. Hopefully he doesn't fucking let me go in like two weeks cuz that would really fuck me up right now
  • tom_mai78101 tom_mai78101:
    Wouldn't it be better if you give 3 to 4 weeks of notice? So that, at least you are guaranteed for 1 more week of paycheck to hold you over?
  • tom_mai78101 tom_mai78101:
    By the way, where are you moving to?
  • Varine Varine:
    Back to Idaho for the summer, then maybe Houston in August or so, my girlfriend or whatever we are loved it there
  • Varine Varine:
    I'm not sure yet, but my parents need some help cuz they're getting older and my mom has MS so can't do much anymore, so I'll be able to get their property fixed up so they can sell their other house. And the resort is stoked to have me back for the summer, cuz they always struggle with staff.
  • Varine Varine:
    I think it'll be alright, even if they cut me loose a bit early I do have some money and I know plenty of people that will lend me the few hundred bucks to get up there. I'm just catching up after last year still, if I have to kite some bills for a couple weeks it'll be fine.
  • Varine Varine:
    I hate my job but I do like one of my bosses, he does try really hard to get me what I need, and I want to make sure I leave with them comfortable with a new manager
  • Varine Varine:
    I like my coworkers for the most part too as much as I bitch about them, they just aren't reliable. As kids tend to be, I was a shithead at 19 and 20 too I'm sure, so
  • tom_mai78101 tom_mai78101:
    Good luck on getting things going.
  • Varine Varine:
    Eh, it'll be fine, I got it mostly planned out already. Roommates know, boss will know in about an hour when I go to work, I'll have a plane booked once we decide my last day, and I have a place to stay up there lined up for two or three months
  • Varine Varine:
    That all came together surprisingly easily
  • Varine Varine:
    I think I'm going to give 4 weeks, so that'll give me 2 more full checks probably, and then one more coming after I leave.
    +1
  • Varine Varine:
    All that shit came together really well suprisingly. My boss was upset cuz I am really good at my job suprisingly, but he's stoked that he got 4 weeks, plus one or two if he needs it, my flight's book in mid June, but I start my new job almost immediately so it'll be nice to have some time to chill and pack and get my rooms cleaned out. He actually gave me a dollar raise right after I gave notice to thank me for not being short or just leaving and making sure I can help interview and train someone to replace me. He is really cool, his food truck has just been a nightmare to run. I get my vaccine next week finally, allegedly Idaho will let me have my license back when I get there, and I have all my bills up to date so it should be an easy move this time around.
  • Varine Varine:
    Is anyone else getting server timeouts in the chat? I think it's on my end, my wifi adapter has been acting up recently
  • Varine Varine:
    100% my end, idk what it is though.
  • tom_mai78101 tom_mai78101:
    Just woke up. No idea.
  • jonas jonas:
    sounds great :) have fun in Idaho
  • The Helper The Helper:
    freaking Idaho
  • Varine Varine:
    Yeah it sucks up there, but it'll be a bit easier for the summer probably.
  • The Helper The Helper:
    When you get to Houston you will have your pick there is a huge shortage of good people to work in your field here. They are hiring everywhere and Texas is pretty much fully open.
  • The Helper The Helper:
    for anyone else following this yes I am in Houston so Varine and I will RL meet gotta love it! Looking forward to it!
  • jonas jonas:
    awesome

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top