HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ring-Around-The-Unit Is Displaced After UnHide?

01-20-2008, 08:31 PM#1
Brash
I have this unit type that i keep creating with a perfect selection-circle and when i go to Hide and then Unhide that unit, the circle is then off-centered from the model of the unit.

Any way to fix that unit's selection circle?
01-21-2008, 06:31 AM#2
Zandose
Seems to work fine for me. Maybe your talking about something different? Here's what I tested, while playing press the ESC key (top left of keyboard) to go to the next part of the trigger. Post your trigger, map, or an example trigger.
Collapse JASS:
scope HiddenUnit

globals
    boolean ESC = false
endglobals

private function Wait takes nothing returns nothing
    loop
        if ESC then
            set ESC = false
            exitwhen true
        endif
        call TriggerSleepAction(.10)
    endloop
endfunction

private function Actions takes nothing returns nothing
    local unit u = CreateUnit(Player(0), 'hpea', 0, 0, 270)
    call SelectUnit(u, true)
    call Wait()
    call ShowUnit(u, false)
    call SelectUnit(u, true)
    call Wait()
    call ShowUnit(u, true)
    call SelectUnit(u, true)
    call BJDebugMsg("Done")
endfunction

private function Queue takes nothing returns nothing
    set ESC = true
endfunction

public function InitTrig takes nothing returns nothing
    local trigger trig1 = CreateTrigger()
    local trigger trig2 = CreateTrigger()
    call TriggerRegisterTimerEvent(trig1, 1, false)
    call TriggerAddAction(trig1, function Actions )
    //----
    call TriggerRegisterPlayerEvent(trig2, Player(0), EVENT_PLAYER_END_CINEMATIC)
    call TriggerAddAction(trig2, function Queue )
endfunction

endscope
01-21-2008, 12:29 PM#3
Brash
i'm on a different comp to copy the trig over., but what i do is this:

1. i have a Sentry ward with the doodad/destructible model of the Barrel (the one standing upright). and the model size is like a little bigger that tauren chieftan/infernal... so i probably set it to model size 3.00+ i'm guessing about.

then at the Initialization of the map i run a trig that runs an "Integer A": loop of 1- 650 and creates 650 Barrel unts evenly spaced out like a chessboard, centered in 650 small regions.
and hides each unit instantly in that same loop so nobody can see them for even an instant.

then, with no wait-states and in the same trigger i run another "integer A": loop for 1-270
and I "Unhide" 270 of those 650 barrels.

and their selection circle is now off-center...

hmm, i just had an idea... i have 650 "foot switch"es preplaced on the same spots.. and hidden at the moment of the INI, (before barrel ini)

think that is interfering?

one test i did was creating a test trigger that when i type "-refresh" it picks all of the unhidden barrels and Replaces them with a unit-type equal to their same unit-type and the ring looks fixed... but the momment i unhide one of the other remaining 380 barrels, their rings are screwed up like the first 270...
then when i run the test-replace trig on those their ring is fixed.
01-21-2008, 06:28 PM#4
Zandose
Elevators do effect the circles placement.

Collapse JASS:
scope HiddenUnit

globals
    boolean ESC = false
endglobals

private function Wait takes nothing returns nothing
    loop
        if ESC then
            set ESC = false
            exitwhen true
        endif
        call TriggerSleepAction(.10)
    endloop
endfunction

private function Actions takes nothing returns nothing
    local unit u = CreateUnit(Player(0), 'hpea', 0, 0, 270)
    call SelectUnit(u, true)
    call Wait()
    call ShowUnit(u, false)
    call SelectUnit(u, true)
    call Wait()
    call ShowUnit(u, true)
    call SelectUnit(u, true)
    call Wait()
    call CreateDestructable('DTrf', 0, 0, 270, 1, 1) 
    call BJDebugMsg("Done")
endfunction

private function Queue takes nothing returns nothing
    set ESC = true
endfunction

//===========================================================================
public function InitTrig takes nothing returns nothing
    local trigger trig1 = CreateTrigger()
    local trigger trig2 = CreateTrigger()
    call TriggerRegisterTimerEvent(trig1, 1, false)
    call TriggerAddAction(trig1, function Actions )
    //----
    call TriggerRegisterPlayerEvent(trig2, Player(0), EVENT_PLAYER_END_CINEMATIC)
    call TriggerAddAction(trig2, function Queue )
endfunction

endscope