• 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.

[vJASS] EnterRegion trigger glitching

Status
Not open for further replies.
Level 6
Joined
Oct 23, 2011
Messages
182
Hello

My code is glitching and I need some help!
The actions don't work for some reason

JASS:
library Teleport initializer onInit

    //The part that's glitching
    //! textmacro CreateMovePoint takes LETTER, moveX, moveY
        private function move$LETTER$ takes nothing returns boolean
            call SetUnitX(GetTriggerUnit(), $moveX$)
            call SetUnitY(GetTriggerUnit(), $moveY$)
            
            return false
        endfunction
    //! endtextmacro
    
    //! textmacro CreateTeleport takes minX, minY, maxX, maxY, LETTER
        set trg = CreateTrigger()
        set reg = CreateRegion()
        set rct = Rect($minX$, $minY$, $maxX$, $maxY$)
        
        call RegionAddRect(reg, rct)
        call RemoveRect(rct)
        call TriggerRegisterEnterRegion(trg, reg, null)
        call TriggerAddCondition(trg, Condition(function move$LETTER$))
    //! endtextmacro
    
    //! runtextmacro CreateMovePoint("a", "-8295", "-18465")

    private function onInit takes nothing returns nothing
        local trigger   trg
        local region    reg
        local rect      rct
            
        //! runtextmacro CreateTeleport("-5225", "-23325", "-4915", "-23045", "a")
        
        set trg = null
        set reg = null
        set rct = null
    endfunction
    
endlibrary
 
JASS:
        call TriggerRegisterEnterRegion(trg, reg, null)
        call TriggerAddCondition(trg, Condition(function move$LETTER$))

Could be:

JASS:
call TriggerRegisterEnterRegion(trg, reg, Filter(function move$LETTER$))

And if you do that change the top part of your code to this:

JASS:
            call SetUnitX(GetFilterUnit(), $moveX$)
            call SetUnitY(GetFilterUnit(), $moveY$)
 
Status
Not open for further replies.
Top